Skip to main content

Authentication and scopes

The Canary API authenticates every request with an organization API key. Send the key with the HTTP Bearer scheme.

Key prefixes and data access

Test and live keys access the same organization data. The prefix selects a rate-limit bucket. Use a dedicated Canary organization or clearly identified fixtures when development calls create, update, archive, or delete records.

Create a key

  1. As an organization administrator, open Settings → API Keys in Canary.
  2. Select Create API Key.
  3. Give the key a name that identifies its owner and workload.
  4. Choose the test or live prefix.
  5. Grant the smallest set of scopes required by the integration.
  6. Copy the key into your secret manager when Canary displays it.
Canary stores a hash of the key and shows the complete secret once.

Scope model

Every endpoint requires one exact scope. Read and write capabilities are separate: a write scope does not imply its read scope. Keys belong to one organization; an organization ID in a request cannot switch the key’s tenant. API keys act as integration principals, not as the human user who created them. Human team membership and role presets do not replace API-key scopes.

Work management

Equipment and inventory

Linking or unlinking a part to an asset requires parts:write. Both resources must belong to the key’s organization.

Work-order parts and cost visibility

GET /work-orders/{id}/parts uses work_orders:read; its commands use work_orders:write. These are work-order operations, not direct inventory adjustment endpoints. Use the returned capabilities to determine allowed transitions and edits. Organization settings, lifecycle rules, and stock availability can still reject a command with the correct scope. Work-order reads include their economic projection. work_orders:read therefore grants visibility of work-order labor rates, labor costs, and purchase costs; it is not a cost-redacted permission.

Organization feature modules

Scopes do not enable disabled features. These module checks apply in addition to scopes and tenant checks: Identifier resolution filters unavailable targets. Retiring an identifier and archiving a meter remain available for cleanup after a module is disabled. Work-order parts retain history and expose service-computed capabilities for permitted recovery; a disabled module does not grant permission to create new stock commitments.

Organization data

Keep keys safe

  • Store keys in a secret manager or protected environment variable.
  • Create one key per integration and deployment environment.
  • Keep keys out of source control, client-side applications, logs, URLs, and support screenshots.
  • Rotate a key by creating its replacement, deploying the replacement, then revoking the previous key.
  • Revoke a key immediately when its owner or workload changes unexpectedly.

Authentication and authorization errors

Authentication errors use application/problem+json and include the same X-Request-ID value as the body request_id.
The generated endpoint reference displays each operation’s required scope.

Revoke a key

Open Settings → API Keys, select the key, and confirm revocation. Requests made with that key begin returning 401 invalid_api_key immediately.