Every error response uses the same envelope. Branch on the code: it is a stable part of the contract. A code is never renamed or removed without a major version change; new codes are additive.
{
"code": "VALIDATION_ERROR",
"message": "phone_number must be a valid E.164 number.",
message is human-readable and may change. request_id (also in the X-Request-Id header) identifies the request for support. details is optional and depends on the code.
The endpoint requires an Idempotency-Key header and none was sent.
IDEMPOTENCY_KEY_INVALID
400
The Idempotency-Key is malformed.
IDEMPOTENCY_CONFLICT
409
The same key was reused with a different request body.
IDEMPOTENCY_IN_PROGRESS
409
A request with the same key is still being processed. Retry shortly.
The Idempotency-Key header is optional on every endpoint today, so IDEMPOTENCY_KEY_REQUIRED is reserved for any future endpoint that opts into requiring it. See the idempotency guide for the full semantics.