POST/v1/client_tokens

Client Tokens

Mint a short-lived (60s) browser-safe token scoped to a single Customer + origin + IP.

Request
HTTP
POST
URL
/v1/client_tokens
Auth
api_key
Try it
curl https://api.fightclub.pro/v1/client_tokens \
  -H "Authorization: Bearer $FC_API_KEY" \
  -d '{"customer":"cust_42","origin":"https://app.example.com"}'

Parameters

NameTypeDescription
customer*stringFC Customer ID this token is scoped to.
origin*stringAllowed Origin header (e.g. https://app.example.com).
allowed_endpointsstring[]Restrict to specific endpoints.

Response fields

NameTypeDescription
tokenstringJWT (60s expiry). Send as Authorization: Bearer.
expires_atintegerUnix timestamp.

Errors

  • 401invalid_api_key, Missing or revoked key.
  • 404customer_not_found, No such customer.

See the full error reference.

Examples