Home › Documentation › API › Authentication
API authentication
Tokens
The API uses bearer tokens. An administrator creates a token in the console under Settings › API tokens › New token. The token is shown once; store it securely.
Authorization: Bearer cbk_live_4f9a...
Tokens begin with cbk_live_. A token belongs to the tenant, not to the user who created it, but is revoked if that user is removed.
Scopes
| Scope | Allows |
|---|---|
devices:read | List and read devices |
devices:write | Rename a device, start a backup, refresh policy |
jobs:read | List and read jobs |
restores:read | List and read restores |
usage:read | Read usage and generate reports |
Give each integration its own token with only the scopes it needs. There is no scope that allows starting a restore through the API.
Expiry and rotation
Tokens can be created with an expiry of 30, 90 or 365 days, or without expiry. We recommend 365 days at most. The console shows when each token was last used. To rotate, create a new token, deploy it, then revoke the old one.
IP restrictions
A token can optionally be restricted to a list of source IP ranges.
Resellers
A token created in a parent tenant can read its child tenants. Add the X-Cbk-Tenant header with the child's tenant name to address one, or omit it on list endpoints to receive results for all children with a tenant field on each object.
Failures
| Status | code | Meaning |
|---|---|---|
| 401 | token_missing | No Authorization header |
| 401 | token_invalid | Unknown, expired or revoked token |
| 403 | scope_required | Token lacks the scope for this endpoint |
| 403 | ip_not_allowed | Request came from outside the token's allowed ranges |
If a token is exposed
Revoke it immediately in the console. Revocation takes effect within 60 seconds. All API calls are recorded in the audit log with the token's name, so you can review what was done with it.
v1 keys
v1 used an X-Api-Key header. v1 keys do not work with v2 and cannot be converted; create a token.