# API keys

Create, rotate and revoke organisation API keys.

Base URL: https://api.audiobly.com

### POST /v1/api-keys

Create API key

Create an API key for the caller's organisation with the given name, scopes and optional
expiry. The full secret is returned only in this response; store it securely. API and MCP
access come with the Enterprise plan: 403 PLAN_REQUIRED on any other plan.

Scope: org_manage

Body (JSON):

- `name` (string, required): A label that helps you recognise the key.
- `scopes` (array of string): The permissions this key is limited to; leave out for a key with full access.
- `expires_in_days` (integer): Number of days until the key expires; use this or expires_at.
- `expires_at` (string (date-time)): When the key expires, as an ISO 8601 date and time.

Responses:

- 201: Successful Response
- 422: The request did not validate.
- 401: The key is missing, unknown, revoked or expired.
- 403: The key lacks the scope this call needs, or the organisation is not on Enterprise.
- 429: Over the request rate. Wait for Retry-After seconds.
