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

# Authentication

> Authenticate REST API v1 and MCP requests using OAuth 2.1, native app tokens, or Pro developer API keys (es_live_...).

Every request to `/api/v1/*` and `/mcp` authenticates with a bearer token in the `Authorization` header. Incoming `Cookie` headers are stripped before authentication so browser sessions are never reused accidentally.

```http theme={null}
Authorization: Bearer es_live_your_api_key_here
```

## Credential types

1. **OAuth 2.1 (MCP connectors):** Dynamic client registration (`/oauth/register`) with PKCE (`S256`) at `/oauth/authorize` and `/oauth/token`. Best for Claude, ChatGPT, Cursor, and interactive MCP hosts.
2. **Pro developer API keys (`es_live_...`):** Long-lived server-to-server bearer tokens for CI pipelines, Zapier/Make automations, and LMS integrations.
3. **Native app sessions:** Scoped per-app tokens issued via **Settings → AI apps** (`POST /api/v1/connect`).

## Using Pro API keys

API keys are available to Pro accounts under **Settings → API keys** (`/settings/api`):

* **One-time reveal:** The full `es_live_...` secret is displayed once at creation with `Cache-Control: no-store`. Only its SHA-256 hash and `es_live_...` prefix are stored.
* **Limit & expiry:** Up to `10` active API keys per account, each valid for `365` days.
* **Route scope:** API keys can access all non-destructive Studio REST and MCP routes (`GET /api/v1/me`, projects, kits, runs, draft generation, specialist turns, and exports). Account deletion (`POST /api/v1/account/delete`) and project/kit mutation routes outside the connector allowlist return `403 api_key_forbidden`.
* **Optional share links:** Check **Allow creating public share links** when minting a key to allow `POST /api/v1/kits/{kit}/lesson` and `POST /api/v1/kits/{kit}/practice`. Without this flag, those endpoints return `403 links_not_allowed`.

```bash theme={null}
curl -sS https://enablementstudio.ai/api/v1/me \
  -H "Authorization: Bearer es_live_..."
```

## Auth error codes

| Status | Code | Meaning |
| - | - | - |
| `401` | `signed_out` | Missing, malformed, expired, or revoked bearer token. |
| `403` | `pro_required` | Valid API key, but the owning account is not currently a Pro account. |
| `403` | `api_key_forbidden` | Route is restricted to interactive web sessions (`Settings → Account` or destructive deletion). |
| `403` | `links_not_allowed` | Key or connector was minted without share-link permission. |
| `403` | `connector_forbidden` | Route or workspace action disallowed for this connector token. |

> [!NOTE]
>
> Revoke any compromised key immediately from **Settings → API keys**. Revocation deletes its stored hash right away and subsequent API calls fail with `401 signed_out`.


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