RFC 9457: Better information for bad situations
RFC 9457 builds on RFC 7807 as the standard for describing HTTP API errors, so learn what's new, what to expect, and how to use it in your own APIs.

Standards are great; they offer common language and approaches that we can transfer between projects and technologies. This congruity is especially valuable in the API space where the principle of least surprise means that integration projects go swiftly and smoothly.
One of the newest standards in APIs isn't new at all; it's an update on the existing (and excellent) RFC 7807 Problem Details for HTTP APIs. The successor is RFC 9457 Problem Details for HTTP APIs and is a positive evolution on the existing well-established standard.
RFC 9457, Problem Details for HTTP APIs, is the IETF standard format for describing errors in HTTP API responses. A problem details response is a JSON object served with the application/problem+json media type, with optional type, title, status, detail, and instance fields plus any extension fields that a problem type needs. An XML form, application/problem+xml, is also defined. RFC 9457 was published in July 2023 and obsoletes RFC 7807, but it keeps the same format, so APIs that already follow RFC 7807 don't need to change their responses.
Let's start with a quick recap on RFC 7807, as it forms the basis for the new standard.
The goal of both standards is to provide a way to deliver more information about a problem than can be conveyed by a status code alone. Within each error category covered by a status code, there are problem types, and specifics for each individual situation. While humans can handle a status code with further detail in an HTML error response, APIs are mostly consumed by machines and so a machine-readable error details format was developed.
There are great advantages to a common format for every error response in an API, and even more advantages when that format is common across many APIs. Having a common format makes a better developer experience, providing familiarity and easy orientation. It provides real value to products and consumers by making new API integrations quick and easier to implement.
The error format contains the following fields, which are all optional:
type: URI that identifies the type of error that occurred, for examplehttps://example.com/validation-error. Whentypeis missing, its value is assumed to beabout:blank, which means the problem has no meaning beyond its HTTP status code.title: Short, human-readable summary of the problem type, such asForm validation failed. Every problem with the sametypeshould have the sametitle.status: A copy of the HTTP status code.detail: More information about the specific problem, and if it's appropriate also steps to correct it. For example, information about a form validation problem:Username is already taken, please choose a different username.instance: An identifier for this specific occurrence, which may not be useful to the client but may be included in a bug report for example.- Additional fields: Any fields may be added to give additional information, and consuming clients are expected to ignore any that they don't have specific support for.
This format is pretty comprehensive and has served us well. If you have already adopted RFC 7807, then rest assured that there is no rush to change away from this format immediately. RFC 7807 will be supported and in use for a long time, but RFC 9457 brings some features that represent a positive evolution of best practice.
A problem details response is an ordinary HTTP error response with the application/problem+json content type. For example, an API that can't find an order could respond like this:
404 Not Found
Content-Type: application/problem+json
{
"type": "https://example.com/problems/order-not-found",
"title": "Order not found",
"status": 404,
"detail": "No order with ID 8f2c exists in this account.",
"instance": "/errors/2f6c1e9a"
}
The type URI stays the same for every "order not found" error, while detail and instance describe this one.
The changes between the two RFC versions are small but mighty; helpfully the RFC itself includes a section outlining the changes. The format, the fields, and the media types stay the same. The RFC lists three changes:
| Change in RFC 9457 | What it means for your API |
|---|---|
| A registry of common problem type URIs (Section 4.2) | You can reuse a shared problem type from the IANA HTTP Problem Types registry instead of defining your own. |
| Guidance on multiple problems (Section 3) | A problem type can define an extension, such as an errors array, to report several problems of that type in one response. When problems have different types, return the most relevant or urgent one. |
Guidance on type URIs that can't be dereferenced (Section 3.1.1) | A type doesn't have to be a working link, but resolvable URIs that lead to documentation are encouraged. |
The shared registry is a little bit thin at the time of writing, but it will be interesting to see how it evolves. Many organizations have a similar concept, so a shared place to refer to the most common problems is a welcome addition to the API landscape.
The RFC also makes a clearer association between problem types and the additional fields that a client should expect to parse. For example, a problem with a validation error type can be expected to include an errors array describing the validation errors in a consistent format. If we build on the examples above, it would look something like:
{
"type": "https://example.net/validation-error",
"title": "Form validation failed",
"status": 400,
"detail": "One or more fields have validation errors. Please check and try again.",
"instance": "/log/registration/12345",
"errors": [
{
"name": "username",
"reason": "Username is already taken."
},
{
"name": "email",
"reason": "Email format is invalid."
}
]
}
Taking a consistent approach to which additional fields belong with which problem type also boosts the consistency of your API experience. Describe these fields in the documentation that the type URL directs (human) users to.
The truth is that errors occur. Having a consistent and well-structured format to describe what happened and ideally provide some next steps for eliminating the error is a great experience for consumers. Using the HTTP problem details standard provides an established and familiar framework that users can quickly adapt to and use to move past errors in a positive way. There are major benefits for API producers as well since the predictable approach reduces the overhead of ensuring good error handling for each new endpoint.
To learn more about problem details for HTTP APIs, a good place to start is RFC 9457 itself. Given the small differences between the versions, adding the Redocly operation-4xx-problem-details-rfc7807 rule to your API linting rulesets is probably a good idea for APIs using either standard.





