Errors
When a request fails, the API returns a non-2xx HTTP status and a JSON body. Most failures share a common shape; a few return a reduced shape. The Error envelope reference describes every variation. This page covers how to handle errors in a client.
The standard shape
Branch on the HTTP status code
Field availability is not uniform: error, code, and meta may be absent, and some errors omit statusCode from the body entirely. The one signal always available is the HTTP status code of the response itself. Branch on that first. Use code when it is present for a more precise decision, but never require it.
Handle message as a string or an array
message is always present, but its type varies. For a validation failure it is an array of individual messages:
Normalise it in your client, for example by joining an array into a single string before display.
Handling by status
Support traceability
When the response includes meta.requestId, log it. Including it in a support request lets the team locate the exact request and its server-side context.