Skip to main content

One error shape, a code on every error, and a request id on every response

Errors from POST /v1/send, the Public API (/api/public/v1) and the Developer Sandbox API now share one shape, and there is a page listing every code: Errors.

  • A code on every error. Some errors used to carry only a sentence in error. They now also carry a stable code: the specific one where the route has it, otherwise one derived from the HTTP status (for example not_found). Branch on code.
  • X-Request-Id on every response, success or error, and the same value as requestId in every error body. Quote it to support and we can find the exact call. You can send your own X-Request-Id to tie our logs to your trace.
  • Nothing you rely on changed. Every field and every code an error had before is still there, spelled the same way, including the older upper-case codes such as VALIDATION_ERROR. New codes are lower snake_case.
  • OpenAPI: every error response now references one Error schema and the X-Request-Id header, and x-motorical-error-codes lists every code (openapi.json, version 1.5.0).

Documentation changed