API Error Codes Reference
Complete reference for AskBiz API error codes — what each code means, common causes, and how to handle each error type in your integration.
Error response format
All AskBiz API errors return a JSON response body with the following structure:
```json
{
"error": {
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked.",
"status": 401,
"request_id": "req_01HXY..."
}
}
```
Always include the request_id when contacting support about an API error — it allows our team to look up the exact request in our logs.
4xx client errors
400 Bad Request — invalid_request
Your request is malformed. Check the request body format and required parameters. The message field specifies which parameter is missing or invalid.
401 Unauthorized — invalid_api_key
Your API key is missing, invalid, or has been revoked. Check that you are passing the key in the Authorization: Bearer header and that the key has not been deleted in Settings → Developer → API Keys.
403 Forbidden — insufficient_permissions
Your API key does not have the required scope for this endpoint. Check the endpoint's required scope in the API documentation and create a new key with the correct permissions.
404 Not Found — resource_not_found
The requested resource does not exist. Check the ID or slug in your request URL.
422 Unprocessable Entity — validation_error
The request is well-formed but contains invalid values (e.g. a date range where start > end). The message field describes the specific validation failure.
5xx server errors
429 Too Many Requests — rate_limit_exceeded
You have exceeded the rate limit for this endpoint. The response includes Retry-After (seconds to wait) and X-RateLimit-Reset (Unix timestamp when the limit resets) headers. Implement exponential backoff with the Retry-After value.
500 Internal Server Error — internal_error
An unexpected error occurred on AskBiz's servers. These are rare. Retry the request after a short delay (starting with 1 second, doubling each time). If the error persists, check status.askbiz.co and contact support with the request_id.
503 Service Unavailable — service_unavailable
AskBiz is temporarily unable to process requests (typically during a maintenance window or incident). The response includes a Retry-After header. Monitor status.askbiz.co for updates.
Handling errors in your integration
Retry logic:
- Retry 429 and 5xx errors with exponential backoff
- Do not retry 4xx errors (except 429) — they indicate a problem with the request that will not resolve on retry
Alerting:
- Alert on sustained 5xx error rates above 1% — this indicates a platform issue worth investigating
- Alert on 401 errors — these may indicate an API key has been rotated or revoked
Logging:
- Log the full error response body including
request_idfor every error — this is essential for debugging - Log the request URL and headers (excluding the Authorization header) alongside the error