Problem Details
also called RFC 9457, RFC 7807
A standard JSON structure for HTTP error responses, giving machine-readable type, human-readable detail, and room for extensions.
Without a standard, every API invents its own error shape, and every consumer writes bespoke parsing that breaks when the shape changes.
The structure: type (a URI identifying the error class — the field clients should branch on), title
(a short human-readable summary), status, detail (specific to this occurrence), instance, plus
any additional members the API defines.
The important discipline is that clients branch on type, not on the message text. A message is
for a human and may be reworded or localised; a type URI is a stable contract.
Two things worth including as extensions: a correlation ID so a support conversation can find the request, and field-level validation errors as a structured list rather than a concatenated string. Both remove a large amount of support and debugging effort.