Skip to content

Authentication

View as Markdown

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.

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.

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.

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_INCLUDED otherwise);
  • with a payment more than 7 days overdue, the API keeps answering reads but refuses changes with SUBSCRIPTION_READ_ONLY.
  • 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 read only.
  • Set an expiry date for temporary integrations.
  • Revoke keys you no longer use. The portal shows when each key was last used.