Skip to main content
The API uses the OAuth 2.0 client credentials grant. Your system sends its client ID and client secret to the token URL, gets back an access token, and sends that token with each request. The client secret goes only to the token URL. The access token goes to every other route.

Get an access token

Send a POST to the token URL:
The curl command gives curl only the client ID, so curl asks for the client secret. Paste it at the prompt. Typed there, it is not shown and is not kept in your shell history, as it would be inside a command. The Python example reads both from environment variables. Use only the standard library, as it does, or the HTTP client you already have.
Your tool may ask for the client ID and client secret as form fields instead of a header. The token URL accepts client_id and client_secret in the body too. Use one or the other.

The response

200 OK

Reuse a token until it expires

An access token works for an hour. Keep it and reuse it for every request in that hour. Don’t ask for a new one before each request: the token URL is rate limited. There are no refresh tokens. When a token expires, or a request answers 401, ask for a new token the same way.

Ask for fewer scopes

Without scope, a token carries every scope the client secret holds. To get a token that can do less, name the scopes you want:
You can ask only for scopes the client secret holds. A client secret holds the scopes its service account had when the secret was made, so a scope added since is not among them until you rotate the secret.

Send the access token

Send the token in the Authorization header of every request:
Send the access token there, never the client secret. A request with anything else as the Bearer value answers 401.

When the token URL refuses

The token URL answers errors in the OAuth 2.0 shape, which differs from the rest of the API:
401 Unauthorized