Skip to main content
Every Perform.AI Public API endpoint requires a Bearer access token. You generate the token with the OAuth 2.0 client credentials flow, using the API credentials from your account, and send it in the 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.
Treat your Client Secret like a password. Never expose it in client-side code, mobile apps, or public repositories — token generation belongs on your server.

Generate a token

1

Build the Basic authentication header

Combine your credentials as client_id:client_secret and Base64-encode the result:
The 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: 3600 seconds).
  • 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_response envelope used by all functional endpoints.