Every request to the Titan API must include a valid API key. Titan uses binary API keys with aDocumentation Index
Fetch the complete documentation index at: https://docs.usetitan.app/llms.txt
Use this file to discover all available pages before exploring further.
titan_ prefix — they are cryptographically self-contained, verified without a database lookup, and carry the scopes and expiry directly inside the token. This page covers everything you need to create, scope, rotate, and troubleshoot your keys.
Key format
API keys follow this format:titan_ prefix followed by a base64url-encoded binary payload. The payload contains the key ID, tenant ID, scope bitmask, expiry timestamp, and an HMAC-SHA256 signature. The HMAC is never exposed in API responses.
If you are migrating from an older integration, legacy hex-format keys still work but emit a deprecation warning. Rotate to the new format at your earliest convenience.
How to authenticate
Pass your API key in theAuthorization header as a Bearer token on every request:
Creating a key
UsePOST /api/account/keys to create a new key. You must specify a human-readable label, a lifetime in days, and the scopes you want to grant.
PATCH /api/account/keys/{id}:
label— rename the key at any time.isActive— set tofalseto disable the key without deleting it.
Scopes
Scopes limit what a key can do. Always grant the minimum scopes your integration needs.| Scope | What it allows |
|---|---|
* | All permissions — use only for testing |
sessions:read | Read session status and info |
sessions:manage | Create, start, stop, pair, and delete sessions |
messages:write | Send messages |
chats:read | List chats and chat metadata |
chats:manage | Archive, mute, and manage chats |
contacts:read | Read contacts and check if numbers are on WhatsApp |
contacts:manage | Block and unblock contacts |
groups:read | Read group info and participant lists |
groups:manage | Create groups, change settings, manage participants |
channels:read | List and read channel (newsletter) info |
channels:manage | Create, follow, mute, and delete channels |
status:write | Post WhatsApp Status (stories) |
presence:read | Read contact presence |
presence:write | Set your own presence (online/offline) |
labels:read | Read WhatsApp Labels |
labels:manage | Create, update, and assign labels to chats |
profile:read | Read your own profile info |
profile:write | Update your display name, status text, and profile picture |
webhooks:manage | Create, update, and delete webhook subscriptions |
media:read | Download and decrypt media files |
media:manage | Configure media storage settings |
Key expiry
All keys have a mandatory expiry. The default maximum lifetime is 90 days, though your plan may configure a different maximum. TheexpiresAt field in the key response tells you exactly when the key will stop working.
Plan for key rotation before expiry. If a key expires during active use, all requests using it will start returning 401 Unauthorized.
Rotating a key
Key rotation atomically creates a new key and immediately revokes the old one. UsePOST /api/account/keys/{id}/rotate:
Error responses
| Status | Meaning |
|---|---|
401 Unauthorized | The key is missing, malformed, expired, or has been revoked. |
403 Forbidden | The key is valid but does not have the required scope for the endpoint. |
error field describing the problem:
Client tokens
For browser-based integrations where you cannot safely expose an API key, Titan provides client tokens (titan_ct_ prefix). Client tokens are short-lived, carry no authority themselves, and have their permissions enforced server-side. They are intended for end-user-facing flows such as the embedded connect widget.
See Client Tokens for full documentation on minting tokens, configuring rules, and valid actions.
Self-hosted edition
On the self-hosted edition, the API server also accepts a static master key on admin routes (/admin/*). The master key is set during deployment and is separate from the per-tenant API key system described on this page. Use the master key only for instance administration — for everything else, create a regular API key.
The master key grants unrestricted access to all admin endpoints. Treat it with the same care as a root password and rotate it by redeploying with a new value.