Skip to main content
Every failure, whatever the status, comes back in the same envelope. You write the error handler once.

Just focus on code

code field doesn’t change within the same API version and was made for you to make sure what caused this error. While message is just a human readable string. We made it just for easier logging of possible errors in your integration. The text may be changed in the future. request_id is the same value as the X-Request-Id header. Log it on failures and quote it in support tickets — it is how we find your exact request. See Resource IDs.

Validation failures

invalid_request adds a details array with one entry per violation, so you can point a user at the field that needs fixing instead of at the request as a whole. field is a path, nested with dots, for example items.0.slug at bulk operations.
Codes inside details are their own set and never overlap with the catalogue below.
Fields with unknown/incorrect names also count as a validation error.

Catalogue

Two more codes appear only inside bulk responses: duplicate_id_in_batch and duplicate_slug_in_batch. See Bulk operations.
New codes can appear for new scenarios without a new major version, so give your handler a fallback branch that keys off the HTTP status class. See Forward compatibility.