/v1) is authenticated with an API key sent in the Authorization header, in the Bearer scheme:
Key format
A partner key, in the format
rt_partner_…, is not a project key. It only works on the /v1/partner/* routes and never sends messages. On any project route it gets 401 api_key_invalid, and a project key does not work on partner routes either. See Partner keys.What you can do with your keys
- Create one or more keys per project, each with the minimum scopes the integration needs.
- Set an expiry date and an IP allowlist for the key.
- Rotate a key without downtime: the new key is created and the old one stays valid until you revoke it.
- Revoke a compromised key. Revocation takes effect in about a second.
- See when each key was last used and spot the idle ones.
Creating, rotating and revoking keys are dashboard actions, on the API keys page, in the Developer group of the sidebar, authenticated by a user session. They do not use an API key.
Scopes
Each key carries a closed set of scopes. A new key starts with the minimum you asked for, never with full access. If a route requires a scope the key lacks, the API responds403 with the insufficient_scope code.
Scope required by each route
Each endpoint page in the API reference shows the required scope.
Check a key
GET /v1/whoami has no side effects. It returns the organization, the project, the key id and the scopes the key has.
Response
Troubleshooting
403 insufficient_scope: missing scope
403 insufficient_scope: missing scope
The key is valid but lacks the scope the route requires. The error message says which one. The scopes of a key do not change after it is created: create a new key with the scope you need, swap it into your integration and revoke the old one.
I get 404 for a resource that exists
I get 404 for a resource that exists
A resource of another project responds
404, never 403, so its existence is not revealed. Use GET /v1/whoami to confirm that the key belongs to the right project.Live or test key: which one am I using?
Live or test key: which one am I using?
Look at the prefix.
rt_live_ is live and rt_test_ is test. See Environments.Security best practices
Protect your keys
- Read the key from an environment variable or a secrets manager.
- Never publish the key in repositories, front ends, mobile apps or logs.
- Use one key per integration, with the minimum scopes.
- Rotate keys periodically and revoke any exposed key right away.