Authentication: API keys
How to create an XBASE API key, choose the scopes, send the key in requests, check it with GET /me and revoke it.
Updated on
The API uses workspace API keys, which start with xsk_. Each key has a name, works only in the workspace where it was created and only for the scopes you check.
Create the key
- In XBASE, open Integrations and go to the Agents & APIs tab. You need permission to manage integrations.
- On the API keys card, click New key (or Connect integration, if it is your first one).
- In Name, write who will use the key, like "Store ERP".
- In Permissions, check only what the integration needs (scopes).
- Click Create key. The Key created window shows the full key only once: copy it and keep it in a password manager.
- Click Done, I've copied it.
Use the key
Send the key in the Authorization header. To check that it works, call GET /me:
curl https://api.xbase.app/api/external/v1/me \
-H "Authorization: Bearer $XBASE_API_KEY"200 response:
{
"workspace": { "id": "8f0c2d4e-…", "name": "My company" },
"key": { "id": "3b1e9a77-…", "name": "Store ERP", "scopes": ["whatsapp:send"] }
}Keep the key in an environment variable or a secrets vault, never in the code of your website or app.
Revoke and replace the key
On the API keys card, each key shows its last 4 characters, the creation date and the last use. Click Revoke to cut access right away. Revoking also turns off the key's webhook.
To replace a key without stopping the integration: create the new one, update the system that uses it and only then revoke the old one.
Authentication errors
| Status | code | When |
|---|---|---|
| 401 | INVALID_API_KEY | no Authorization header, or the key has the wrong format, does not exist or was revoked |
| 403 | MISSING_SCOPE | the key exists but does not have the route's scope |
Example:
{
"statusCode": 401,
"timestamp": "2026-11-04T16:03:56.074Z",
"path": "/api/external/v1/me",
"method": "GET",
"message": "Chave de API inválida ou revogada.",
"code": "INVALID_API_KEY"
}Frequently asked questions
See also
XBASE API: overview
What the XBASE API does, the base URL, how to authenticate and the list of endpoints for WhatsApp, Instagram, webhooks and external agents.
Webhooks: receive events in real time
Receive WhatsApp events and Instagram comments and DMs at your URL in real time, check the signature and understand the retries.