Keystone Developers
Open Keystone
Guides

Conventions

Errors

The ErrorResponse shape, the status codes you will see, and what the codes mean.

Every error from SOR has one shape:

{
  "request_id": "7f9d1c2e-...",
  "success": false,
  "error": {
    "code": "not_found",
    "message": "Service not found",
    "details": null
  }
}
FieldNotes
request_idThe same id a success would carry.
error.codeA stable, machine-readable string.
error.messageHuman-readable. May change; do not match on it.
error.detailsOptional structured context: validation errors by field, or, on the Edits API, the refused items by index.

Status codes

StatusWhen
400The request is malformed in a way validation could not express.
401Missing or invalid credential for the surface.
403Valid credential, but not allowed: wrong business, wrong role, or a policy that refuses.
404No such resource, or a feature that is off for this business.
409Conflict: compare-and-swap failed, a claim is held by someone else, a slug is taken.
422Validation error. details lists the fields.
429Rate limited. Retry after the interval in Retry-After.
500Server error. Quote the request_id.

Every endpoint in the reference lists the codes it can return, all with the ErrorResponse body.

On the Edits API

A staged changeset can be partly refused: items that fail validation or compare-and-swap are listed in error.details.items with their index, entity, code, and message, so a caller can fix only those. The MCP server passes this through to the model verbatim.