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

# Authentication

> Use Batch Relay API keys to authenticate v1 API requests.

API requests authenticate with a bearer token:

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

Create, view, and revoke API keys from:

```text theme={null}
https://app.batchrelay.com/developers
```

## Scopes

| Scope                | Purpose                                 |
| -------------------- | --------------------------------------- |
| `print_orders:write` | Create print orders.                    |
| `print_orders:read`  | Read print-order status.                |
| `usage:read`         | Read usage summary.                     |
| `webhooks:read`      | Read webhook configuration.             |
| `webhooks:write`     | Create or change webhook configuration. |

## Missing keys

Requests without an API key return:

```json theme={null}
{
  "error": {
    "code": "api_key_required",
    "message": "Supply a Batch Relay API key using Authorization: Bearer <key>.",
    "docs_url": "https://docs.batchrelay.com/errors#api_key_required",
    "action_url": "https://app.batchrelay.com/developers"
  },
  "request_id": "req..."
}
```

## Revocation

Revoked keys stop working immediately. Create a new key if a bearer token is exposed.

## Environment isolation

API-key environment is authoritative at the stored hashed-key record, not
merely inferred from its prefix. A staging key can call only a staging host and
a production key can call only a production host. Never put production keys or
WHCC production credentials in staging, development, local test, or client
configuration.
