Errors
Answer every error as RFC 9457 problem details. Give it a stable type, a plain message and the exact fields that failed.
- Required 4
- Recommended 1
Required
Send errors as problem details
RequiredAnswer every error with an RFC 9457 problem details object, served as
application/problem+json.Keep error types stable
RequiredTreat each error
typeas part of the contract. Clients branch on it, so never rename or reuse one.Name every field that failed
RequiredWhen input fails validation, return every failing field at once, with where it is and why it failed.
Hide internals in errors
RequiredNever put stack traces, queries, file paths or server versions in an error. Log them, and return a reference the client can quote.
Recommended
Say when to retry
RecommendedFor 429 and 503, send
Retry-Afterso clients know how long to wait.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers api design playbook: https://agentwranglers.se/playbook/api-design/errors.