ROOKDocs
5 min readUpdated August 2026

Error Handling & Rate Limits

Failures in the Rook API use standard HTTP status codes and a deterministic, uniform JSON error envelope. Every response includes a unique X-Request-ID header for end-to-end tracing.


Standard Error Envelope

{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_request",
    "message": "invalid order_by: foo. Valid options are: [created_at updated_at]",
    "param": "order_by",
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "doc_url": "https://docs.rookpayments.com/errors/invalid_request"
  }
}

Always branch programmatically on HTTP status and error.code. Do not parse error.message as a stable contract. The param field indicates the specific field, query parameter, or header that failed validation.


Error Code Catalogue

HTTPTypeCodeTrigger Condition
400invalid_request_errorinvalid_requestMalformed JSON, schema violation, or invalid parameters.
400invalid_request_errorprogram_requiredX-Program-ID omitted when the key has access to multiple programs.
401authentication_errorauthentication_errorMissing, malformed, or expired API key / Bearer token.
403permission_errorpermission_deniedKey lacks permission for this operation or program tenant partition.
404not_found_errornot_foundUnknown resource ID or entity belongs to another tenant.
409conflict_errorconflictIncompatible resource state transition.
409conflict_erroridempotency_conflictIdempotency-Key reused with a mismatched request payload.
422invalid_request_errorinsufficient_fundsSource financial wallet lacks sufficient available balance.
422invalid_request_errorcard_not_activeCard is FROZEN or TERMINATED and cannot process transactions.
422invalid_request_errorlimit_exceededSpend would exceed velocity, daily, or monthly limits.
429rate_limit_errorrate_limitedKey exceeded request quotas. Respect Retry-After header.
500api_errorinternal_errorTransient system fault. Safely retry with the same Idempotency-Key.

Rate Limits & Backoff

Rate limits are enforced at the API gateway layer per API key. When an application exceeds its allotted rate, the gateway responds with HTTP 429 Too Many Requests and includes the Retry-After header specifying the number of seconds to back off before retrying.

Was this page helpful?