Skip to content

Errors

Every error has the same shape, including unknown paths (404 not_found) and methods (405 method_not_allowed):

{
"error_code": "validation_failed",
"message": "One or more fields are invalid.",
"retryable": false,
"request_id": "req_01a148543d6e77bc980f5967df8cc1bf",
"details": [{ "field": "transaction.currency", "message": "must be NGN" }]
}
  • error_code is stable and meant for your code. message is for people.
  • retryable: true marks errors worth retrying, such as rate_limited (with a Retry-After header) and internal_error.
  • Validation failures are 422 validation_failed, with details: [{ field, message, code? }].
  • Quote request_id when you contact support.
Status Meaning Retry?
400 The request could not be understood, or has unknown fields No
401 Invalid, expired or revoked API key No
403 Missing scope or role, or the monthly quota is used up No
404 Not found No
409 Conflict, such as policy_in_use or idempotency_key_reused No
413 Too large, such as backtest_too_large No
422 Validation failed. See details No
429 Rate limited. Wait for Retry-After Yes
500, 502, 503, 504 Server-side problem Yes, with backoff
Class When
AsqaryConfigError Bad client configuration (API key, identifier key, base URL)
AsqaryInputError Invalid input caught before sending
InvalidRequestError 400
AuthenticationError 401
PermissionError, QuotaExceededError 403
NotFoundError 404
ConflictError 409
PayloadTooLargeError 413
ValidationError 422, with fieldErrors
RateLimitError 429, with retryAfter
ServerError 5xx
ConnectionError, TimeoutError No response, or it took too long