Open app

Errors

Standard error response shape and common error codes.

Mercel uses conventional HTTP status codes to signal success or failure. 2xx indicates success, 4xx indicates a client error (bad request, missing permissions, not found), and 5xx indicates a server error.

Error response shape

Every non-2xx response has the same JSON body:

{
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  }
}
  • code — a stable machine-readable identifier (e.g. UNAUTHORIZED, NOT_FOUND, VALIDATION, RATE_LIMITED).
  • message — a human-readable description, suitable for logging.
  • details — optional structured payload. For VALIDATION this contains the offending fields and Zod issues; for RATE_LIMITED it carries { retryAfterMs }.

Common codes

HTTP statusCodeWhen
400VALIDATIONRequest body or query parameters failed schema validation.
401UNAUTHORIZEDMissing or invalid Authorization header.
403FORBIDDENAuthenticated, but the credential cannot access the target resource (e.g. a credential used against a store it isn't bound to, or a PAT used for a write).
404NOT_FOUNDResource does not exist or is not visible to you.
409CONFLICTThe request conflicts with current resource state (e.g. a slug already in use).
429RATE_LIMITEDPer-key rate limit exceeded — see Rate limits.
500INTERNALAn unexpected error occurred. Includes a correlation id you can share with support.

Correlation ids

Every response carries an X-Correlation-Id header. Include it when reporting issues so we can find the request quickly.

On this page