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

# Authentication

> Create an API token, pick its scopes, and send it with every request.

Every request needs an API token in the `Authorization` header:

```bash theme={null}
curl https://api.getdecimal.ai/v0/me \
  -H "Authorization: Bearer sk-de-..."
```

A missing, invalid, or expired token gets `401` with code `unauthorized`.

## API keys

Open **Settings → API Keys** and create a token with only the scopes it needs. Keep it on your server. Never ship it in browser or mobile code.

To rotate a token, create a new one, move your traffic to it, then delete the old one.

## Scopes

Each endpoint requires one scope. A token without it gets `403` with code `forbidden`.

| Scope | Lets the token |
| - | - |
| `chat:write` | Send messages |
| `chat:read` | Read conversations |
| `chat:escalate` | Escalate a conversation to your helpdesk |
| `tickets:read` | Read synced tickets |
| `tickets:delete` | Delete synced tickets |
| `knowledge:read` | List, search, and read knowledge articles |
| `knowledge:delete` | Delete knowledge articles |

`GET /v0/me` works with any valid token. Call it to see which scopes a token has:

```json theme={null}
{
  "token": {
    "name": "Support portal",
    "prefix": "sk-de-abc1",
    "scopes": ["chat:read", "chat:write"]
  },
  "organization": { "id": "..." }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.