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

# Authentication

Every request requires two headers. Generate an API token from your [Atlas merchant portal](https://portal.atlas.kitchen/atlas-connect/api-tokens) and pass it as the `X-Api-Key` value:

| Header          | Value                                         |
| --------------- | --------------------------------------------- |
| `X-Api-Key`     | Your Atlas API token                          |
| `X-Merchant-Id` | Tells Atlas which merchant the request is for |

## Example

```bash theme={null}
curl https://api.atlas.kitchen/admin/v1/menus \
  -H "X-Api-Key: your-api-token" \
  -H "X-Merchant-Id: your-merchant-id"
```

## Token security

* The portal shows the token plaintext only once at creation — copy it somewhere safe before closing the dialog
* Don't share API tokens in public code, screenshots, or client-side code
* Store tokens in environment variables or a secret manager
* If a token is compromised, revoke it from the portal and generate a new one

## Error response

Invalid or missing API token returns `401 Unauthorized`:

```json theme={null}
{
  "type": "Unauthorized",
  "message": "You did not provide valid credentials for this request",
  "error_hash": {
    "api_key": "Check if the API Key is set correctly in the X-Api-Key header"
  }
}
```
