JWTs
JSON Web Tokens (JWTs) are signed JSON objects that authenticate your API requests.
After you authenticate with application tokens or user credentials, the API returns a JWT called auth_token.
Use the auth token
Include the auth_token in the Authorization header of every API request using the Bearer scheme:
The following example shows how to include the auth_token when creating a new user:
Don’t confuse auth_token with application_token.
Application tokens are long-lived credentials you use to obtain an auth token.
The auth token is what you include in API request headers.
JWT structure
A JWT consists of three parts separated by dots: header.payload.signature
Decode and inspect tokens
To inspect a JWT’s contents, use jwt.io or decode it in your application.
Never share your auth tokens publicly. If you use jwt.io, be aware that the token contents are visible and could be logged. For production debugging, decode tokens locally.
Example using Python:
Handle expired tokens
When your auth_token expires, API requests return a 401 Unauthorized error.
To handle this:
- Catch the
401response in your application - Re-authenticate to get a new token (using your application token or refresh token)
- Retry the failed request with the new token
To avoid failed requests, track token expiration and refresh proactively.
For user credentials, the auth_token expires after 240 minutes.