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

# Authentication

> Authenticate API requests with workspace-scoped Bearer API keys and understand annual plan requirements.

Every request to `/api/v1/*` must include an `Authorization` header carrying a workspace API key as a Bearer token:

```http theme={null}
Authorization: Bearer <HEARDRAFT_API_KEY>
```

## Eligibility & workspace scoping

* **Annual plan required**: API keys are enabled only for workspaces on a confirmed, active paid **annual** plan (Starter Annual or Team Annual). Free, guest, and monthly billing periods return HTTP `403`.
* **Workspace isolation**: An API key can only create and read tasks belonging to its own workspace. Polling a task ID owned by another workspace returns `404 TASK_NOT_FOUND`.
* **Cancellation behavior**: If you cancel automatic renewal on an active annual plan, API access continues until the end of the already-paid annual period.

## Creating and rotating keys

1. Open **[HearDraft Developers → API Keys](https://heardraft.com/app/developers/api)**.
2. Click **Create key**, give it a descriptive label (for example `prod-ingest-worker`), and copy the secret immediately.
3. Store the key in your backend secrets manager (AWS Secrets Manager, GCP Secret Manager, Vault, or server environment files with `0600` permissions).
4. When rotating credentials, generate a replacement key first, deploy it to your workers, and then revoke the old key. Revoked keys immediately fail with HTTP `401`.

> [!WARNING]
>
> Keep API keys strictly on your server. Do not pass HearDraft API keys into client-side JavaScript, browser extensions, or mobile bundles.


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