Obtaining a token
Exchange staff credentials for a token pair:POST /api/customer/login instead. The
response shape is the same.
Using a token
Include the token on every authenticated request:Refreshing
Access tokens expire after 15 minutes (configurable per-broker). Exchange the refresh token for a new access token:Revocation
Signing out of a session revokes its tokens immediately:401 on the next request — no grace period.
Two-factor authentication
Accounts with TOTP enabled must submittotp_code (or a backup code) alongside
the password. Login returns 202 TOTP_REQUIRED otherwise.
Customer session vs. staff session
Tokens carry atype claim ("user" or "customer"). Endpoints under
/api/crm/*, /api/backoffice/*, /api/platform/*, and /api/admin/*
accept user tokens only. Endpoints under /api/customer/* accept customer
tokens only. The mismatch returns 403.
Programmatic access (API tokens)
For long-lived machine-to-machine integrations — affiliate portals, BI pipelines, KYC vendors — issue a scoped API token from the CRM’s Settings → API Access page. API tokens use theAuthorization: Bearer header
like JWTs but never expire unless you set a TTL, and each token is limited to
an explicit set of scopes. See the CRM UI for details.