1.  [Documentation](/en/docs)
2.  [API](/en/docs/api/quickstart)
3.  Authentication

# Authentication

Authenticate every request with an API Key in the Authorization header.

## Create a key

Create keys from your [Account page](/account#api-keys). Every key starts with `dt_live_` and never expires on its own. You can have up to 5 active keys.

A key carries one or more of five scopes: `templates:read`, `runs:write`, `runs:read`, `reference_tables:read` and `reference_tables:write`. A new key gets all five.

`reference_tables:read` lists your reference tables and `reference_tables:write` replaces a table’s rows. Keys you created before these scopes existed were given both, so nothing needs re-creating.

## Send the key

Send the key as a Bearer token in the Authorization header. There is no cookie and no test mode:

    curl "https://doctransform.xyz/api/v1/templates" \
      -H "Authorization: Bearer $DOCTRANSFORM_API_KEY"

Copy

Since November 2026, an assistant you use yourself signs in with Allow: add DocTransform there, click Allow, and no key is involved, so nothing secret sits in a chat. A script, or an assistant with no sign-in, still takes a key as a header. The key stays in an environment variable:

**Claude Code**

    claude mcp add --transport http doctransform https://doctransform.xyz/mcp --header 'Authorization: Bearer ${DOCTRANSFORM_API_KEY}'

Copy

**Cursor**

    {
      "mcpServers": {
        "doctransform": {
          "url": "https://doctransform.xyz/mcp",
          "headers": {
            "Authorization": "Bearer ${env:DOCTRANSFORM_API_KEY}"
          }
        }
      }
    }

Copy

**VS Code**

    {
      "servers": {
        "doctransform": {
          "type": "http",
          "url": "https://doctransform.xyz/mcp",
          "headers": {
            "Authorization": "Bearer ${env:DOCTRANSFORM_API_KEY}"
          }
        }
      }
    }

Copy

The assistant stores the key in its own config file on your computer. Never add it with `--scope project`: that scope is saved in a file your team checks into a repository, and the key would travel with it.

## Rotate or revoke a key

There is no in-place rotation: create the new key, switch your script over to it, then revoke the old one from the same [Account page](/account#api-keys) card.

## Keep the key secret

**Warning** Never put a key in a browser or a repository. A key is a long-lived credential with full account access: keep it in an environment variable or a secrets manager.

A request without a valid key fails with [API\_KEY\_MISSING](/en/docs/api/errors-and-limits#API_KEY_MISSING), [API\_KEY\_INVALID](/en/docs/api/errors-and-limits#API_KEY_INVALID) or [INSUFFICIENT\_SCOPE](/en/docs/api/errors-and-limits#INSUFFICIENT_SCOPE).
