4xx and 5xx responses, so you can write one error handler that works across every endpoint.
The error envelope
Every error response has the same JSON shape:object
required
The error object describing what went wrong.
string
required
A unique identifier for this request, at the top level of the response (a sibling of
error, not nested inside it). Give this to support when reporting a problem.X-Request-Id
Every API response — successful or not — includes anX-Request-Id response header. Its value is the same identifier returned as request_id in the error envelope.
These are two surfaces of the same id:
X-Request-Idheader — present on every response, including2xxsuccesses and204 No Contentresponses that have no body.request_idbody field — present in every error envelope.
401 Unauthorized responses also include a WWW-Authenticate: Bearer header.Error types
error.type maps directly to the HTTP status code. The table lists every type, its status, the codes that can appear under it, and what it means.
The
Generation resource has its own job-level error object ({ code, message }) that describes why an async generation failed. That is part of a successful 200/202 poll response — it is not the error envelope described on this page.Example error response
A422 returned when importing invalid BPMN 2.0 to POST /diagrams/import. Note error.param pinpointing the offending field, and request_id at the top level.
Handling errors
Using request_id for support
When something goes wrong and you need help, therequest_id lets us locate the exact request in our logs.
1
Capture the id
Read
X-Request-Id from the response header (always present), or request_id from the error body. They are the same value.2
Log it alongside the error
Store the
request_id with error.type, error.code, and the HTTP status. Logging it on success too means you can correlate a later report with the originating call.3
Include it in your report
When contacting support, send the
request_id, the endpoint and method, the approximate timestamp, and the error.type / error.code you received.