Authorization header.
Generate an API key
- Go to Settings → Access in the OpenCX dashboard.
- Click Create API Key.
- Give it a name (e.g. “Production”, “Staging”).
- Choose access level:
- Full access — the key can call every endpoint with no restrictions.
- Custom scopes — select only the resources and actions (read / write) this key needs.
- Copy the key.
Existing keys created before scopes were introduced remain full-access.
Using the key
Pass the key as a Bearer token in theAuthorization header on every request:
Scopes
Scopes restrict an API key to specific resources and actions. A full-access key bypasses all scope checks, while a scoped key can only call the endpoints it was granted. Each scope follows the patternresource:action, where action is read (GET / list) or write (create / update / delete).
Available scopes
| Resource | Read | Write |
|---|---|---|
| Actions | actions:read | actions:write |
| Autopilot | autopilot:read | autopilot:write |
| Blocklist | blocklist:read | blocklist:write |
| Chat sessions | chat-sessions:read | chat-sessions:write |
| Contacts | contacts:read | contacts:write |
| Crawl | crawl:read | crawl:write |
| CSAT | csat:read | csat:write |
email:read | email:write | |
| Handoff analytics | handoff-analytics:read | — |
| Help center | help-center:read | help-center:write |
| Insights | insights:read | insights:write |
| Office hours | office-hours:read | office-hours:write |
| Organization | org:read | org:write |
| Phone | phone:read | phone:write |
| Redaction | redaction:read | redaction:write |
| Sequences | sequences:read | sequences:write |
| SIP | sip:read | sip:write |
| Tags | tags:read | tags:write |
| Teams | teams:read | teams:write |
| Training | training:read | training:write |
whatsapp:read | whatsapp:write | |
| Widget | widget:read | widget:write |
| Workflows | workflows:read | workflows:write |
Handoff analytics only supports
read — there is no write scope.Error responses
| Status | Meaning |
|---|---|
401 Unauthorized | Missing or invalid API key |
403 Forbidden | Key is valid but lacks the required scope |
Best practices
- Never commit keys to source control. Use environment variables or a secrets manager.
- Rotate keys periodically. You can create multiple keys and revoke old ones from the dashboard.
- Use separate keys for each environment (production, staging, development) so revoking one doesn’t break the others.
- Use scoped keys in production. Grant only the permissions each integration needs (principle of least privilege).
- Prefer separate keys per integration so revoking one doesn’t break others, and each gets only the scopes it needs.