Skip to content

Authentication

Authentication endpoints for obtaining access tokens and managing API keys.

Generate an API token

Request

🔐 Required role: API_ADMIN, which every API key holds

Exchange a JWT API key for a short-lived bearer JWT used to access Product APIs.

This is the token-exchange endpoint itself, so no bearer token is required to call it — you authenticate with your jwtApiKey in the request body.

On Sandbox and Staging this request must also send the CF-Access-Client-Id and CF-Access-Client-Secret headers, or Cloudflare rejects it before it reaches the API. See Cloudflare Access.

No Tenant header is needed: the tenant is read from the key, and the token carries it. The token lasts up to an hour: the exchange can return a token issued earlier, with less time left, so request a new one whenever a call answers 401. See the Quickstart for the full flow.

Security
CfAccessClientId and CfAccessClientSecret
Bodyapplication/jsonrequired
jwtApiKeystringrequired

JWT API key obtained from Aiwyn Support.

curl -i -X POST \
  https://api.sandbox.aiwyn.app/v1/auth/token \
  -H 'CF-Access-Client-Id: YOUR_API_KEY_HERE' \
  -H 'CF-Access-Client-Secret: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "jwtApiKey": "string"
  }'

Responses

API Token generated successfully.

Bodyapplication/json
tokenstring

Bearer JWT for accessing Product APIs.

Response
{ "token": "string" }