Skip to content

Errors

Every error has the same shape:

json
{
  "error": {
    "code": "invalid_request",
    "message": "sellAmount: Expected a value greater than 0",
    "request_id": "req_…",
    "details": { "issues": [  ] }
  }
}

code is stable and machine-readable — branch on it, not on message. request_id is also returned as the X-Request-Id header; quote it when you report a problem. details is present for validation errors and lists the offending fields.

Codes

HTTPcodeMeaningWhat to do
400invalid_requestBad or missing parameter, or a chain your key can't useFix the request; check details
401unauthorizedMissing, malformed, revoked, or unknown keyCheck the Authorization header
403forbiddenKey lacks the scope for this endpointRequest a key with the right scope
404not_foundNo such swap / webhook / routeCheck the id
409conflictIdempotency-Key reused on a different request, or swap already submitted with another txUse a fresh key / don't resubmit
429rate_limitedOver your rate limitBack off; see Retry-After
502upstream_errorA chain RPC or the subgraph was unreachableRetry with backoff
500internalSomething broke on our sideRetry; if it persists, send us the request_id

Handling tips

  • Treat 429 and 502 as transient — retry with exponential backoff and jitter.
  • Treat 400, 403, 404, 409 as your bug — don't blind-retry, fix the request.
  • A 200 with "fillable": false on POST /v1/swaps is not an error — it means no liquidity right now.