Skip to main content

Error Handling

The Betflow B2B API uses standard HTTP status codes to indicate the success or failure of requests.

HTTP Status Codes

CodeMeaningDescription
200OKRequest succeeded
400Bad RequestInvalid request parameters or body
401UnauthorizedMissing, invalid, or expired authentication
403ForbiddenValid authentication but insufficient permissions or blocked by network policy
404Not FoundResource does not exist
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server error

Error Response Format

Error responses return a JSON object with an error field:

{
"error": "description of what went wrong"
}

Some endpoints return the standard response envelope with a success flag:

{
"success": false,
"error": "description of what went wrong"
}

Common Error Scenarios

401 — Authentication Errors

{"error": "missing bearer token"}
{"error": "invalid authorization header"}
{"error": "invalid token"}
{"error": "invalid or missing API key"}

Resolution: Check your API key or access token. If using a JWT, it may have expired — refresh your token.

400 — Validation Errors

{"error": "invalid request body"}

Resolution: Check the API Reference for required parameters and valid values.

429 — Rate Limit Errors

{"error": "rate limit exceeded"}

Resolution: See Rate Limiting for backoff strategies.

403 — Forbidden

{"error": "forbidden"}

Resolution: Your client may not have permission to access this endpoint, or your IP/domain is not in the allowlist. Contact the Betflow team.