Authorization header of each request.
Prerequisites
- A Perform.AI account with API access.
- Your Client ID and Client Secret: log in and go to Integrations > API. If no credentials have been generated yet, select Request Credentials.
Generate a token
1
Build the Basic authentication header
Combine your credentials as The
client_id:client_secret and Base64-encode the result:Authorization header value is Basic followed by the encoded string.2
Send the token request
Send a
POST request to /auth/oauth/token/ with a form-encoded body. Note the request format: application/x-www-form-urlencoded, not JSON.3
Read the response
A successful request returns the token and its lifetime:Unlike other endpoints, this response has no
api_response field.4
Call the API with the token
Send the token in the
Authorization header of every other request:If the response contains
"api_response": "200", your authentication setup works end to end.Token lifetime
- Tokens are valid for 1 hour (
expires_in: 3600seconds). - Requesting a new token does not invalidate existing ones — multiple tokens can be valid at the same time, so you can fetch a fresh token before the old one expires and rotate without downtime.
- Generate tokens on demand or on a schedule; there is no refresh token in this flow.
Troubleshooting
Next steps
- Follow the quickstart to create your first shipment.
- Read responses and errors to understand the
api_responseenvelope used by all functional endpoints.