Authentication
Every 52 Cloud API call is authenticated with an access token issued by the
Auth API at https://auth.fiftytwo.com.
There are two tokens:
Both are JWTs carrying an exp claim (a Unix timestamp), so you can read the
exact expiry without calling the API.
Sign in
A 200 returns both tokens:
Use the token
Send the access token on every request:
Refresh, don’t re-sign-in
Sign-in is rate limited to 15 requests per 60 seconds. Calling /v1/user
before every API request will get you 429 Too Many Requests. Cache the
access token for its full lifetime.
When a call returns 401, exchange the token pair for a fresh one:
Both tokens must belong to the same session. If the refresh fails, sign in again
with /v1/user.
The recommended loop
Sign in once
POST /v1/user. Store both tokens somewhere your whole integration can read
them, not per-process, or every worker will burn a sign-in.
Read exp from the access token
Decode the JWT payload and refresh a few minutes before it expires. This
avoids the 401 round trip entirely.
A 401 does not always mean “expired”. It can also mean the account lacks
privileges for that endpoint. If refreshing succeeds but the call still
returns 401, check the account’s permissions rather than retrying.
Register Sale is different
The Register Sale API authenticates with an Auth0-issued
Bearer JWT rather than a token from auth.fiftytwo.com. The header looks
identical; the issuer does not. Ask your FiftyTwo consultant which tenant issues
tokens for your integration.