Authentication
API keys & scopes.
Every /v1 endpoint — except the device token exchange, which uses a stream key — authenticates with an API key sent as a bearer token. Keys are created in the dashboard under API Keys, belong to a single organisation, and carry only the scopes you select.
The Authorization header
Send your key as a bearer token on every request. Keys are shown once at creation — store them in your backend secret manager, never in client code.
Authorization: Bearer dh_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Confirm a key is valid and see which organisation it maps to with the unscoped organisation endpoint — handy for multi-tenant apps verifying a configured key. (The bar above does exactly this when you click Verify.)
Scopes
Pick scopes when you create a key; the key can only reach endpoints its scopes allow. Use narrowly-scoped keys per service — a read-only fleet monitor doesn't need streams:write.
| Scope | Grants |
|---|---|
| streams:read | List and read streams, including session history. |
| streams:write | Create, rename and delete streams; rotate stream keys; set the safety policy. |
| controller:write | Assign and revoke the controller; latch and clear the e-stop. |
| tokens:mint | Mint access tokens for your end-users (viewer / controller). |
| webhooks:manage | Create, list and delete webhook endpoints. |
| rooms:read | List and read rooms, their video streams, who's connected and their session history (API v2). Also granted by streams:read. |
| rooms:write | Create, update and delete rooms, set what HLS records, latch and clear the e-stop, and change or disconnect live connections (API v2). streams:write grants it too, except the e-stop and changing connections. |
| rooms:connect | Connect to any room in the organisation, and send data into it from a server (API v2). |
| keys:read | List and read stream keys (API v2). |
| keys:write | Mint and revoke stream keys (API v2). |
| org:read | Read the organisation, its API keys, its members and pending invitations (API v2). |
| org:write | Rename the organisation and create and delete its API keys (API v2). Managing members takes a key with every scope. |
Errors
Authentication failures are distinct from authorization failures. Invalid or missing keys return 401; a valid key lacking the scope returns 403. A key over its rate limit also gets the 401 below, so never discard a key after a single 401.
{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}{
"error": {
"code": "insufficient_scope",
"message": "This API key does not have the required scope: this endpoint requires streams:write."
}
}Legacy keys
API keys created before scopes existed have no scopes stored and are treated as full-access. They keep working unchanged — rotate them onto scoped keys when convenient.Rate limits
API keys are rate-limited to 600 requests per minute. Customer backends that poll or rotate controllers continuously sit comfortably under this; if you expect to exceed it, batch where you can and reuse access tokens for their full 15-minute lifetime rather than minting per page load.
Over the limit, requests return 401 unauthorized, the same response as an invalid key, with no Retry-After header, until the one-minute window resets. Back off and retry reads. Retry writes only after checking whether they landed: POST requests aren't idempotent, so a blind retry can create a duplicate.