Summary

  • RFC 9457, July 2023, Standards Track, obsoletes the 2016 problem details specification and defines JSON and XML formats for describing errors in HTTP APIs.
  • Its premise is that status codes are not enough: "HTTP status codes... cannot always convey enough information about errors to be helpful", and non-human consumers of APIs have trouble with HTML error pages.
  • The central design choice is naming: the type member is "a URI reference that identifies the problem type", consumers "MUST use the 'type' URI... as the problem type's primary identifier", and when it is missing the value is assumed to be about:blank.

A status code is a category, not a diagnosis

403 Forbidden tells a client that the request was understood and refused. It does not say whether the account is out of credit, the token expired, the object is in the wrong state, or the caller is not allowed to see this field.

For a person reading a browser page, an HTML explanation fills the gap. For a library, a retry policy or a monitoring system, an HTML page is noise, and an empty body is worse.

Turning an error into a name

Problem details gives each kind of failure an identity: a URI that stands for "this specific problem". The document's example is an account without enough credit, where the response can carry the balance as well as the type, so a client can act rather than complain.

Naming is the whole trick. Two systems that agree on a URI for "out of credit" can log it, count it, route it and document it, and their agreement does not depend on matching English sentences.

The identifier is not the documentation

The specification keeps two things apart that are easy to confuse. The type URI is an identifier, and the text at the other end is optional: if the URI is a locator, dereferencing it should produce human-readable documentation, and clients are told not to fetch it automatically.

That is a useful discipline for a network where identifiers are cheap and a request per error is not. The URI can be stable while the documentation behind it moves or briefly breaks.

Extensions and the discipline of ignoring

The format is a small set of members with an open door: an object can carry additional fields, and a client that does not understand a member must ignore it.

That rule is what lets the same error shape serve a payment API, a storage service and a firmware updater. Each can add its own vocabulary without inventing its own envelope.

Why an idiom needed a standard at all

By 2016, plenty of APIs returned JSON errors; almost none agreed on the names. A specification that says "put the human text here, the machine identifier there, and expect these fields" makes errors analysable across services instead of per vendor.

The 2023 revision is the ordinary second act: the first version proved the shape was wanted, and the second one tightened the wording, so that ten years of independent implementations could be described accurately.