JSON API Payload Patterns/Structured error payload

Return a machine-readable error code and human-readable message.

Section: Errors, events, and partial updates

Structured error payload

json
json
{
  "error": {
    "code": "USER_NOT_FOUND",
    "message": "No user exists for the supplied id.",
    "details": {
      "id": "usr_999"
    }
  }
}
Explanation

Structured errors are easier to handle consistently across clients.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Errors, events, and partial updates
Partial update payload
Send only the fields that should change.
OpenIn sheetjsonsame section
Event-style message payload
A message with event type, timestamp, and nested data.
OpenIn sheetjsonsame section
Single resource response
A simple object response with nested data.
OpenIn sheetjson2 tag match
Paginated list response
A list payload with page metadata.
OpenIn sheetjson2 tag match
Cursor-based response
Include a cursor token for the next page.
OpenIn sheetjson2 tag match