Error Handling
HTTP status codes, the error response format, and what to retry.
The full list of error codes is in Developers → Errors.
Error response format
Every error has the same body:
-
Branch on
code, not onmessage; messages are written for people and can change. -
messageis an array when a request fails several input validations at once: -
Quote
requestIdwhen you contact support.
Status codes
| Status | Meaning | Retry? |
|---|---|---|
200, 201, 202, 204 | Success (202 for queued jobs such as bulk and metadata deploys) | — |
400 | Malformed or invalid request, or a business rule refused it | No. Fix the request |
401 | Missing, invalid, expired or revoked credentials | No. Fix the credential |
403 | Not allowed: scope, plan, Profile, IP allow-list, field-level security | No |
404 | Not found, or not visible to you (indistinguishable on purpose) | No |
409 | Conflict: an idempotency conflict or a state conflict | Depends on the code |
423 | The record is locked by a pending approval | After the approval completes |
429 | Rate limited | Yes, after Retry-After seconds |
500 | Unexpected error | Reads: yes, with backoff. Writes: only with an Idempotency-Key |
503 | Temporarily unavailable | Yes, after Retry-After |