cx-api-key HTTP header:
401 with code API_KEY_REQUIRED or INVALID_API_KEY.
Create and manage keys
Create keys in Settings → API. Each key is scoped to one organization — you cannot access another workspace’s data with the same key.Scopes
Scopes limit what a key can do. New keys default totickets:read only.
A key missing the required scope receives
403 with code FORBIDDEN_SCOPE.
Least privilege for AI agents
For read-only agent tools that list tickets, read threads, and summarize conversations:- Create a key with only
tickets:read. - Do not grant
tickets:writeortickets:exportunless the agent must call legacy write/export endpoints. - Link the key to a specific agent when you want view access to match that agent’s inbox permissions (see below).
Legacy keys without scopes
Keys created before scopes shipped may have an emptyscopes column. Those keys retain full access during the migration window. Re-create keys with explicit scopes when you rotate.
Agent-linked keys and view access
When an API key is linked to a support agent:GET /viewsreturns only views that agent can see in the inbox.GET /tickets?view_id=...returns404 VIEW_NOT_FOUNDif the view is not accessible to that agent.
Security practices
- Never expose API keys in client-side code, public repos, or browser extensions.
- Rotate keys immediately if one is leaked.
- Use separate keys per environment (staging vs production).
- Prefer scoped keys over legacy full-access keys.
Related
- Getting started — first request walkthrough
- Errors —
FORBIDDEN_SCOPEand other auth error codes