Skip to main content
Every non-2xx response from v2 — including validation failures, 404 for unknown routes, and rate-limit rejections — uses the same envelope:
requestId also appears in the X-Request-Id response header. Log it and quote it in support tickets.

Fields

string
required
The error family. One of invalid_request_error, authentication_error, permission_error, rate_limit_error, card_error, or api_error.
string
required
A stable machine-readable code. Branch on code, not message. See the table below.
string
required
Human-readable explanation. Not stable — do not parse it.
string
The specific request field the error refers to, when applicable. Omitted otherwise.
string
required
Server request ID, equal to the X-Request-Id header.
Some codes carry extra detail alongside type/code/message. card_error responses on publish include shortfall, suggestedPack, billingPortalUrl, and declineCode; quote_changed includes quotedCost and currentCost. See Publishing and payments.

Status codes and common codes

Handling in code

Branch on error.code, not error.message or the HTTP status alone. Codes are stable across releases; messages and status codes may be tightened over time.
The 402 codes (insufficient_credits, card_declined, card_authentication_required) never bind the Idempotency-Key — retry publish with a new key after funding.