HTTP contract
Errors
Trestle returns stable machine-readable error codes without leaking database details.
{"error":{
"code":"validation_failed",
"message":"The request could not be applied.",
"requestId":"req_2f",
"fields":[{"path":"values.title","code":"required"}]
}}Core statuses
400malformed input or invalid limits.401/403missing identity or insufficient authority.404collection or record not found.409uniqueness, schema, or idempotency conflict.412/428stale or missing optimistic version.422field validation failure.
Use the response's request ID to correlate the failure with structured server logs.
Provider storage
Constraint failures are normalized into the same stable error envelopes on both providers: uniqueness, foreign-key, check and serialization errors map to consistent codes without leaking SQL or connection details.