application/problem+json
Application

Overview

application/problem+json is the media type for expressing HTTP API errors in a standard, machine-readable form (RFC 9457, formerly RFC 7807). It turns ad-hoc, inconsistent error bodies into a unified schema so clients can handle them consistently.

Details

The standard fields are type (a URI identifying the problem kind), title (a human-readable summary), status (the HTTP status code), detail (an explanation for this occurrence), and instance (the URI of the specific resource that failed). You may freely add domain-specific extension members on top — for example a list of validation-failed fields. It is used as the body of 4xx/5xx responses and, thanks to the `+json` suffix, is compatible with ordinary JSON parsers.

Example: `{"type":"https://example.com/probs/out-of-credit","title":"You do not have enough credit.","status":403,"detail":"Balance is 30, cost is 50.","instance":"/account/123"}`. Making the type URI a documentation page lets developers click through for details. Clients should branch on type, not status, for stable programmatic handling.

Syntax

e.g. Content-Type: application/problem+json

Notes

Related types

Related headers