Authentication header
Include your access token in theAuthorization header:
Making authenticated requests
Using fetch
Using GraphQL client
Most GraphQL clients support setting default headers:Getting access tokens
Access tokens are obtained through the OAuth 2.0 client credentials grant. See the Authentication guide for details on:- Obtaining client credentials
- Exchanging credentials for tokens
- Requesting a new token when the cached one expires
Token expiration
Access tokens are issued with a fixed lifetime (roughly 24 hours). There is no refresh-token grant β when a token expires you simply request a brand-new one from the token endpoint using the same client credentials. Cache the token along with its expiry and re-request when itβs expired:Error responses
Unauthenticated requests return:Best practices
- Store credentials securely - Never expose your client secret or tokens in client-side code
- Cache tokens and re-request before expiry - Reuse a cached token until it expires, then request a new one
- Handle errors gracefully - Surface authentication failures clearly
- Use HTTPS - Always use HTTPS in production
- Rotate credentials - Regularly rotate your client credentials for security