THE TAKEAWAYS
What to take away
- RFC 9457 is a common format for returning machine-readable details of HTTP API errors; in JSON it uses application/problem+json.
- Use the status code for the broad class, type for the kind of problem, detail for an explanation that helps the user fix it, and instance to identify the specific occurrence.
- The status member in the body is advisory and must match the actual HTTP status code.
- Keep stack traces and implementation details out of responses, and link to the logs with a reference ID instead.
- Make a catalogue of problem types a deliverable, and in acceptance testing check that real responses match it.
FROM PRIMARY SOURCES
What happens when error shapes drift
When building an API, teams usually specify successful responses carefully but leave error responses to whoever writes the code. The result is one feature putting a string in an "error" field, another returning "message" and "code", and another passing through the framework's exception text. Each works on its own, but for the consumer the way to read an error changes from feature to feature.
RFC 9457 addresses this directly. Its abstract says it defines a "problem detail" to carry machine-readable details of errors in HTTP response content, so that HTTP APIs do not need to define new error response formats. It was published in July 2023 and obsoletes the earlier RFC 7807.
The introduction explains that HTTP status codes cannot always convey enough information about errors to be helpful. A person in a browser can read an HTML page, but a program calling an API has difficulty doing so. Its example is an account without enough credit: a 403 Forbidden status code tells generic HTTP software the general meaning, while API-specific details such as why the request was refused and the account balance belong in the response content.
RFC 9457 also states that problem details are not the only way to convey a problem. If you already have a format of your own, it may be better to use it. The aim is to give applications that need a common error format one they do not have to invent, and to avoid the temptation to redefine the semantics of existing status codes. Even if you do not adopt it, the specification notes that reviewing its design can guide your decisions, which matters for companies with existing APIs.
Sources: [1]
FROM PRIMARY SOURCES
Start by classifying with the status code
Problem details do not replace HTTP status codes. RFC 9457 says problem details can be used with any status code but fit most naturally with 4xx and 5xx responses. The first decision is whether an error is the client's problem or the server's, and which 4xx code applies.
A common question is 400 versus 422. According to MDN, 400 Bad Request indicates that the server would not process the request due to something it considers a client error, typically malformed request syntax, invalid request message framing, or deceptive request routing. 422 Unprocessable Content indicates that the server understood the content type and the syntax was correct, but it was unable to process the contained instructions. Broken JSON points to 400; valid JSON whose values break business rules points to 422.
For both 400 and 422, MDN says clients should expect that repeating the request without modification will fail with the same error. This matters for automated integrations, because it lets the status code separate errors that may succeed after waiting from errors that will fail until the content is fixed.
RFC 9457 also governs the relationship between the status code and the body. The status member, if present, is only advisory and conveys the status code for the consumer's convenience. Generators must use the same status code in the actual HTTP response, so that generic HTTP software that does not understand the format still behaves correctly. An implementation that writes 422 in the body but sends a 200 response breaks this rule.
FROM PRIMARY SOURCES
The five members of a problem details object
The canonical model in RFC 9457 is a JSON object. Serialized as a JSON document it uses the media type application/problem+json; an appendix defines an XML form using application/problem+xml. The standard members are type, status, title, detail and instance. If a member's value type does not match the specification, the member must be ignored, and processing continues as if it were absent.
type is a string holding a URI reference that identifies the problem type, and consumers must use it as the primary identifier of the problem type. When type is absent, its value is assumed to be "about:blank", which means the problem has no meaning beyond the status code; in that case the title should match the status phrase for the code, such as Not Found for 404.
title is a short, human-readable summary of the problem type. It should not change between occurrences, except for localization. detail is a human-readable explanation specific to the occurrence. RFC 9457 says detail ought to focus on helping the client correct the problem rather than giving debugging information, and that consumers should not parse detail for information; extensions are better suited and less error-prone.
instance is a URI reference identifying the specific occurrence. If it can be dereferenced, the problem details can be fetched from it; if not, it serves as a unique identifier that may matter to the server but is opaque to the client. The introduction notes that such identifiers can be useful for support or forensic purposes. For both type and instance, absolute URIs are recommended because relative ones can cause confusion.
Sources: [1]
FROM PRIMARY SOURCES
Validation errors and extension members
Input validation failures are among the most common errors in business APIs, and one request can contain several, for example an age that is not a positive integer and a colour outside the allowed list. RFC 9457 shows a 422 response carrying an "errors" extension, listing a detail for each issue and a pointer that locates it in the request content using a JSON Pointer. The RFC itself calls this a fictional problem type.
RFC 9457 allows problem type definitions to extend the object with members specific to that type. Clients consuming problem details must ignore extensions they do not recognize, which lets problem types evolve to include more information. Extension names should start with a letter, consist of letters, digits and underscores, and be three characters or longer, so that they can be serialized in formats other than JSON.
When an API encounters several problems that do not share a type, RFC 9457 recommends representing the most relevant or urgent one. Generic "batch" types are possible but do not map well to HTTP semantics. Returning a list of validation errors is the case of several problems of the same type, and should not be confused with mixing an authentication failure and input errors in one response.
The RFC also covers adding problem details to existing APIs: HTTP content negotiation, for example an Accept header that prefers the format, makes it possible. Its example notes that an API may respond with application/problem+json even if the client did not list it in Accept, as HTTP allows. The language of human-readable strings can be negotiated with the Accept-Language header.
Sources: [1]
FROM PRIMARY SOURCES
What must not appear in an error response
Trying to make error responses helpful can tempt teams to return internal information. RFC 9457 is clear that problem details are not a debugging tool for the underlying implementation but a way to expose more detail about the HTTP interface itself. Designers of new problem types need to consider the risk of exposing attack vectors by revealing implementation internals through error messages.
The security considerations go further. The information in a problem type, and the details given when a problem is actually generated, must be carefully vetted. Risks include leaking information that can be exploited to compromise the system, access to it, or the privacy of its users. Generators that link to occurrence information are encouraged not to make implementation details such as a stack dump available through the HTTP interface, since that can expose sensitive details of the server implementation and its data.
Framework documentation points the same way. Microsoft's ASP.NET Core documentation warns not to enable the Developer Exception Page unless the app is running in the Development environment, and not to share detailed exception information publicly when the app runs in production. It notes the page can include the stack trace, query string parameters, cookies and headers.
The same documentation explains that calling AddProblemDetails configures problem details responses for client and server error responses that do not yet have body content. Behaviour also differs by environment: in Minimal APIs, bad-request binding failures throw in Development, but outside Development they write a 400 status code directly by default, bypassing custom exception handlers. The error shape you verified in development may not be the one production returns. (As documented when checked on 23 November 2026.)
EDITORIAL PRACTICE
Make the problem type catalogue a deliverable
From here on these are the editorial team's practical suggestions. When introducing problem details, the first thing to produce is not code but a catalogue of problem types. RFC 9457 requires new problem type definitions to document a type URI, a short title and the HTTP status code to use, and says the type URI should resolve to HTML documentation explaining how to resolve the problem. Those requirements become the catalogue's columns.
Beyond those three, operational columns help: what the user should do (fix the input, retry later, contact support), whether a retry can succeed, which extension members are returned, and which logs support should check first. As MDN explains, a response such as 422 should be expected to fail again if repeated unchanged, so writing "fix the content, do not resend" in the catalogue keeps integrators consistent.
Not every error needs its own type. RFC 9457 says truly generic problems that could apply to any resource on the Web are usually better expressed as plain status codes; a 403 in response to a PUT already says that write access is not allowed. Limiting custom types to errors that involve business decisions, where the status code alone does not tell the user what to do next, keeps the catalogue manageable.
Type URIs should be under your control and stable over time. RFC 9457 allows non-resolvable URIs but encourages resolvable ones, because switching later would create a new identity for the problem type and a breaking change. It also says consumers should not automatically dereference type URIs: type is an identifier for comparison, and the documentation is for people. Even if the documentation pages cannot be public, fixing the URI pattern early avoids trouble later.
| type (problem type URI) | title | Status code | What the user should do | Can a retry fix it? |
|---|---|---|---|---|
| https://api.example.com/problems/invalid-input | The input contains errors | 422 | Fix the fields indicated by pointer in errors and resend | No |
| https://api.example.com/problems/malformed-request | The request is malformed | 400 | Fix the JSON syntax or required headers | No |
| https://api.example.com/problems/insufficient-balance | Insufficient balance | 403 | Top up the balance, then resend | Only if conditions change |
| about:blank | Service Unavailable | 503 | Retry after waiting | Possibly |
EDITORIAL PRACTICE
Link to the logs with a reference ID
Removing internal information from error responses raises a worry that support staff will struggle to find causes. This is where instance helps. As RFC 9457 explains, instance identifies the occurrence and may be opaque to the client. We suggest putting a per-occurrence ID in instance and always writing the same ID to the server logs. The user only needs to quote the ID shown on screen, and support can go straight to the matching log line.
Do not use personally identifying information or easily guessed sequential numbers as the ID. Embedding a user ID or order number can leak information through error responses. Use a random value or the identifier already issued for request tracing, and link it to user and request details on the log side. What the logs themselves keep should follow a policy of excluding personal data and credentials.
Decide the on-screen wording in the catalogue too. Keep title fixed per type, with only translations per language. Keep detail to occurrence-specific information that helps the user fix the problem. A service used in both Japanese and English can switch the language of title and detail based on Accept-Language. Because RFC 9457 says consumers should not parse detail, return values that partner programs rely on in type or in extension members.
When offshore teams or contractors are part of operations, use the catalogue as shared vocabulary. Requiring every support ticket to include the status code, type and instance makes it quick to confirm, across time zones, that everyone is talking about the same error. As a fictional example, if a partner reports overnight only that "there was an error", the instance ID lets the next morning's engineer start by opening the matching log line.
Sources: [1]
EDITORIAL PRACTICE
Rollout steps and acceptance checks
Changing every error in an existing API at once can break partner integrations. We suggest three stages. First, inventory current error responses, listing status codes and body shapes. Next, create the new problem type catalogue and return problem details from newly built features. Finally, switch existing features over, timing the migration with partners. As RFC 9457 notes, content negotiation via the Accept header can serve old and new shapes in parallel during the transition.
Include checking the framework's default behaviour in the plan. In the ASP.NET Core example, the default problem details writer supports Accept headers with application/json, application/problem+json or wildcard types, while non-JSON types such as application/xml or text/html are not supported and trigger the fallback behaviour. With any framework, confirm that the error shape does not change between a browser request and a call from a partner program.
When a contractor implements the work, acceptance testing should check that real responses match the catalogue: does the body's status match the actual status code; is Content-Type application/problem+json; does type match the catalogue URI; is detail free of stack traces, internal paths and SQL; is instance recorded in the logs; and is the shape the same in development and in a production-like environment.
Test not only the happy path but deliberately bad requests: broken JSON, missing required fields, out-of-range values, unauthorized operations and non-existent URLs. As MDN explains, a 400 is typical for malformed syntax. Including these test steps in the contractor's deliverables keeps the error shape from eroding when people change. Treat error responses as a second specification that shapes both API usability and support workload.
WITH OPERUN.
Delegate everyday AI management.
API error responses can be designed as a specification, just like successful ones. RFC 9457 Problem Details divides the roles: the status code gives the broad class, type the kind of problem, title a short summary, detail an explanation that helps the user fix it, and instance the specific occurrence. Keep the body's status consistent with the real status code, keep implementation details out, and link to logs with a reference ID. Start by building the problem type catalogue and making it the basis of acceptance with your contractor. (Sources checked on 23 November 2026. The steps and the example catalogue are editorial suggestions.)
Discuss your product and AI workPrimary sources
Sources checked on 23 November 2026. The workflows and checklists are editorial proposals.
- [1]
- [2]
- [3]
- [4]
Share this insight
