> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chift.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# Authenticate with Chift API

Chift’s API is protected by a **JWT Bearer Token**, which is required for all API requests.

To obtain this token, you first need an **API Key** for your account. The API Key provides the **Account ID**, **Client ID**, and **Client Secret** needed to generate your Bearer token.

Once you have your token, you can use it to make authenticated requests linked to your consumers.

> ℹ️ In short: **API Key → Bearer Token → API Requests**.\
> The API Key itself cannot be used directly to call APIs; it is only used to generate the Bearer token.

### 1. Create an API key

* Go to [**API Keys**](https://chift.app/api-keys)
* Click **“Add API Key”**
* Copy your **Account ID**, **Client ID**, and **Client Secret** immediately — you’ll need them next.

> 🔐 Each API key is environment-specific:
>
> * A **sandbox key** → sandbox environment
> * A **production key** → production environment
>
> Start creating in **sandbox**; when going live, create a new key in **production**.

You can also optionally limit the scopes of an API key to one or more consumers. See [Managing API Keys](/back-office/getting-started/create-api-key#consumer-specific-api-keys) for details.

***

### 2. Get a Bearer token

Use the [**Create a Token**](/api-reference/endpoints/general/get-access-token) endpoint to obtain your access token:

```bash theme={null}
POST /token
{
  "clientId": "your_client_id",
  "clientSecret": "your_client_secret",
  "accountId": "your_account_id"
}
```

> ⚠️ This is the only endpoint that doesn’t require authentication.\
> The token you receive is tied to the same environment as your API key.

***

### 3. Use the token for all other API requests

Add the token to every request header:

```bash theme={null}
Authorization: BEARER {accessToken}
```

> ⚠️ All other Chift API calls require this token.\
> Requests without it will be rejected.

***

✅ **In summary**

| Step                     | Description                                     | Environment                     |
| ------------------------ | ----------------------------------------------- | ------------------------------- |
| 1. Create API Key        | Defines whether you’re in sandbox or production | Determined by the key           |
| 2. Generate Bearer Token | Authenticates your session                      | Linked to the key’s environment |
| 3. Use Token             | Required for all API calls                      | Same environment                |
