Problem Details for HTTP APIs
RFC 9457, published by the IETF, defines a JSON object (and an equivalent XML format) that carries machine-readable details of an error in an HTTP response. It obsoletes RFC 7807. With this skill the agent produces and consumes application/problem+json responses, defines problem types, and pairs them with the right WWW-Authenticate challenge on 401 and 403.
Follow the workflow below step by step. Every rule here comes from a source in Sources, with the section it cites. When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.
Inputs (fill in, or ask before starting)
- Role: producer (an API that returns problems), consumer (a client that reads them), or both.
- Authentication: none, Bearer tokens (RFC 6750), or another HTTP authentication scheme. This decides the 401 and 403 headers.
- Target version: RFC 9457 (default). RFC 7807 is legacy: read it and upgrade from it, never author against it; the wire format is the same. No preview exists. See
references/versions.md. - Revision: the pinned revision in Sources, unless the user names another.
- Sources: when refreshing this skill or when a rule looks out of date, re-read every URL in Sources first, check the RFC Editor entry for RFC 9457 for errata or an obsoleting RFC, check the IANA registry for new problem types, and update the pins.
Invariants
- Media type. A JSON problem document is served as
application/problem+json(§ 3); the XML form isapplication/problem+xml(Appendix B). A server may send it even when the client did not list it inAccept(§ 3). statusmatches the response. If present,statusis the same code as the actual HTTP response (§ 3.1.2). Generic HTTP software only sees the real status code.typeis the identifier. Consumers use the resolvedtypeURI as the primary identifier of the problem (§ 3.1.1). A missingtypemeansabout:blank(§ 3.1.1, § 4.2.1). Absolute URIs are recommended (§ 3.1.1).titleis stable per type. It does not change between occurrences except for localization (§ 3.1.3). Withabout:blank, it is the status phrase for the code, such as "Not Found" (§ 4.2.1).detailhelps the client fix the problem and is not parsed. It explains this occurrence (§ 3.1.4). Machine-readable facts go in extension members, because consumers should not parsedetail(§ 3.1.4).- Consumers are tolerant. A member with the wrong JSON type is ignored as if absent (§ 3.1), and unknown extension members are ignored (§ 3.2).
- New problem types document a type URI, a title and a status code (§ 4). Extension member names start with a letter, use only letters, digits and
_, and are at least three characters (§ 4). - One problem per response. When several problems of different types occur, return the most relevant or urgent one (§ 3).
- No internals in the body. No stack traces or implementation details; vet every field for information leaks (§ 5, § 4).
- 401 always carries a challenge. A 401 response includes
WWW-Authenticatewith at least one challenge (RFC 9110 § 15.5.2, § 11.6.1). Valid but inadequate credentials get 403 (RFC 9110 § 11.4). For Bearer tokens, the error code in the challenge follows RFC 6750 § 3.1.
Workflow
- Pick the version. Use RFC 9457. If the API or its documentation cites RFC 7807, plan the upgrade (step 8).
->
references/versions.md✓ New documentation and code cite RFC 9457. - Decide whether a problem type is needed. A generic condition that the status code already explains needs no new type; use
about:blankor omittype(§ 4, § 4.2.1). Check the IANA HTTP Problem Types registry for a reusable type before minting one (§ 4.1, § 4.2). ->references/members.md✓ Every error the API returns maps to a status code and eitherabout:blank, a registered type, or a type you document. - Define each new problem type. Write down its type URI (stable and under your control), title, status code and extension members (§ 4, § 4.1). Make the type URI resolve to human-readable documentation (§ 3.1.1, § 4).
->
references/members.md✓ Each type has a documented URI, title, status and members, and every extension name follows the naming rule. - Pair authentication errors with the right header. Pick the status and the
WWW-Authenticatechallenge for each authentication or authorization failure, then build the body from the same reason. ->references/auth-challenges.md✓ Every 401 has a challenge;invalid_token,insufficient_scopeandinsufficient_user_authenticationuse the status RFC 6750 and RFC 9470 give them; a request without credentials gets no error code. - Generate responses. Set the status,
Content-Type: application/problem+json, and the body. Put field-level validation errors in an extension array such as theerrorsexample in § 3. For 429 and 503, addRetry-Afterwhere the type calls for it (§ 4). ->references/examples.md✓ The body validates against the JSON Schema in Appendix A, andstatusequals the response code. - Consume responses. Switch on
type, read extensions you know, ignore the rest, and fall back to the HTTP status code whentypeisabout:blankor unknown. ->references/examples.md✓ The client never parsesdetail, never auto-dereferencestype(§ 3.1.1), and survives a malformed member. - Review security. Check each type and each generated body against the security considerations.
->
references/security.md✓ No stack traces, internal identifiers or other users' data appear in any body orinstanceURI. - Upgrade (only when asked). Follow the RFC 7807 to RFC 9457 checklist: update references, keep the media types, namespace and every
typeURI, and apply the multiple-problem and wrong-type guidance. ->references/versions.md✓ Bodies validate against Appendix A, and no existingtypeURI changed.
Verify before done
- Every error response has
Content-Type: application/problem+json(orapplication/problem+xml) and a body that validates against the RFC 9457 Appendix A schema. -
status, when present, equals the HTTP status code of the response (§ 3.1.2). - Every non-
about:blanktype URI is absolute, stable, documented, and listed with its title and status (§ 3.1.1, § 4). - With
about:blank,titleis the status phrase (§ 4.2.1). - Extension member names match
^[A-Za-z][A-Za-z0-9_]{2,}$(§ 4), or the deviation comes from a specification that defines the member. - Every 401 carries
WWW-Authenticate; Bearer challenges follow RFC 6750 § 3 and § 3.1. - Consumers ignore unknown members and wrongly typed members (§ 3.1, § 3.2).
- No body exposes implementation details (§ 5).
Reference index
references/versions.md: RFC 9457 and RFC 7807 with their status, what RFC 9457 changed, and the upgrade checklist. Load for steps 1 and 8.references/members.md: every standard member,about:blank, extension naming, the registry and its current entries, and the Appendix A JSON Schema. Load for steps 2 and 3.references/auth-challenges.md: status andWWW-Authenticateper authentication outcome (RFC 9110, RFC 6750, RFC 9470), and how the body lines up with the header. Load for step 4.references/examples.md: full HTTP examples and framework-neutral TypeScript for producing and consuming problems. Load for steps 5 and 6.references/security.md: information leaks,statusdisagreement, and what to keep out ofdetailandinstance. Load for step 7.
Related skills
ratelimit-headersfor 429 responses withRetry-After,RateLimitandRateLimit-Policy:npx skills add ScaleDockHQ/scaledock-skills --skill ratelimit-headers.standard-schemafor turning validation issues from any Standard Schema validator into anerrorsextension:npx skills add ScaleDockHQ/scaledock-skills --skill standard-schema.http-semanticsfor choosing the status code and headers that a problem response carries:npx skills add ScaleDockHQ/scaledock-skills --skill http-semantics.
Sources
Status uses the publishing body's own maturity term. Checked is the date the source was last read.
- RFC 9457: Problem Details for HTTP APIs: RFC (Proposed Standard), RFC 9457, checked 2026-10-05.
- RFC 7807: Problem Details for HTTP APIs: RFC (Proposed Standard, obsoleted by RFC 9457), RFC 7807, checked 2026-10-05.
- IANA HTTP Problem Types registry: IANA registry, last updated 2026-06-26, checked 2026-10-02.
- RFC 9110: HTTP Semantics: RFC (Internet Standard, STD 97), RFC 9110, checked 2026-10-02.
- RFC 6750: OAuth 2.0 Bearer Token Usage: RFC (Proposed Standard, updated by RFC 8996 and RFC 9700), RFC 6750, checked 2026-10-02.
- RFC 9470: OAuth 2.0 Step Up Authentication Challenge Protocol: RFC (Proposed Standard), RFC 9470, checked 2026-10-02.