Endpoint
Overview
Use this endpoint to generate a temporary access token (app token) using your app key. This token is required for all subsequent API calls and expires after one hour.Tokens expire after one hour. Implement token refresh logic to avoid authentication failures.
Authentication
This endpoint requires thex-api-key header but not a Bearer token.
| Header | Value | Required |
|---|---|---|
x-api-key | Your API key from onboarding | Yes |
Content-Type | application/json | Yes |
Request Body
Container for API data
Must be
"auth"Container for authentication attributes
The app key obtained from
/auth/key endpointExample Request
Response
Success Response (201 Created)
Contains URLs related to the resource
Container for response data
Example Response
Using the Token
Include the token in all authenticated API requests:The
Authorization header must be formatted as Bearer {token} with a capital “B” and a space between “Bearer” and your token.Code Examples
Token Management
Automatic Refresh
Implement automatic token refresh logic to avoid authentication failures:Error Responses
Common Error Scenarios
Invalid app key
Invalid app key
Error: 401 UnauthorizedSolution: Verify your app key is correct. If you’ve regenerated your app key, use the new one.
Expired app key
Expired app key
Error: 401 UnauthorizedSolution: Generate a new app key using the
/auth/key endpoint.Token expired during use
Token expired during use
Error: 401 Unauthorized (from other endpoints)Solution: Catch 401 errors and automatically refresh the token before retrying the request.
Best Practices
Cache Tokens
Store and reuse tokens for their full 1-hour lifetime to minimize API calls
Proactive Refresh
Refresh tokens 5 minutes before expiration to avoid service interruptions
Handle 401 Errors
Implement automatic token refresh on 401 responses
Monitor Expiration
Track token expiration time and log refresh events

