> For the complete documentation index, see [llms.txt](https://docs.parameter1.com/basecms-graphql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.parameter1.com/basecms-graphql/modifying-data/introduction.md).

# Introduction

To modify data using the BaseCMS GraphQL API, you must first login and obtain an authentication token. Each mutation to the API will verify your token and ensure that you have the required permission to modify the fields you change.

### Logging in

To obtain an access token, send a GraphQL query to the `login` mutation:

{% hint style="warning" %}
**Make sure you send your requests over HTTP/S!**

While the BaseCMS API will enforce HTTP/S connections, you must ensure your username,  password, and access tokens are not sent initially as plaintext over HTTP. Always verify you are using the `https://...` url to access the GraphQL API.

If you believe your account credentials have been compromised, please change your password within the Base interface immediately. For assistance contact <support@parameter1.com>.
{% endhint %}

{% tabs %}
{% tab title="Query" %}

```
mutation Login($input: UserLoginMutationInput!) {
  login(input: $input) {
    value
    expires
  }
}
```

{% endtab %}

{% tab title="Variables" %}

```
{
  "input": {
    "username": "my_user",
    "password": "my_password"
  }
}
```

{% endtab %}

{% tab title="Headers" %}

```
X-Tenant-Key: my_tenant_key
```

{% endtab %}

{% tab title="Response" %}

```
{
  "data": {
    "login": {
      "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
      "expires": 1583527780000
    }
  }
}
```

{% endtab %}
{% endtabs %}

This will return a JSON payload with your access token (`data.login.value`), and the expiration date when your credentials will no longer be valid. The expiration date is a UNIX timestamp (with milliseconds).

To access protected data or write data to Base using the API, you must include a valid access token with your request. Send this token as a `Bearer`-type Authorization header with any request that needs to be authenticated.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.parameter1.com/basecms-graphql/modifying-data/introduction.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
