Every request must include a valid bearer token in theDocumentation Index
Fetch the complete documentation index at: https://docs.flowpayroll.ai/llms.txt
Use this file to discover all available pages before exploring further.
X-Auth-Token header. Tokens are issued via the OAuth 2.0 client credentials grant.
How it works
Get credentials
You receive a
client_id and client_secret from Flow Payroll (see Obtaining credentials).Exchange for a token
Your application exchanges those credentials for a short-lived access token at the token endpoint.
Obtaining credentials
Client credentials are issued per integration. Contact your Flow Payroll account manager or hello@flowpayroll.ai to request aclient_id / client_secret pair.
Requesting a token
POST your credentials to the token endpoint using the standard OAuth 2.0 client credentials grant.| Environment | Token endpoint |
|---|---|
| Sandbox | https://auth.sandbox.flowpayroll.ai/oauth2/token |
| Live | https://auth.flowpayroll.ai/oauth2/token |
access_token in memory and reuse it until shortly before expires_in elapses.
Calling the API
Pass the token asX-Auth-Token on every request. Optionally include User-Id to attribute the call to a specific human user — this is recorded in audit logs but is not required for the request to succeed.
Errors
| Status | Cause | What to do |
|---|---|---|
401 Unauthorized | Missing, malformed, or expired X-Auth-Token | Mint a fresh token and retry. |
403 Forbidden | Token is valid but lacks access to the requested resource | Verify your credentials grant the scope you need. |
429 Too Many Requests | Rate limit hit | Back off and retry; do not loop calling the token endpoint. |
Best practices
- Cache tokens. Hitting the token endpoint per API call will rate-limit you and adds latency.
- Refresh proactively. Renew when ~10% of the token’s lifetime remains, not after a
401. - Log the token’s
jticlaim, not the token itself, when correlating requests in your own observability. - Set
User-Idwhen a request is initiated by an end user in your product, so the action is traceable in Flow Payroll’s audit log.