Skip to main content
To access the v2 API, authentication via bearer tokens is required. Tokens are generated by creating API keys through the dashboard. Signing the key with ES256 produces a short-lived JWT that you attach to every request.
Migrating from v1? The token format is identical, but v2 also requires an Idempotency-Key header on state-changing endpoints. See the migration guide for details.

Generating a JWT bearer token

Once an API key is created, a JWT bearer token can be generated by signing the key. This token is then used to authenticate requests to the v2 API. To generate a JWT bearer token, sign an API key using the ES256 algorithm with the name and privateKey from the downloaded API Key JSON file. The following snippets show how to create a JWT bearer token in various languages.
Run the code to generate the JWT bearer token.
Retrieve the organization ID from the orgId parameter and the private key from the privateKey parameter in the JSON file downloaded during API key creation.

Using the JWT bearer token

Once the JWT bearer token is generated, include it in the Authorization header of every request:
Replace {JWT_Bearer_Token} with the generated token.
  • JWT bearer tokens expire 2 minutes after generation. Generate a new token for continued API access.
  • Setting a longer expiry via exp is not allowed.
  • A unique JWT must be generated for each API request; reuse is not permitted.

Idempotency

v2 also requires an Idempotency-Key header on every state-changing request (POST, PUT, PATCH, DELETE). See the migration guide for the full list of affected endpoints, the cache TTL for each, and the error codes you should handle.