Authentication
The platform API authenticates with organization API tokens sent as HTTP Bearer tokens:
Authorization: Bearer YOUR_API_TOKEN
Creating tokens
In the Chatrixa dashboard open Developer Tools → Access Tokens
(/developer-tools/access-tokens) and click Generate. A token:
- is bound to your organization — every API call acts on that organization's contacts, templates, and WhatsApp account
- does not expire, but can be revoked at any time from the same screen
- carries the API access you chose when creating it (see Scopes below) — treat it like a password
Scopes
A token holds a list of scopes that limit what it can do. When you generate a token you choose Full access (the default) or Specific permissions. Tokens created before scopes existed keep full access; nothing changes for them.
| Scope | Grants |
|---|---|
* |
Everything (full access) |
messages:send |
POST /send, /send/template, /send/media |
contacts:read |
GET /contacts |
contacts:write |
POST /contacts, PUT and DELETE /contacts/{uuid} |
contact_groups:read / contact_groups:write |
the same split for /contact-groups |
canned_replies:read / canned_replies:write |
the same split for /canned-replies |
templates:read |
GET /templates, GET /templates/{uuid} |
templates:write |
POST /templates, POST /templates/sync, PUT and DELETE /templates/{uuid} |
otp:send |
POST /otp/send, POST /otp/verify |
otp:read |
GET /otp/usage |
:write does not include :read; tick both if an integration needs both. Give each
integration only what it needs: a store plugin that only sends OTP codes needs just
otp:send. You can change a token's scopes at any time from Access Tokens
without replacing the token.
A request without the required scope is refused:
{ "statusCode": 403, "code": "API_KEY_SCOPE_MISSING", "message": "...", "required_scope": "contacts:write" }
Where to keep it
Tokens belong on servers only:
- ✅ your backend, a store plugin's server-side settings, CI secrets
- ❌ browser JavaScript, mobile apps, public repositories
All official Chatrixa plugins follow this rule: the shopper's browser talks to the store's own backend, and only the store backend talks to Chatrixa.
Checking a token
curl https://chatrixa.com/api/verify -H "Authorization: Bearer YOUR_API_TOKEN"
Returns 200 when the token is valid and the subscription is active. The body
includes a scopes array (["*"] for full access). This endpoint needs no scope.
Failure modes
| Status | Meaning |
|---|---|
401 |
Token missing, revoked, or wrong |
403 |
Token valid, but the subscription is inactive, WhatsApp is not connected, or the token lacks the scope the endpoint needs (API_KEY_SCOPE_MISSING) |
429 |
Endpoint rate limit hit (OTP endpoints: 30 sends/min, 60 verifies/min per token) |