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
The error family. One of
invalid_request_error, authentication_error, permission_error, rate_limit_error, card_error, or api_error.type/code/message. card_error responses on publish include shortfall, suggestedPack, billingPortalUrl, and declineCode; quote_changed includes quotedCost and currentCost. See Publishing and payments. Template rejections keep their COMBO_* and TEMPLATE_* codes and can include violations and blanks. See Template errors.
Status codes and common codes
Handling in code
Branch onerror.code, not error.message or the HTTP status alone. Codes are stable across releases; messages and status codes may be tightened over time.
insufficient_credits, card_declined, card_authentication_required) never bind the Idempotency-Key — retry publish with a new key after funding.