Skip to content

Authentication and scopes

Every request to the API carries an API key in the Authorization header, with the Bearer scheme:

Authorization: Bearer vc_…

The API never uses cookies or sessions. A request without the header is answered with 401 and the code not_authenticated.

API keys

GET /v1/me answers with the customer of the key, and is the simplest way to check that a key works.

Scopes

A scope is <resource>:read or <resource>:write. A key with write on a resource can also read it; the opposite is not true.

ResourceScopes
jobsjobs:read, jobs:write
capturescaptures:read, captures:write
monitorsmonitors:read, monitors:write
webhookswebhooks:read, webhooks:write
listslists:read, lists:write
noticesnotices:read, notices:write
connectionsconnections:read, connections:write
labelslabels:read, labels:write
usageusage:read
billingbilling:read, billing:write (credits, credit packs and checkout, paid services)

A request that needs a scope the key does not have is answered with 403 and the code scope_missing; detail.required_scope names the missing scope.

Give each program the smallest set of scopes it needs: a program that only reads captures does not need jobs:write.

When a key is refused

StatusCodeMeaning
401not_authenticatedThe Authorization: Bearer header is missing.
401api_key_invalidThe key is malformed or does not exist.
401api_key_revokedThe key has been revoked.
401api_key_expiredThe key has expired.
401account_deactivatedThe account of the key is paused: the key works again when the account is reactivated.
403account_inactiveThe account of the key is suspended or being deleted.
403scope_missingThe key lacks the scope the operation requires.

The shape of an error response is described in Errors.

Identifiers

Every object has a public identifier made of a prefix and a random part, such as job_01J9Z3K4R5S6T7V8W9X0Y1Z2A3. Identifiers are not sequential. An identifier that belongs to another customer is answered with 404, exactly like one that does not exist.