<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" ipr="trust200902" docName="draft-ietf-httpapi-rfc7807bis-07" number="9457" submissionType="IETF" category="std" consensus="true" updates="" obsoletes="7807" tocInclude="true" sortRefs="true" symRefs="true" xml:lang="en" prepTime="2023-07-31T21:18:23" indexInclude="true" scripts="Common,Latin" tocDepth="3">
  <link href="https://datatracker.ietf.org/doc/draft-ietf-httpapi-rfc7807bis-07" rel="prev"/>
  <link href="https://dx.doi.org/10.17487/rfc9457" rel="alternate"/>
  <link href="urn:issn:2070-1721" rel="alternate"/>
  <front>
    <title abbrev="Problem Details for HTTP APIs">Problem Details for HTTP APIs</title>
    <seriesInfo name="RFC" value="9457" stream="IETF"/>
    <author initials="M." surname="Nottingham" fullname="Mark Nottingham">
      <organization showOnFrontPage="true"/>
      <address>
        <postal>
          <postalLine>Prahran</postalLine>
          <postalLine>Australia</postalLine>
        </postal>
        <email>mnot@mnot.net</email>
        <uri>https://www.mnot.net/</uri>
      </address>
    </author>
    <author initials="E." surname="Wilde" fullname="Erik Wilde">
      <organization showOnFrontPage="true"/>
      <address>
        <email>erik.wilde@dret.net</email>
        <uri>http://dret.net/netdret/</uri>
      </address>
    </author>
    <author initials="S." surname="Dalal" fullname="Sanjay Dalal">
      <organization showOnFrontPage="true"/>
      <address>
        <postal>
          <country>United States of America</country>
        </postal>
        <email>sanjay.dalal@cal.berkeley.edu</email>
        <uri>https://github.com/sdatspun2</uri>
      </address>
    </author>
    <date month="07" year="2023"/>
    <area>art</area>
    <workgroup>httpapi</workgroup>
    <keyword>status</keyword>
    <keyword>HTTP</keyword>
    <keyword>error</keyword>
    <keyword>problem</keyword>
    <keyword>API</keyword>
    <keyword>JSON</keyword>
    <keyword>XML</keyword>
    <abstract pn="section-abstract">
      <t indent="0" pn="section-abstract-1">This document defines a "problem detail" to carry machine-readable details of errors in HTTP response content to avoid the need to define new error response formats for HTTP APIs.</t>
      <t indent="0" pn="section-abstract-2">This document obsoletes RFC 7807.</t>
    </abstract>
    <boilerplate>
      <section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
        <name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
        <t indent="0" pn="section-boilerplate.1-1">
            This is an Internet Standards Track document.
        </t>
        <t indent="0" pn="section-boilerplate.1-2">
            This document is a product of the Internet Engineering Task Force
            (IETF).  It represents the consensus of the IETF community.  It has
            received public review and has been approved for publication by
            the Internet Engineering Steering Group (IESG).  Further
            information on Internet Standards is available in Section 2 of 
            RFC 7841.
        </t>
        <t indent="0" pn="section-boilerplate.1-3">
            Information about the current status of this document, any
            errata, and how to provide feedback on it may be obtained at
            <eref target="https://www.rfc-editor.org/info/rfc9457" brackets="none"/>.
        </t>
      </section>
      <section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
        <name slugifiedName="name-copyright-notice">Copyright Notice</name>
        <t indent="0" pn="section-boilerplate.2-1">
            Copyright (c) 2023 IETF Trust and the persons identified as the
            document authors. All rights reserved.
        </t>
        <t indent="0" pn="section-boilerplate.2-2">
            This document is subject to BCP 78 and the IETF Trust's Legal
            Provisions Relating to IETF Documents
            (<eref target="https://trustee.ietf.org/license-info" brackets="none"/>) in effect on the date of
            publication of this document. Please review these documents
            carefully, as they describe your rights and restrictions with
            respect to this document. Code Components extracted from this
            document must include Revised BSD License text as described in
            Section 4.e of the Trust Legal Provisions and are provided without
            warranty as described in the Revised BSD License.
        </t>
      </section>
    </boilerplate>
    <toc>
      <section anchor="toc" numbered="false" removeInRFC="false" toc="exclude" pn="section-toc.1">
        <name slugifiedName="name-table-of-contents">Table of Contents</name>
        <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1">
          <li pn="section-toc.1-1.1">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.1"><xref derivedContent="1" format="counter" sectionFormat="of" target="section-1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-introduction">Introduction</xref></t>
          </li>
          <li pn="section-toc.1-1.2">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-requirements-language">Requirements Language</xref></t>
          </li>
          <li pn="section-toc.1-1.3">
            <t indent="0" pn="section-toc.1-1.3.1"><xref derivedContent="3" format="counter" sectionFormat="of" target="section-3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-the-problem-details-json-ob">The Problem Details JSON Object</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.3.2">
              <li pn="section-toc.1-1.3.2.1">
                <t indent="0" pn="section-toc.1-1.3.2.1.1"><xref derivedContent="3.1" format="counter" sectionFormat="of" target="section-3.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-members-of-a-problem-detail">Members of a Problem Details Object</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.3.2.1.2">
                  <li pn="section-toc.1-1.3.2.1.2.1">
                    <t indent="0" keepWithNext="true" pn="section-toc.1-1.3.2.1.2.1.1"><xref derivedContent="3.1.1" format="counter" sectionFormat="of" target="section-3.1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-type">"type"</xref></t>
                  </li>
                  <li pn="section-toc.1-1.3.2.1.2.2">
                    <t indent="0" pn="section-toc.1-1.3.2.1.2.2.1"><xref derivedContent="3.1.2" format="counter" sectionFormat="of" target="section-3.1.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-status">"status"</xref></t>
                  </li>
                  <li pn="section-toc.1-1.3.2.1.2.3">
                    <t indent="0" pn="section-toc.1-1.3.2.1.2.3.1"><xref derivedContent="3.1.3" format="counter" sectionFormat="of" target="section-3.1.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-title">"title"</xref></t>
                  </li>
                  <li pn="section-toc.1-1.3.2.1.2.4">
                    <t indent="0" pn="section-toc.1-1.3.2.1.2.4.1"><xref derivedContent="3.1.4" format="counter" sectionFormat="of" target="section-3.1.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-detail">"detail"</xref></t>
                  </li>
                  <li pn="section-toc.1-1.3.2.1.2.5">
                    <t indent="0" pn="section-toc.1-1.3.2.1.2.5.1"><xref derivedContent="3.1.5" format="counter" sectionFormat="of" target="section-3.1.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-instance">"instance"</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.3.2.2">
                <t indent="0" pn="section-toc.1-1.3.2.2.1"><xref derivedContent="3.2" format="counter" sectionFormat="of" target="section-3.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-extension-members">Extension Members</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.4">
            <t indent="0" pn="section-toc.1-1.4.1"><xref derivedContent="4" format="counter" sectionFormat="of" target="section-4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-defining-new-problem-types">Defining New Problem Types</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.4.2">
              <li pn="section-toc.1-1.4.2.1">
                <t indent="0" pn="section-toc.1-1.4.2.1.1"><xref derivedContent="4.1" format="counter" sectionFormat="of" target="section-4.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-example">Example</xref></t>
              </li>
              <li pn="section-toc.1-1.4.2.2">
                <t indent="0" pn="section-toc.1-1.4.2.2.1"><xref derivedContent="4.2" format="counter" sectionFormat="of" target="section-4.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-registered-problem-types">Registered Problem Types</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.4.2.2.2">
                  <li pn="section-toc.1-1.4.2.2.2.1">
                    <t indent="0" pn="section-toc.1-1.4.2.2.2.1.1"><xref derivedContent="4.2.1" format="counter" sectionFormat="of" target="section-4.2.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-aboutblank">about:blank</xref></t>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.5">
            <t indent="0" pn="section-toc.1-1.5.1"><xref derivedContent="5" format="counter" sectionFormat="of" target="section-5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-considerations">Security Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.6">
            <t indent="0" pn="section-toc.1-1.6.1"><xref derivedContent="6" format="counter" sectionFormat="of" target="section-6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-iana-considerations">IANA Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.7">
            <t indent="0" pn="section-toc.1-1.7.1"><xref derivedContent="7" format="counter" sectionFormat="of" target="section-7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-references">References</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.7.2">
              <li pn="section-toc.1-1.7.2.1">
                <t indent="0" pn="section-toc.1-1.7.2.1.1"><xref derivedContent="7.1" format="counter" sectionFormat="of" target="section-7.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-normative-references">Normative References</xref></t>
              </li>
              <li pn="section-toc.1-1.7.2.2">
                <t indent="0" pn="section-toc.1-1.7.2.2.1"><xref derivedContent="7.2" format="counter" sectionFormat="of" target="section-7.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-informative-references">Informative References</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.8">
            <t indent="0" pn="section-toc.1-1.8.1"><xref derivedContent="Appendix A" format="default" sectionFormat="of" target="section-appendix.a"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-json-schema-for-http-proble">JSON Schema for HTTP Problems</xref></t>
          </li>
          <li pn="section-toc.1-1.9">
            <t indent="0" pn="section-toc.1-1.9.1"><xref derivedContent="Appendix B" format="default" sectionFormat="of" target="section-appendix.b"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-http-problems-and-xml">HTTP Problems and XML</xref></t>
          </li>
          <li pn="section-toc.1-1.10">
            <t indent="0" pn="section-toc.1-1.10.1"><xref derivedContent="Appendix C" format="default" sectionFormat="of" target="section-appendix.c"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-using-problem-details-with-">Using Problem Details with Other Formats</xref></t>
          </li>
          <li pn="section-toc.1-1.11">
            <t indent="0" pn="section-toc.1-1.11.1"><xref derivedContent="Appendix D" format="default" sectionFormat="of" target="section-appendix.d"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-changes-from-rfc-7807">Changes from RFC 7807</xref></t>
          </li>
          <li pn="section-toc.1-1.12">
            <t indent="0" pn="section-toc.1-1.12.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.e"/><xref derivedContent="" format="title" sectionFormat="of" target="name-acknowledgements">Acknowledgements</xref></t>
          </li>
          <li pn="section-toc.1-1.13">
            <t indent="0" pn="section-toc.1-1.13.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.f"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-addresses">Authors' Addresses</xref></t>
          </li>
        </ul>
      </section>
    </toc>
  </front>
  <middle>
    <section anchor="introduction" numbered="true" removeInRFC="false" toc="include" pn="section-1">
      <name slugifiedName="name-introduction">Introduction</name>
      <t indent="0" pn="section-1-1">HTTP status codes (<xref section="15" sectionFormat="of" target="RFC9110" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9110#section-15" derivedContent="HTTP"/>) cannot always convey enough information about errors to be helpful. While humans using web browsers can often understand an HTML <xref target="HTML5" format="default" sectionFormat="of" derivedContent="HTML5"/> response content, non-human consumers of HTTP APIs have difficulty doing so.</t>
      <t indent="0" pn="section-1-2">To address that shortcoming, this specification defines simple JSON <xref target="RFC8259" format="default" sectionFormat="of" derivedContent="JSON"/> and XML <xref target="XML" format="default" sectionFormat="of" derivedContent="XML"/> document formats to describe the specifics of a problem encountered -- "problem details".</t>
      <t indent="0" pn="section-1-3">For example, consider a response indicating that the client's account doesn't have enough credit. The API's designer might decide to use the 403 Forbidden status code to inform generic HTTP software (such as client libraries, caches, and proxies) of the response's general semantics. API-specific problem details (such as why the server refused the request and the applicable account balance) can be carried in the response content so that the client can act upon them appropriately (for example, triggering a transfer of more credit into the account).</t>
      <t indent="0" pn="section-1-4">This specification identifies the specific "problem type" (e.g., "out of credit") with a URI <xref target="RFC3986" format="default" sectionFormat="of" derivedContent="URI"/>. HTTP APIs can use URIs under their control to identify problems specific to them or can reuse existing ones to facilitate interoperability and leverage common semantics (see <xref target="registry" format="default" sectionFormat="of" derivedContent="Section 4.2"/>).</t>
      <t indent="0" pn="section-1-5">Problem details can contain other information, such as a URI identifying the problem's specific occurrence (effectively giving an identifier to the concept "The time Joe didn't have enough credit last Thursday"), which can be useful for support or forensic purposes.</t>
      <t indent="0" pn="section-1-6">The data model for problem details is a JSON <xref target="RFC8259" format="default" sectionFormat="of" derivedContent="JSON"/> object; when serialized as a JSON document, it uses the "application/problem+json" media type. <xref target="xml-syntax" format="default" sectionFormat="of" derivedContent="Appendix B"/> defines an equivalent XML format, which uses the "application/problem+xml" media type.</t>
      <t indent="0" pn="section-1-7">When they are conveyed in an HTTP response, the contents of problem details can be negotiated using proactive negotiation; see <xref section="12.1" sectionFormat="of" target="RFC9110" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9110#section-12.1" derivedContent="HTTP"/>. In particular, the language used for human-readable strings (such as those in title and description) can be negotiated using the Accept-Language request header field (<xref section="12.5.4" sectionFormat="of" target="RFC9110" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9110#section-12.5.4" derivedContent="HTTP"/>), although that negotiation may still result in a non-preferred, default representation being returned.</t>
      <t indent="0" pn="section-1-8">Problem details can be used with any HTTP status code, but they most naturally fit the semantics of 4xx and 5xx responses. Note that problem details are (naturally) not the only way to convey the details of a problem in HTTP. If the response is still a representation of a resource, for example, it's often preferable to describe the relevant details in that application's format. Likewise, defined HTTP status codes cover many situations with no need to convey extra detail.</t>
      <t indent="0" pn="section-1-9">This specification's aim is to define common error formats for applications that need one so that they aren't required to define their own or, worse, tempted to redefine the semantics of existing HTTP status codes. Even if an application chooses not to use it to convey errors, reviewing its design can help guide the design decisions faced when conveying errors in an existing format.</t>
      <t indent="0" pn="section-1-10">See <xref target="changes" format="default" sectionFormat="of" derivedContent="Appendix D"/> for a list of changes from <xref target="RFC7807" format="default" sectionFormat="of" derivedContent="RFC7807"/>.</t>
    </section>
    <section anchor="requirements-lang" numbered="true" removeInRFC="false" toc="include" pn="section-2">
      <name slugifiedName="name-requirements-language">Requirements Language</name>
      <t indent="0" pn="section-2-1"> The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>",
        "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>",
        "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
        "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document
        are to be interpreted as described in BCP 14 <xref target="RFC2119" format="default" sectionFormat="of" derivedContent="RFC2119"/> <xref target="RFC8174" format="default" sectionFormat="of" derivedContent="RFC8174"/> when, and only when, they
        appear in all capitals, as shown here.
      </t>
    </section>
    <section anchor="problem-json" numbered="true" removeInRFC="false" toc="include" pn="section-3">
      <name slugifiedName="name-the-problem-details-json-ob">The Problem Details JSON Object</name>
      <t indent="0" pn="section-3-1">The canonical model for problem details is a JSON <xref target="RFC8259" format="default" sectionFormat="of" derivedContent="JSON"/> object. When serialized in a JSON document, that format is identified with the "application/problem+json" media type.</t>
      <t indent="0" pn="section-3-2">For example:</t>
      <sourcecode type="http-message" markers="false" pn="section-3-3">
POST /purchase HTTP/1.1
Host: store.example.com
Content-Type: application/json
Accept: application/json, application/problem+json

{
  "item": 123456,
  "quantity": 2
}
</sourcecode>
      <sourcecode type="http-message" markers="false" pn="section-3-4">
HTTP/1.1 403 Forbidden
Content-Type: application/problem+json
Content-Language: en

{
 "type": "https://example.com/probs/out-of-credit",
 "title": "You do not have enough credit.",
 "detail": "Your current balance is 30, but that costs 50.",
 "instance": "/account/12345/msgs/abc",
 "balance": 30,
 "accounts": ["/account/12345",
              "/account/67890"]
}
</sourcecode>
      <t indent="0" pn="section-3-5">Here, the out-of-credit problem (identified by its type) indicates the reason for the 403 in "title", identifies the specific problem occurrence with "instance", gives occurrence-specific details in "detail", and adds two extensions: "balance" conveys the account's balance, and "accounts" lists links where the account can be topped up.</t>
      <t indent="0" pn="section-3-6">When designed to accommodate it, problem-specific extensions can convey more than one instance of the same problem type. For example:</t>
      <sourcecode type="http-message" markers="false" pn="section-3-7">
POST /details HTTP/1.1
Host: account.example.com
Accept: application/json

{
  "age": 42.3,
  "profile": {
    "color": "yellow"
  }
}
</sourcecode>
      <sourcecode type="http-message" markers="false" pn="section-3-8">
HTTP/1.1 422 Unprocessable Content
Content-Type: application/problem+json
Content-Language: en

{
 "type": "https://example.net/validation-error",
 "title": "Your request is not valid.",
 "errors": [
             {
               "detail": "must be a positive integer",
               "pointer": "#/age"
             },
             {
               "detail": "must be 'green', 'red' or 'blue'",
               "pointer": "#/profile/color"
             }
          ]
}
</sourcecode>
      <t indent="0" pn="section-3-9">The fictional problem type here defines the "errors" extension, an array that describes the details of each validation error. Each member is an object containing "detail" to describe the issue and "pointer" to locate the problem within the request's content using a JSON Pointer <xref target="RFC6901" format="default" sectionFormat="of" derivedContent="JSON-POINTER"/>.</t>
      <t indent="0" pn="section-3-10">When an API encounters multiple problems that do not share the same type, it is <bcp14>RECOMMENDED</bcp14> that the most relevant or urgent problem be represented in the response. While it is possible to create generic "batch" problem types that convey multiple, disparate types, they do not map well into HTTP semantics.</t>
      <t indent="0" pn="section-3-11">Note also that the API has responded with the
      "application/problem+json" type, even though the client did not list it
      in Accept, as is allowed by HTTP (see <xref section="12.5.1" sectionFormat="of" target="RFC9110" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9110#section-12.5.1" derivedContent="HTTP"/>).</t>
      <section anchor="members" numbered="true" removeInRFC="false" toc="include" pn="section-3.1">
        <name slugifiedName="name-members-of-a-problem-detail">Members of a Problem Details Object</name>
        <t indent="0" pn="section-3.1-1">Problem detail objects can have the following members. If a member's value type does not match the specified type, the member <bcp14>MUST</bcp14> be ignored -- i.e., processing will continue as if the member had not been present.</t>
        <section anchor="type" numbered="true" removeInRFC="false" toc="include" pn="section-3.1.1">
          <name slugifiedName="name-type">"type"</name>
          <t indent="0" pn="section-3.1.1-1">The "type" member is a JSON string containing a URI reference <xref target="RFC3986" format="default" sectionFormat="of" derivedContent="URI"/> that identifies the problem type. Consumers <bcp14>MUST</bcp14> use the "type" URI (after resolution, if necessary) as the problem type's primary identifier.</t>
          <t indent="0" pn="section-3.1.1-2">When this member is not present, its value is assumed to be "about:blank".</t>
          <t indent="0" pn="section-3.1.1-3">If the type URI is a locator (e.g., those with an "http" or "https" scheme), dereferencing it <bcp14>SHOULD</bcp14> provide human-readable documentation for the problem type (e.g., using HTML <xref target="HTML5" format="default" sectionFormat="of" derivedContent="HTML5"/>). However, consumers <bcp14>SHOULD NOT</bcp14> automatically dereference the type URI, unless they do so when providing information to developers (e.g., when a debugging tool is in use).</t>
          <t indent="0" pn="section-3.1.1-4">When "type" contains a relative URI, it is resolved relative to the document's base URI, as per <xref section="5" sectionFormat="comma" target="RFC3986" format="default" derivedLink="https://rfc-editor.org/rfc/rfc3986#section-5" derivedContent="URI"/>. However, using relative URIs can cause confusion, and they might not be handled correctly by all implementations.</t>
          <t indent="0" pn="section-3.1.1-5">For example, if the two resources "https://api.example.org/foo/bar/123" and "https://api.example.org/widget/456" both respond with a "type" equal to the relative URI reference "example-problem", when resolved they will identify different resources ("https://api.example.org/foo/bar/example-problem" and "https://api.example.org/widget/example-problem", respectively). As a result, it is <bcp14>RECOMMENDED</bcp14> that absolute URIs be used in "type" when possible and that when relative URIs are used, they include the full path (e.g., "/types/123").</t>
          <t indent="0" pn="section-3.1.1-6">The type URI is allowed to be a non-resolvable URI. For example, the tag URI scheme <xref target="RFC4151" format="default" sectionFormat="of" derivedContent="TAG"/> can be used to uniquely identify problem types:</t>
          <artwork align="left" pn="section-3.1.1-7">
tag:example@example.org,2021-09-17:OutOfLuck
</artwork>
          <t indent="0" pn="section-3.1.1-8">However, resolvable type URIs are encouraged by this specification because it might become desirable to resolve the URI in the future. For example, if an API designer used the URI above and later adopted a tool that resolves type URIs to discover information about the error, taking advantage of that capability would require switching to a resolvable URI, creating a new identity for the problem type and thus introducing a breaking change.</t>
        </section>
        <section anchor="status" numbered="true" removeInRFC="false" toc="include" pn="section-3.1.2">
          <name slugifiedName="name-status">"status"</name>
          <t indent="0" pn="section-3.1.2-1">The "status" member is a JSON number indicating the HTTP status code (<xref section="15" sectionFormat="comma" target="RFC9110" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9110#section-15" derivedContent="HTTP"/>) generated by the origin server for this occurrence of the problem.</t>
          <t indent="0" pn="section-3.1.2-2">The "status" member, if present, is only advisory; it conveys the HTTP status code used for the convenience of the consumer. Generators <bcp14>MUST</bcp14> use the same status code in the actual HTTP response, to assure that generic HTTP software that does not understand this format still behaves correctly. See <xref target="security-considerations" format="default" sectionFormat="of" derivedContent="Section 5"/> for further caveats regarding its use.</t>
          <t indent="0" pn="section-3.1.2-3">Consumers can use the status member to determine what the original status code used by the generator was when it has been changed (e.g., by an intermediary or cache) and when a message's content is persisted without HTTP information. Generic HTTP software will still use the HTTP status code.</t>
        </section>
        <section anchor="title1" numbered="true" removeInRFC="false" toc="include" pn="section-3.1.3">
          <name slugifiedName="name-title">"title"</name>
          <t indent="0" pn="section-3.1.3-1">The "title" member is a JSON string containing a short, human-readable summary of the problem type.</t>
          <t indent="0" pn="section-3.1.3-2">It <bcp14>SHOULD NOT</bcp14> change from occurrence to occurrence of the problem, except for localization (e.g., using proactive content negotiation; see <xref section="12.1" sectionFormat="comma" target="RFC9110" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9110#section-12.1" derivedContent="HTTP"/>).</t>
          <t indent="0" pn="section-3.1.3-3">The "title" string is advisory and is included only for users who are unaware of and cannot discover the semantics of the type URI (e.g., during offline log analysis).</t>
        </section>
        <section anchor="detail" numbered="true" removeInRFC="false" toc="include" pn="section-3.1.4">
          <name slugifiedName="name-detail">"detail"</name>
          <t indent="0" pn="section-3.1.4-1">The "detail" member is a JSON string containing a human-readable explanation specific to this occurrence of the problem.</t>
          <t indent="0" pn="section-3.1.4-2">The "detail" string, if present, ought to focus on helping the client correct the problem, rather than giving debugging information.</t>
          <t indent="0" pn="section-3.1.4-3">Consumers <bcp14>SHOULD NOT</bcp14> parse the "detail" member for information; extensions are more suitable and less error-prone ways to obtain such information.</t>
        </section>
        <section anchor="instance" numbered="true" removeInRFC="false" toc="include" pn="section-3.1.5">
          <name slugifiedName="name-instance">"instance"</name>
          <t indent="0" pn="section-3.1.5-1">The "instance" member is a JSON string containing a URI reference that identifies the specific occurrence of the problem.</t>
          <t indent="0" pn="section-3.1.5-2">When the "instance" URI is dereferenceable, the problem details object can be fetched from it. It might also return information about the problem occurrence in other formats through use of proactive content negotiation (see <xref section="12.5.1" sectionFormat="comma" target="RFC9110" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9110#section-12.5.1" derivedContent="HTTP"/>).</t>
          <t indent="0" pn="section-3.1.5-3">When the "instance" URI is not dereferenceable, it serves as a unique identifier for the problem occurrence that may be of significance to the server but is opaque to the client.</t>
          <t indent="0" pn="section-3.1.5-4">When "instance" contains a relative URI, it is resolved relative to the document's base URI, as per <xref section="5" sectionFormat="comma" target="RFC3986" format="default" derivedLink="https://rfc-editor.org/rfc/rfc3986#section-5" derivedContent="URI"/>. However, using relative URIs can cause confusion, and they might not be handled correctly by all implementations.</t>
          <t indent="0" pn="section-3.1.5-5">For example, if the two resources "https://api.example.org/foo/bar/123" and "https://api.example.org/widget/456" both respond with an "instance" equal to the relative URI reference "example-instance", when resolved they will identify different resources ("https://api.example.org/foo/bar/example-instance" and "https://api.example.org/widget/example-instance", respectively). As a result, it is <bcp14>RECOMMENDED</bcp14> that absolute URIs be used in "instance" when possible, and that when relative URIs are used, they include the full path (e.g., "/instances/123").</t>
        </section>
      </section>
      <section anchor="extension" numbered="true" removeInRFC="false" toc="include" pn="section-3.2">
        <name slugifiedName="name-extension-members">Extension Members</name>
        <t indent="0" pn="section-3.2-1">Problem type definitions <bcp14>MAY</bcp14> extend the problem details object with additional members that are specific to that problem type.</t>
        <t indent="0" pn="section-3.2-2">For example, our out-of-credit problem above defines two such extensions -- "balance" and "accounts" to convey additional, problem-specific information.</t>
        <t indent="0" pn="section-3.2-3">Similarly, the "validation error" example defines an "errors" extension that contains a list of individual error occurrences found, with details and a pointer to the location of each.</t>
        <t indent="0" pn="section-3.2-4">Clients consuming problem details <bcp14>MUST</bcp14> ignore any such extensions that they don't recognize; this allows problem types to evolve and include additional information in the future.</t>
        <t indent="0" pn="section-3.2-5">When creating extensions, problem type authors should choose their names carefully. To be used in the XML format (see <xref target="xml-syntax" format="default" sectionFormat="of" derivedContent="Appendix B"/>), they will need to conform to the Name rule in <xref section="2.3" sectionFormat="of" target="XML" relative="#NT-Name" format="default" derivedLink="https://www.w3.org/TR/2008/REC-xml-20081126/#NT-Name" derivedContent="XML"/>.</t>
      </section>
    </section>
    <section anchor="defining" numbered="true" removeInRFC="false" toc="include" pn="section-4">
      <name slugifiedName="name-defining-new-problem-types">Defining New Problem Types</name>
      <t indent="0" pn="section-4-1">When an HTTP API needs to define a response that indicates an error condition, it might be appropriate to do so by defining a new problem type.</t>
      <t indent="0" pn="section-4-2">Before doing so, it's important to understand what they are good for and what is better left to other mechanisms.</t>
      <t indent="0" pn="section-4-3">Problem details are not a debugging tool for the underlying implementation; rather, they are a way to expose greater detail about the HTTP interface itself. Designers of new problem types need to carefully take into account the <xref target="security-considerations" format="default" sectionFormat="of" derivedContent="Section 5">Security Considerations</xref>, in particular, the risk of exposing attack vectors by exposing implementation internals through error messages.</t>
      <t indent="0" pn="section-4-4">Likewise, truly generic problems -- i.e., conditions that might apply to any resource on the Web -- are usually better expressed as plain status codes. For example, a "write access disallowed" problem is probably unnecessary, since a 403 Forbidden status code in response to a PUT request is self-explanatory.</t>
      <t indent="0" pn="section-4-5">Finally, an application might have a more appropriate way to carry an error in a format that it already defines. Problem details are intended to avoid the necessity of establishing new "fault" or "error" document formats, not to replace existing domain-specific formats.</t>
      <t indent="0" pn="section-4-6">That said, it is possible to add support for problem details to existing HTTP APIs using HTTP content negotiation (e.g., using the Accept request header to indicate a preference for this format; see <xref section="12.5.1" sectionFormat="comma" target="RFC9110" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9110#section-12.5.1" derivedContent="HTTP"/>).</t>
      <t indent="0" pn="section-4-7">New problem type definitions <bcp14>MUST</bcp14> document:</t>
      <ol spacing="normal" type="1" indent="adaptive" start="1" pn="section-4-8">
	<li pn="section-4-8.1" derivedCounter="1.">a type URI (typically, with the "http" or "https" scheme)</li>
        <li pn="section-4-8.2" derivedCounter="2.">a title that appropriately describes it (think short)</li>
        <li pn="section-4-8.3" derivedCounter="3.">the HTTP status code for it to be used with</li>
      </ol>
      <t indent="0" pn="section-4-9">Problem type definitions <bcp14>MAY</bcp14> specify the use of the Retry-After response header (<xref section="10.2.3" sectionFormat="comma" target="RFC9110" format="default" derivedLink="https://rfc-editor.org/rfc/rfc9110#section-10.2.3" derivedContent="HTTP"/>) in appropriate circumstances.</t>
      <t indent="0" pn="section-4-10">A problem type URI <bcp14>SHOULD</bcp14> resolve to HTML <xref target="HTML5" format="default" sectionFormat="of" derivedContent="HTML5"/> documentation that explains how to resolve the problem.</t>
      <t indent="0" pn="section-4-11">A problem type definition <bcp14>MAY</bcp14> specify additional members on the problem details object. 

For example, an extension might use typed links <xref target="RFC8288" format="default" sectionFormat="of" derivedContent="WEB-LINKING"/> to another resource that machines can use to resolve the problem.</t>
      <t indent="0" pn="section-4-12">If such additional members are defined, their names <bcp14>SHOULD</bcp14> start with a letter (ALPHA, as per <xref section="B.1" sectionFormat="comma" target="RFC5234" format="default" derivedLink="https://rfc-editor.org/rfc/rfc5234#appendix-B.1" derivedContent="ABNF"/>) and <bcp14>SHOULD</bcp14> comprise characters from ALPHA, DIGIT (<xref section="B.1" sectionFormat="comma" target="RFC5234" format="default" derivedLink="https://rfc-editor.org/rfc/rfc5234#appendix-B.1" derivedContent="ABNF"/>), and "_" (so that it can be serialized in formats other than JSON), and they <bcp14>SHOULD</bcp14> be three characters or longer.</t>
      <section anchor="example" numbered="true" removeInRFC="false" toc="include" pn="section-4.1">
        <name slugifiedName="name-example">Example</name>
        <t indent="0" pn="section-4.1-1">For example, if you are publishing an HTTP API to your online shopping cart, you might need to indicate that the user is out of credit (our example from above) and therefore cannot make the purchase.</t>
        <t indent="0" pn="section-4.1-2">If you already have an application-specific format that can accommodate this information, it's probably best to do that. However, if you don't, you might use one of the problem detail formats -- JSON if your API is JSON-based or XML if it uses that format.</t>
        <t indent="0" pn="section-4.1-3">To do so, you might look in the registry (<xref target="registry" format="default" sectionFormat="of" derivedContent="Section 4.2"/>) for an already-defined type URI that suits your purposes. If one is available, you can reuse that URI.</t>
        <t indent="0" pn="section-4.1-4">If one isn't available, you could mint and document a new type URI (which ought to be under your control and stable over time), an appropriate title and the HTTP status code that it will be used with, along with what it means and how it should be handled.</t>
      </section>
      <section anchor="registry" numbered="true" removeInRFC="false" toc="include" pn="section-4.2">
        <name slugifiedName="name-registered-problem-types">Registered Problem Types</name>
        <t indent="0" pn="section-4.2-1">This specification defines the "HTTP Problem Types" registry for common, widely used problem type URIs, to promote reuse.</t>
        <t indent="0" pn="section-4.2-2">The policy for this registry is Specification Required, per <xref section="4.6" sectionFormat="comma" target="RFC8126" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8126#section-4.6" derivedContent="RFC8126"/>.</t>
        <t indent="0" pn="section-4.2-3">When evaluating requests, the designated expert(s) should consider community feedback, how well-defined the problem type is, and this specification's requirements. Vendor-specific, application-specific, and deployment-specific values are unable to be registered. Specification documents should be published in a stable, freely available manner (ideally located with a URL) but need not be standards.</t>
        <t indent="0" pn="section-4.2-4">Registrations <bcp14>MAY</bcp14> use the prefix "<eref target="https://iana.org/assignments/http-problem-types#" brackets="none"/>" for the type URI. Note that those URIs may not be able to be resolved.</t>
        <t indent="0" pn="section-4.2-5">The following template should be used for registration requests:</t>
        <dl spacing="compact" newline="false" indent="3" pn="section-4.2-6">
          <dt pn="section-4.2-6.1">Type URI:</dt>
          <dd pn="section-4.2-6.2">[a URI for the problem type]</dd>
          <dt pn="section-4.2-6.3">Title:</dt>
          <dd pn="section-4.2-6.4">[a short description of the problem type]</dd>
          <dt pn="section-4.2-6.5">Recommended HTTP status code:</dt>
          <dd pn="section-4.2-6.6">[what status code is most appropriate to use with the type]</dd>
          <dt pn="section-4.2-6.7">Reference:</dt>
          <dd pn="section-4.2-6.8">[to a specification defining the type]</dd>
        </dl>
        <t indent="0" pn="section-4.2-7">See the registry at <eref target="https://iana.org/assignments/http-problem-types" brackets="angle"/> for details on where to send registration requests.</t>
        <section anchor="blank" numbered="true" removeInRFC="false" toc="include" pn="section-4.2.1">
          <name slugifiedName="name-aboutblank">about:blank</name>
          <t indent="0" pn="section-4.2.1-1">This specification registers one Problem Type, "about:blank", as follows.</t>
          <dl spacing="compact" newline="false" indent="3" pn="section-4.2.1-2">
            <dt pn="section-4.2.1-2.1">Type URI:</dt>
            <dd pn="section-4.2.1-2.2">about:blank</dd>
            <dt pn="section-4.2.1-2.3">Title:</dt>
            <dd pn="section-4.2.1-2.4">See HTTP Status Code</dd>
            <dt pn="section-4.2.1-2.5">Recommended HTTP status code:</dt>
            <dd pn="section-4.2.1-2.6">N/A</dd>
            <dt pn="section-4.2.1-2.7">Reference:</dt>
            <dd pn="section-4.2.1-2.8">RFC 9457</dd>
          </dl>
          <t indent="0" pn="section-4.2.1-3">The "about:blank" URI <xref target="RFC6694" format="default" sectionFormat="of" derivedContent="ABOUT"/>, when used as a problem type, indicates that the problem has no additional semantics beyond that of the HTTP status code.</t>
          <t indent="0" pn="section-4.2.1-4">When "about:blank" is used, the title <bcp14>SHOULD</bcp14> be the same as the recommended HTTP status phrase for that code (e.g., "Not Found" for 404, and so on), although it <bcp14>MAY</bcp14> be localized to suit client preferences (expressed with the Accept-Language request header).</t>
          <t indent="0" pn="section-4.2.1-5">Please note that according to how the "type" member is defined (<xref target="members" format="default" sectionFormat="of" derivedContent="Section 3.1"/>), the "about:blank" URI is the default value for that member. Consequently, any problem details object not carrying an explicit "type" member implicitly uses this URI.</t>
        </section>
      </section>
    </section>
    <section anchor="security-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-5">
      <name slugifiedName="name-security-considerations">Security Considerations</name>
      <t indent="0" pn="section-5-1">When defining a new problem type, the information included must be carefully vetted. Likewise, when actually generating a problem -- however it is serialized -- the details given must also be scrutinized.</t>
      <t indent="0" pn="section-5-2">Risks include leaking information that can be exploited to compromise the system, access to the system, or the privacy of users of the system.</t>
      <t indent="0" pn="section-5-3">Generators providing links to occurrence information are encouraged to avoid making implementation details such as a stack dump available through the HTTP interface, since this can expose sensitive details of the server implementation, its data, and so on.</t>
      <t indent="0" pn="section-5-4">The "status" member duplicates the information available in the HTTP status code itself, bringing the possibility of disagreement between the two. Their relative precedence is not clear, since a disagreement might indicate that (for example) an intermediary has changed the HTTP status code in transit (e.g., by a proxy or cache). Generic HTTP software (such as proxies, load balancers, firewalls, and virus scanners) are unlikely to know of or respect the status code conveyed in this member.</t>
    </section>
    <section anchor="iana-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-6">
      <name slugifiedName="name-iana-considerations">IANA Considerations</name>
      <t indent="0" pn="section-6-1">In the "application" registry under the "Media Types" registry, IANA has updated the "application/problem+json" and "application/problem+xml" registrations to refer to this document.</t>
      <t indent="0" pn="section-6-2">IANA has created the "HTTP Problem Types" registry as specified in <xref target="registry" format="default" sectionFormat="of" derivedContent="Section 4.2"/> and populated it with "about:blank" as per <xref target="blank" format="default" sectionFormat="of" derivedContent="Section 4.2.1"/>.</t>
    </section>
  </middle>
  <back>
    <displayreference target="RFC3986" to="URI"/>
    <displayreference target="RFC5234" to="ABNF"/>
    <displayreference target="RFC8259" to="JSON"/>
    <displayreference target="RFC9110" to="HTTP"/>
    <displayreference target="RFC8288" to="WEB-LINKING"/>
    <displayreference target="RFC6694" to="ABOUT"/>
    <displayreference target="RFC4151" to="TAG"/>
    <displayreference target="RFC6901" to="JSON-POINTER"/>
    <displayreference target="I-D.bhutton-json-schema" to="JSON-SCHEMA"/>
    <references pn="section-7">
      <name slugifiedName="name-references">References</name>
      <references pn="section-7.1">
        <name slugifiedName="name-normative-references">Normative References</name>
        <reference anchor="RFC5234" target="https://www.rfc-editor.org/info/rfc5234" quoteTitle="true" derivedAnchor="ABNF">
          <front>
            <title>Augmented BNF for Syntax Specifications: ABNF</title>
            <author fullname="D. Crocker" initials="D." role="editor" surname="Crocker"/>
            <author fullname="P. Overell" initials="P." surname="Overell"/>
            <date month="January" year="2008"/>
            <abstract>
              <t indent="0">Internet technical specifications often need to define a formal syntax. Over the years, a modified version of Backus-Naur Form (BNF), called Augmented BNF (ABNF), has been popular among many Internet specifications. The current specification documents ABNF. It balances compactness and simplicity with reasonable representational power. The differences between standard BNF and ABNF involve naming rules, repetition, alternatives, order-independence, and value ranges. This specification also supplies additional rule definitions and encoding for a core lexical analyzer of the type common to several Internet specifications. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="68"/>
          <seriesInfo name="RFC" value="5234"/>
          <seriesInfo name="DOI" value="10.17487/RFC5234"/>
        </reference>
        <reference anchor="RFC9110" target="https://www.rfc-editor.org/info/rfc9110" quoteTitle="true" derivedAnchor="HTTP">
          <front>
            <title>HTTP Semantics</title>
            <author fullname="R. Fielding" initials="R." role="editor" surname="Fielding"/>
            <author fullname="M. Nottingham" initials="M." role="editor" surname="Nottingham"/>
            <author fullname="J. Reschke" initials="J." role="editor" surname="Reschke"/>
            <date month="June" year="2022"/>
            <abstract>
              <t indent="0">The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document describes the overall architecture of HTTP, establishes common terminology, and defines aspects of the protocol that are shared by all versions. In this definition are core protocol elements, extensibility mechanisms, and the "http" and "https" Uniform Resource Identifier (URI) schemes.</t>
              <t indent="0">This document updates RFC 3864 and obsoletes RFCs 2818, 7231, 7232, 7233, 7235, 7538, 7615, 7694, and portions of 7230.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="97"/>
          <seriesInfo name="RFC" value="9110"/>
          <seriesInfo name="DOI" value="10.17487/RFC9110"/>
        </reference>
        <reference anchor="RFC8259" target="https://www.rfc-editor.org/info/rfc8259" quoteTitle="true" derivedAnchor="JSON">
          <front>
            <title>The JavaScript Object Notation (JSON) Data Interchange Format</title>
            <author fullname="T. Bray" initials="T." role="editor" surname="Bray"/>
            <date month="December" year="2017"/>
            <abstract>
              <t indent="0">JavaScript Object Notation (JSON) is a lightweight, text-based, language-independent data interchange format. It was derived from the ECMAScript Programming Language Standard. JSON defines a small set of formatting rules for the portable representation of structured data.</t>
              <t indent="0">This document removes inconsistencies with other specifications of JSON, repairs specification errors, and offers experience-based interoperability guidance.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="90"/>
          <seriesInfo name="RFC" value="8259"/>
          <seriesInfo name="DOI" value="10.17487/RFC8259"/>
        </reference>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" quoteTitle="true" derivedAnchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t indent="0">In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8126" target="https://www.rfc-editor.org/info/rfc8126" quoteTitle="true" derivedAnchor="RFC8126">
          <front>
            <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
            <author fullname="M. Cotton" initials="M." surname="Cotton"/>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <author fullname="T. Narten" initials="T." surname="Narten"/>
            <date month="June" year="2017"/>
            <abstract>
              <t indent="0">Many protocols make use of points of extensibility that use constants to identify various protocol parameters. To ensure that the values in these fields do not have conflicting uses and to promote interoperability, their allocations are often coordinated by a central record keeper. For IETF protocols, that role is filled by the Internet Assigned Numbers Authority (IANA).</t>
              <t indent="0">To make assignments in a given registry prudently, guidance describing the conditions under which new values should be assigned, as well as when and how modifications to existing values can be made, is needed. This document defines a framework for the documentation of these guidelines by specification authors, in order to assure that the provided guidance for the IANA Considerations is clear and addresses the various issues that are likely in the operation of a registry.</t>
              <t indent="0">This is the third edition of this document; it obsoletes RFC 5226.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="26"/>
          <seriesInfo name="RFC" value="8126"/>
          <seriesInfo name="DOI" value="10.17487/RFC8126"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" quoteTitle="true" derivedAnchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t indent="0">RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
        <reference anchor="RFC3986" target="https://www.rfc-editor.org/info/rfc3986" quoteTitle="true" derivedAnchor="URI">
          <front>
            <title>Uniform Resource Identifier (URI): Generic Syntax</title>
            <author fullname="T. Berners-Lee" initials="T." surname="Berners-Lee"/>
            <author fullname="R. Fielding" initials="R." surname="Fielding"/>
            <author fullname="L. Masinter" initials="L." surname="Masinter"/>
            <date month="January" year="2005"/>
            <abstract>
              <t indent="0">A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource. This specification defines the generic URI syntax and a process for resolving URI references that might be in relative form, along with guidelines and security considerations for the use of URIs on the Internet. The URI syntax defines a grammar that is a superset of all valid URIs, allowing an implementation to parse the common components of a URI reference without knowing the scheme-specific requirements of every possible identifier. This specification does not define a generative grammar for URIs; that task is performed by the individual specifications of each URI scheme. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="66"/>
          <seriesInfo name="RFC" value="3986"/>
          <seriesInfo name="DOI" value="10.17487/RFC3986"/>
        </reference>
        <reference anchor="XML" target="https://www.w3.org/TR/2008/REC-xml-20081126/" quoteTitle="true" derivedAnchor="XML">
          <front>
            <title>Extensible Markup Language (XML) 1.0 (Fifth Edition)</title>
            <author initials="T." surname="Bray"/>
            <author initials="J." surname="Paoli"/>
            <author initials="C. M." surname="Sperberg-McQueen"/>
            <author initials="E." surname="Maler"/>
            <author initials="F." surname="Yergeau"/>
            <date month="November" year="2008"/>
          </front>
          <refcontent>W3C Recommendation REC-xml-20081126</refcontent>
        </reference>
      </references>
      <references pn="section-7.2">
        <name slugifiedName="name-informative-references">Informative References</name>
        <reference anchor="RFC6694" target="https://www.rfc-editor.org/info/rfc6694" quoteTitle="true" derivedAnchor="ABOUT">
          <front>
            <title>The "about" URI Scheme</title>
            <author fullname="S. Moonesamy" initials="S." role="editor" surname="Moonesamy"/>
            <date month="August" year="2012"/>
            <abstract>
              <t indent="0">This document describes the "about" URI scheme, which is widely used by Web browsers and some other applications to designate access to their internal resources, such as settings, application information, hidden built-in functionality, and so on. This document is not an Internet Standards Track specification; it is published for informational purposes.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6694"/>
          <seriesInfo name="DOI" value="10.17487/RFC6694"/>
        </reference>
        <reference anchor="HTML5" target="https://html.spec.whatwg.org" quoteTitle="true" derivedAnchor="HTML5">
          <front>
            <title>HTML: Living Standard</title>
            <author>
              <organization showOnFrontPage="true">WHATWG</organization>
            </author>
            <date/>
          </front>
        </reference>
        <reference anchor="ISO-19757-2" target="https://www.iso.org/standard/52348.html" quoteTitle="true" derivedAnchor="ISO-19757-2">
          <front>
            <title>Information technology -- Document Schema Definition Language (DSDL) -- Part 2: Regular-grammar-based validation -- RELAX NG</title>
            <author>
              <organization showOnFrontPage="true">ISO</organization>
            </author>
            <date month="December" year="2008"/>
          </front>
          <seriesInfo name="ISO/IEC" value="19757-2:2008"/>
        </reference>
        <reference anchor="RFC6901" target="https://www.rfc-editor.org/info/rfc6901" quoteTitle="true" derivedAnchor="JSON-POINTER">
          <front>
            <title>JavaScript Object Notation (JSON) Pointer</title>
            <author fullname="P. Bryan" initials="P." role="editor" surname="Bryan"/>
            <author fullname="K. Zyp" initials="K." surname="Zyp"/>
            <author fullname="M. Nottingham" initials="M." role="editor" surname="Nottingham"/>
            <date month="April" year="2013"/>
            <abstract>
              <t indent="0">JSON Pointer defines a string syntax for identifying a specific value within a JavaScript Object Notation (JSON) document.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6901"/>
          <seriesInfo name="DOI" value="10.17487/RFC6901"/>
        </reference>
        <reference anchor="I-D.bhutton-json-schema" target="https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-01" quoteTitle="true" derivedAnchor="JSON-SCHEMA">
          <front>
            <title>JSON Schema: A Media Type for Describing JSON Documents</title>
            <author initials="A." surname="Wright" fullname="Austin Wright" role="editor"> </author>
            <author initials="H." surname="Andrews" fullname="Henry Andrews" role="editor"> </author>
            <author initials="B." surname="Hutton" fullname="Ben Hutton" role="editor">
              <organization showOnFrontPage="true">Postman</organization>
            </author>
            <author initials="G." surname="Dennis" fullname="Greg Dennis"> </author>
            <date month="June" day="10" year="2022"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-bhutton-json-schema-01"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="RDFA" target="https://www.w3.org/TR/2015/REC-rdfa-core-20150317/" quoteTitle="true" derivedAnchor="RDFA">
          <front>
            <title>RDFa Core 1.1 - Third Edition</title>
            <author fullname="Ben Adida"/>
            <author fullname="Mark Birbeck"/>
            <author fullname="Shane McCarron"/>
            <author fullname="Ivan Herman"/>
            <date month="March" year="2015"/>
          </front>
          <refcontent>W3C Recommendation</refcontent>
        </reference>
        <reference anchor="RFC7807" target="https://www.rfc-editor.org/info/rfc7807" quoteTitle="true" derivedAnchor="RFC7807">
          <front>
            <title>Problem Details for HTTP APIs</title>
            <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
            <author fullname="E. Wilde" initials="E." surname="Wilde"/>
            <date month="March" year="2016"/>
            <abstract>
              <t indent="0">This document defines a "problem detail" as a way to carry machine- readable details of errors in a HTTP response to avoid the need to define new error response formats for HTTP APIs.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7807"/>
          <seriesInfo name="DOI" value="10.17487/RFC7807"/>
        </reference>
        <reference anchor="RFC4151" target="https://www.rfc-editor.org/info/rfc4151" quoteTitle="true" derivedAnchor="TAG">
          <front>
            <title>The 'tag' URI Scheme</title>
            <author fullname="T. Kindberg" initials="T." surname="Kindberg"/>
            <author fullname="S. Hawke" initials="S." surname="Hawke"/>
            <date month="October" year="2005"/>
            <abstract>
              <t indent="0">This document describes the "tag" Uniform Resource Identifier (URI) scheme. Tag URIs (also known as "tags") are designed to be unique across space and time while being tractable to humans. They are distinct from most other URIs in that they have no authoritative resolution mechanism. A tag may be used purely as an entity identifier. Furthermore, using tags has some advantages over the common practice of using "http" URIs as identifiers for non-HTTP-accessible resources. This memo provides information for the Internet community.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="4151"/>
          <seriesInfo name="DOI" value="10.17487/RFC4151"/>
        </reference>
        <reference anchor="RFC8288" target="https://www.rfc-editor.org/info/rfc8288" quoteTitle="true" derivedAnchor="WEB-LINKING">
          <front>
            <title>Web Linking</title>
            <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
            <date month="October" year="2017"/>
            <abstract>
              <t indent="0">This specification defines a model for the relationships between resources on the Web ("links") and the type of those relationships ("link relation types").</t>
              <t indent="0">It also defines the serialisation of such links in HTTP headers with the Link header field.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8288"/>
          <seriesInfo name="DOI" value="10.17487/RFC8288"/>
        </reference>
        <reference anchor="XSLT" target="https://www.w3.org/TR/2010/REC-xml-stylesheet-20101028/" quoteTitle="true" derivedAnchor="XSLT">
          <front>
            <title>Associating Style Sheets with XML documents 1.0 (Second Edition)</title>
            <author fullname="James Clark"/>
            <author fullname="Simon Pieters"/>
            <author fullname="Henry Thompson"/>
            <date month="October" year="2010"/>
          </front>
          <refcontent>W3C Recommendation</refcontent>
        </reference>
      </references>
    </references>
    <section anchor="json-schema" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a">
      <name slugifiedName="name-json-schema-for-http-proble">JSON Schema for HTTP Problems</name>
      <t indent="0" pn="section-appendix.a-1">This section presents a non-normative JSON Schema <xref target="I-D.bhutton-json-schema" format="default" sectionFormat="of" derivedContent="JSON-SCHEMA"/> for HTTP problem details. If there is any disagreement between it and the text of the specification, the latter prevails.</t>
      <sourcecode type="json" markers="false" pn="section-appendix.a-2">
# NOTE: '\' line wrapping per RFC 8792
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "An RFC 7807 problem object",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri-reference",
      "description": "A URI reference that identifies the \
problem type."
    },
    "title": {
      "type": "string",
      "description": "A short, human-readable summary of the \
problem type."
    },
    "status": {
      "type": "integer",
      "description": "The HTTP status code \
generated by the origin server for this occurrence of the problem.",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string",
      "description": "A human-readable explanation specific to \
this occurrence of the problem."
    },
    "instance": {
      "type": "string",
      "format": "uri-reference",
      "description": "A URI reference that identifies the \
specific occurrence of the problem. It may or may not yield \
further information if dereferenced."
    }
  }
}
</sourcecode>
    </section>
    <section anchor="xml-syntax" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.b">
      <name slugifiedName="name-http-problems-and-xml">HTTP Problems and XML</name>
      <t indent="0" pn="section-appendix.b-1">HTTP-based APIs that use XML <xref target="XML" format="default" sectionFormat="of" derivedContent="XML"/> can express problem details using the format defined in this appendix.</t>
      <t indent="0" pn="section-appendix.b-2">The RELAX NG schema <xref target="ISO-19757-2" format="default" sectionFormat="of" derivedContent="ISO-19757-2"/> for the XML format is:</t>
      <sourcecode type="rnc" markers="false" pn="section-appendix.b-3">
   default namespace ns = "urn:ietf:rfc:7807"

   start = problem

   problem =
     element problem {
       (  element  type            { xsd:anyURI }?
        &amp; element  title           { xsd:string }?
        &amp; element  detail          { xsd:string }?
        &amp; element  status          { xsd:positiveInteger }?
        &amp; element  instance        { xsd:anyURI }? ),
       anyNsElement
     }

   anyNsElement =
     (  element    ns:*  { anyNsElement | text }
      | attribute  *     { text })*
</sourcecode>
      <t indent="0" pn="section-appendix.b-4">Note that this schema is only intended as documentation and not as a normative schema that captures all constraints of the XML format. It is possible to use other XML schema languages to define a similar set of constraints (depending on the features of the chosen schema language).</t>
      <t indent="0" pn="section-appendix.b-5">The media type for this format is "application/problem+xml".</t>
      <t indent="0" pn="section-appendix.b-6">Extension arrays and objects are serialized into the XML format by considering an element containing a child or children to represent an object, except for elements containing only one or more child elements named "i", which are considered arrays. For example, the example above appears in XML as follows:</t>
      <sourcecode type="http-message" markers="false" pn="section-appendix.b-7">
HTTP/1.1 403 Forbidden
Content-Type: application/problem+xml
Content-Language: en

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;problem xmlns="urn:ietf:rfc:7807"&gt;
  &lt;type&gt;https://example.com/probs/out-of-credit&lt;/type&gt;
  &lt;title&gt;You do not have enough credit.&lt;/title&gt;
  &lt;detail&gt;Your current balance is 30, but that costs 50.&lt;/detail&gt;
  &lt;instance&gt;https://example.net/account/12345/msgs/abc&lt;/instance&gt;
  &lt;balance&gt;30&lt;/balance&gt;
  &lt;accounts&gt;
    &lt;i&gt;https://example.net/account/12345&lt;/i&gt;
    &lt;i&gt;https://example.net/account/67890&lt;/i&gt;
  &lt;/accounts&gt;
&lt;/problem&gt;
</sourcecode>
      <t indent="0" pn="section-appendix.b-8">This format uses an XML namespace, primarily to allow embedding it into other XML-based formats; it does not imply that it can or should be extended with elements or attributes in other namespaces. The RELAX NG schema explicitly only allows elements from the one namespace used in the XML format. Any extension arrays and objects <bcp14>MUST</bcp14> be serialized into XML markup using only that namespace.</t>
      <t indent="0" pn="section-appendix.b-9">When using the XML format, it is possible to embed an XML processing instruction in the XML that instructs clients to transform the XML, using the referenced XSL Transformations (XSLT)  code <xref target="XSLT" format="default" sectionFormat="of" derivedContent="XSLT"/>. If this code is transforming the XML into (X)HTML, then it is possible to serve the XML format, and yet have clients capable of performing the transformation display human-friendly (X)HTML that is rendered and displayed at the client. Note that when using this method, it is advisable to use XSLT 1.0 in order to maximize the number of clients capable of executing the XSLT code.</t>
    </section>
    <section anchor="using-problem-details-with-other-formats" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.c">
      <name slugifiedName="name-using-problem-details-with-">Using Problem Details with Other Formats</name>
      <t indent="0" pn="section-appendix.c-1">In some situations, it can be advantageous to embed problem details in formats other than those described here. For example, an API that uses HTML <xref target="HTML5" format="default" sectionFormat="of" derivedContent="HTML5"/> might want to also use HTML for expressing its problem details.</t>
      <t indent="0" pn="section-appendix.c-2">Problem details can be embedded in other formats either by encapsulating one of the existing serializations (JSON or XML) into that format or by translating the model of a problem detail (as specified in <xref target="problem-json" format="default" sectionFormat="of" derivedContent="Section 3"/>) into the format's conventions.</t>
      <t indent="0" pn="section-appendix.c-3">For example, in HTML, a problem could be embedded by encapsulating JSON in a script tag:</t>
      <sourcecode type="" markers="false" pn="section-appendix.c-4">
&lt;script type="application/problem+json"&gt;
  {
   "type": "https://example.com/probs/out-of-credit",
   "title": "You do not have enough credit.",
   "detail": "Your current balance is 30, but that costs 50.",
   "instance": "/account/12345/msgs/abc",
   "balance": 30,
   "accounts": ["/account/12345",
                "/account/67890"]
  }
&lt;/script&gt;
</sourcecode>
      <t indent="0" pn="section-appendix.c-5">or by defining a mapping into a Resource Description 
 Framework in Attributes (RDFa) <xref target="RDFA" format="default" sectionFormat="of" derivedContent="RDFA"/>.</t>
      <t indent="0" pn="section-appendix.c-6">This specification does not make specific recommendations regarding embedding problem details in other formats; the appropriate way to embed them depends both upon the format in use and application of that format.</t>
    </section>
    <section anchor="changes" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.d">
      <name slugifiedName="name-changes-from-rfc-7807">Changes from RFC 7807</name>
      <t indent="0" pn="section-appendix.d-1">This revision has made the following changes:</t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-appendix.d-2">
        <li pn="section-appendix.d-2.1">
          <xref target="registry" format="default" sectionFormat="of" derivedContent="Section 4.2"/> introduces a registry of common problem
        type URIs</li>
        <li pn="section-appendix.d-2.2">
          <xref target="problem-json" format="default" sectionFormat="of" derivedContent="Section 3"/> clarifies how multiple problems
        should be treated</li>
        <li pn="section-appendix.d-2.3">
          <xref target="type" format="default" sectionFormat="of" derivedContent="Section 3.1.1"/> provides guidance for using type URIs that
        cannot be dereferenced</li>
      </ul>
    </section>
    <section numbered="false" anchor="acknowledgements" removeInRFC="false" toc="include" pn="section-appendix.e">
      <name slugifiedName="name-acknowledgements">Acknowledgements</name>
      <t indent="0" pn="section-appendix.e-1">The authors would like to thank 
<contact fullname="Jan Algermissen"/>,
<contact fullname="Subbu Allamaraju"/>,
<contact fullname="Mike Amundsen"/>,
<contact fullname="Roy Fielding"/>,
<contact fullname="Eran Hammer"/>,
<contact fullname="Sam Johnston"/>,
<contact fullname="Mike McCall"/>,
<contact fullname="Julian Reschke"/>, and
<contact fullname="James Snell"/>
for their comments and suggestions.</t>
    </section>
    <section anchor="authors-addresses" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.f">
      <name slugifiedName="name-authors-addresses">Authors' Addresses</name>
      <author initials="M." surname="Nottingham" fullname="Mark Nottingham">
        <organization showOnFrontPage="true"/>
        <address>
          <postal>
            <postalLine>Prahran</postalLine>
            <postalLine>Australia</postalLine>
          </postal>
          <email>mnot@mnot.net</email>
          <uri>https://www.mnot.net/</uri>
        </address>
      </author>
      <author initials="E." surname="Wilde" fullname="Erik Wilde">
        <organization showOnFrontPage="true"/>
        <address>
          <email>erik.wilde@dret.net</email>
          <uri>http://dret.net/netdret/</uri>
        </address>
      </author>
      <author initials="S." surname="Dalal" fullname="Sanjay Dalal">
        <organization showOnFrontPage="true"/>
        <address>
          <postal>
            <country>United States of America</country>
          </postal>
          <email>sanjay.dalal@cal.berkeley.edu</email>
          <uri>https://github.com/sdatspun2</uri>
        </address>
      </author>
    </section>
  </back>
</rfc>
