Authentication
Every call carries an API key in the Authorization header:
Authorization: Bearer gm_sd_…A call without a key, or with a key that is unknown, revoked or expired, answers 401. See Errors.
API keys
Section titled “API keys”Administrators create keys in the Duty portal under Integrations → Keys and webhooks. A key:
- belongs to one workspace and only reads and changes requests there;
- is shown once, when it is created. Duty stores only a digest, so a lost key cannot be recovered: create a new one and revoke the old;
- can expire on a date you choose, and can be revoked at any moment, which takes effect on the next call;
- shows its prefix (
gm_sd_ab12…) and when it was last used, so you can tell keys apart without exposing them.
Create one key per integration. If one leaks, you revoke only that one.
Scopes
Section titled “Scopes”A key has one or more scopes. A call that needs a scope the key lacks answers 403 with API_KEY_SCOPE_MISSING.
| Scope | Allows |
|---|---|
read |
Read catalogs, requests, comments and attachments. Every key has it. |
write |
Open requests, change their status or priority, comment and upload attachments. |
webhooks |
Create, change and delete webhooks, and read their deliveries. |
Each endpoint in the reference shows the scope it needs.
What else is checked
Section titled “What else is checked”On every call the API also checks the workspace, not only the key:
- the organization must be active;
- its plan must include API access (
API_ACCESS_NOT_INCLUDEDotherwise); - with a payment more than 7 days overdue, the API keeps answering reads but refuses changes with
SUBSCRIPTION_READ_ONLY.
Keep keys safe
Section titled “Keep keys safe”- Call the API from your servers, and read the key from an environment variable or a secret manager.
- Give each key only the scopes it needs: a reporting job needs
readonly. - Set an expiry date for temporary integrations.
- Revoke keys you no longer use. The portal shows when each key was last used.