Skip to content

Errors

Errors are returned as JSON with an error code and, where useful, a message or a fields map. Always branch on the HTTP status code first.

StatuserrorMeaningHow to fix
400bad_requestThe body was not valid JSON.Send well-formed JSON with Content-Type: application/json.
401unauthorizedMissing or invalid API key.Send a valid key (see Authentication); create a new one if revoked.
422validation_failedOne or more fields are invalid.Inspect fields and correct each entry.
500internal_errorUnexpected server error.Retry with backoff; if it persists, contact support.

The fields object maps each invalid field to a reason:

{
"error": "validation_failed",
"fields": {
"side": "must be one of: open, close",
"source": "is required"
}
}
  • 2xx — success. On 200 check deduped to know it was a retry.
  • 400 / 422do not retry unchanged; the request is malformed or invalid.
  • 401 — fix credentials before retrying.
  • 429 / 5xx — retry with exponential backoff and jitter. Pair retries with a client_signal_id so they stay idempotent.