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

# Authentication

> How to authenticate with the Platendoc API using API keys.

The Platendoc API uses **API keys** for authentication. Every request must include your key in the `Authorization` header.

## Getting an API key

1. Sign in at [app.platendoc.com](https://app.platendoc.com)
2. Navigate to **API Keys** in the sidebar
3. Click **Create API key**, give it a name, and select the scopes you need
4. Copy the key — it is only shown once

<Warning>
  Store your API key securely. It grants access to your workspace. If compromised, revoke it immediately from the portal.
</Warning>

## Using your API key

Pass your key as a Bearer token in the `Authorization` header on every request:

```bash theme={null}
curl -X POST https://api.platendoc.com/v1/generations \
  -H "Authorization: Bearer pdc_live_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "templateId": "tpl_...", "format": "pdf" }'
```

## Key format

All API keys are prefixed with `pdc_live_` followed by a random string.

```
pdc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

## Scopes

Each key has one or more scopes that control which endpoints it can access:

| Scope                 | Endpoints                                   |
| --------------------- | ------------------------------------------- |
| `generations:trigger` | `POST /generations`                         |
| `generations:read`    | `GET /generations`, `GET /generations/{id}` |

Requests made with a key missing the required scope return `403 Forbidden`.

## Errors

| Status | Code              | Meaning                                     |
| ------ | ----------------- | ------------------------------------------- |
| `401`  | `UNAUTHORIZED`    | Missing or malformed `Authorization` header |
| `401`  | `API_KEY_INVALID` | Key does not exist                          |
| `401`  | `API_KEY_REVOKED` | Key has been revoked                        |
| `403`  | `FORBIDDEN`       | Key lacks the required scope                |
