<?xml version='1.0' encoding='utf-8'?>

<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-httpapi-deprecation-header-latest" number="9745" updates="" obsoletes="" submissionType="IETF" category="std" consensus="true" tocInclude="true" sortRefs="true" symRefs="true" version="3" xml:lang="en">

  <front>
    <title>The Deprecation HTTP Response Header Field</title>
    <seriesInfo name="RFC" value="9745"/>
    <author initials="S." surname="Dalal" fullname="Sanjay Dalal">
      <address>
        <email>sanjay.dalal@cal.berkeley.edu</email>
        <uri>https://github.com/sdatspun2</uri>
      </address>
    </author>
    <author initials="E." surname="Wilde" fullname="Erik Wilde">
      <address>
        <email>erik.wilde@dret.net</email>
        <uri>http://dret.net/netdret</uri>
      </address>
    </author>
    <date year="2025" month="March"/>
    <area>WIT</area>
    <workgroup>httpapi</workgroup>
    <keyword>HTTP</keyword>
    <keyword>deprecation</keyword>

    <abstract><t>The Deprecation HTTP response header field is used to signal
    to consumers of a resource (identified by a URI) that the resource will be
    or has been deprecated. Additionally, the <tt>deprecation</tt> link relation can be
    used to link to a resource that provides further information about planned
    or existing deprecation. It may also provide ways in which client
    application developers can best manage deprecation.</t>
    </abstract>

  </front>
  <middle>

<section anchor="introduction">
      <name>Introduction</name>

      <t>Deprecation of an HTTP resource (<xref section="3.1" sectionFormat="of" target="RFC9110"/>) communicates information about the lifecycle of a resource. It encourages client applications to migrate away from the resource, discourages applications from forming new dependencies on the resource, and informs applications about the risk of continued dependence upon the resource.</t>
      <t>The act of deprecation does not change any behavior of the resource. It informs client applications of the fact that a resource will be or has been deprecated. The Deprecation HTTP response header field can be used to convey this information at runtime and indicate when the deprecation will be in effect.</t>
      <t>In addition to the <tt>Deprecation</tt> header field, the resource provider can use other header fields such as the <tt>Link</tt> header field <xref target="RFC8288"/> to convey additional information related to deprecation. This can be information such as where to find documentation related to the deprecation, what can be used as a replacement, and when a deprecated resource becomes non-operational.</t>
      <section anchor="requirements-language">
        <name>Notational Conventions</name>

        <t>
    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&nbsp;14 <xref target="RFC2119"/> <xref
    target="RFC8174"/> when, and only when, they appear in all capitals, as
    shown here.
        </t>
	<t>This document uses "<xref target="RFC9651" format="title"/>" <xref
	target="RFC9651"/> to specify syntax and parsing of date values.</t>
        <t>The term "resource" is to be interpreted as defined in <xref
        section="3.1" sectionFormat="of" target="RFC9110"/>.</t>
      </section>
    </section>
    <section anchor="the-deprecation-http-response-header-field">
      <name>The Deprecation HTTP Response Header Field</name>
      <t>The <tt>Deprecation</tt> HTTP response header field allows a server to communicate to a client application that the resource in the context of the message will be or has been deprecated.</t>
      <section anchor="syntax">
        <name>Syntax</name>
        <t>The <tt>Deprecation</tt> HTTP response header field describes the deprecation of the resource identified with the response it occurred within (see <xref section="6.4.2" sectionFormat="of" target="RFC9110"/>). It conveys the deprecation date, which may be in the future (the resource in context will be deprecated at that date) or in the past (the resource in context was deprecated at that date).</t>


        <t><tt>Deprecation</tt> is an Item Structured Header Field; its value <bcp14>MUST</bcp14> be a Date as per <xref section="3.3.7" sectionFormat="of" target="RFC9651"/>.</t>
        <t>The following example shows that the resource in context was deprecated on Friday, June 30, 2023 at 23:59:59 UTC:</t>
        <artwork><![CDATA[
Deprecation: @1688169599
]]></artwork>
      </section>
      <section anchor="scope">
        <name>Scope</name>
        <t>The <tt>Deprecation</tt> header field applies to the resource identified with the response it occurred within (see <xref section="6.4.2" sectionFormat="of" target="RFC9110"/>), meaning that it announces the upcoming deprecation of that specific resource. However, there may be scenarios where the scope of the announced deprecation is larger than just the single resource where it appears.</t>
        <t>Resources are free to define such an increased scope, and usually this scope will be documented by the resource so that consumers of the resource know about the increased scope and can behave accordingly. When doing so, it is important to take into account that such increased scoping is invisible for consumers who are unaware of the increased scoping rules. This means that these consumers will not be aware of the increased scope, and they will not interpret deprecation-related information differently from its standard meaning (i.e., it applies to the resource only).</t>

	<t>Using such an increased scope still may make sense, as deprecation-related information is only a hint anyway. It is optional information that cannot be depended on, and client applications should always be implemented in ways that allow them to function without deprecation-related information. Increased scope information may help client application developers to glean additional hints from related resources and thus might allow them to implement behavior that enables them to make educated guesses about resources becoming deprecated.</t>
        <t>For example, an API might not use <tt>Deprecation</tt> header fields on all of its resources but only on designated resources such as the API's home document. This means that deprecation-related information is available, but in order to get it, client application developers have to periodically inspect the home document. In this example, the extended context of the <tt>Deprecation</tt> header field would be all resources provided by the API, while the visibility of the information would only be on the home document.</t>
      </section>
    </section>
    <section anchor="the-deprecation-link-relation-type">
      <name>The <tt>Deprecation</tt> Link Relation Type</name>
      <t>In addition to the Deprecation HTTP response header field, the server can use links with the <tt>deprecation</tt> link relation type to communicate to the client application developer where to find more information about deprecation of the context. This can happen before the actual deprecation to make a deprecation policy discoverable or after deprecation when there may be documentation about the deprecation and how to manage it.</t>
      <t>This specification places no restrictions on the representation of the linked deprecation policy. In particular, the deprecation policy may be available as human-readable documentation or as a machine-readable description.</t>
      <section anchor="documentation">
        <name>Documentation</name>
        <t>The purpose of the <tt>Deprecation</tt> header field is to provide a hint about deprecation to the resource consumer. Upon reception of the <tt>Deprecation</tt> header field, the client application developer can look up the resource's documentation in order to find deprecation-related information. The documentation <bcp14>MAY</bcp14> provide a guide and timeline for migrating away from the deprecated resource to a new resource(s) that replaces the deprecated resource, if applicable. The resource provider can provide a link to the resource's documentation using a <tt>Link</tt> header field with the relation type <tt>deprecation</tt> as shown below:</t>
        <artwork><![CDATA[
Link: <https://developer.example.com/deprecation>;
      rel="deprecation"; type="text/html"
]]></artwork>

<t>In this example, the linked content provides additional information about
deprecation of the resource in context. There is no <tt>Deprecation</tt> header field in
the response; thus, the resource is not (yet) deprecated. However, the
resource already exposes a link where information describing how deprecation
is managed for the resource is available.  This may be the documentation
explaining the circumstances in which deprecation might take place and the
deprecation policies.  For example, a policy may indicate that deprecation of
a resource(s) will always be signaled in the dedicated places at least N days
ahead of the planned deprecation date and then the resource(s) would be
deprecated on the planned date. Or a policy may indicate that the resource(s)
would be deprecated first and then be signaled as deprecated at dedicated
places. The documentation, in addition to the deprecation policy, may also
provide a migration guide explaining to consumers of the resource how to
migrate to a new or alternate resource(s) before the deprecation date. Such
policy and documentation would be very useful to consumers of the resource to
plan ahead and migrate successfully.</t>
        <t>The following example uses the same <tt>Link</tt> header field but also announces a deprecation date using a <tt>Deprecation</tt> header field:</t>
        <artwork><![CDATA[
Deprecation: @1688169599
Link: <https://developer.example.com/deprecation>;
      rel="deprecation"; type="text/html"
]]></artwork>
        <t>Given that the deprecation date is in the past, the linked information resource may have been updated to include information about the deprecation, allowing consumers to discover information about the deprecation and how to best manage it.</t>
      </section>
    </section>
    <section anchor="sunset">
      <name>Sunset</name>
      <t>In addition to the deprecation-related information, if the resource provider wants to convey to the client application that the deprecated resource is expected to become unresponsive at a specific point in time, the <tt>Sunset</tt> HTTP header field <xref target="RFC8594"/> can be used in addition to the <tt>Deprecation</tt> header field.</t>
      <t>The timestamp given in the <tt>Sunset</tt> HTTP header field <bcp14>MUST NOT</bcp14> be earlier than the one given in the <tt>Deprecation</tt> header field. If that happens (for example, due to misconfiguration of deployment of the resource or an error), the client application developer <bcp14>SHOULD</bcp14> consult the resource developer to get clarification.</t>
      <t>The following example shows that the resource in context was deprecated on Friday, June 30, 2023 at 23:59:59 UTC and its sunset date is Sunday, June 30, 2024 at 23:59:59 UTC. Please note that for historical reasons the <tt>Sunset</tt> HTTP header field uses a different data format for date.</t>
      <artwork><![CDATA[
Deprecation: @1688169599
Sunset: Sun, 30 Jun 2024 23:59:59 UTC
]]></artwork>
    </section>
    <section anchor="resource-behavior">
      <name>Resource Behavior</name>
      <t>The act of deprecation does not change any behavior of the resource.
      The presence of a <tt>Deprecation</tt> header field in a response is not meant to
      signal a change in the meaning or function of a resource in the context;
      consumers can still use the resource in the same way as they did before
      the resource was declared deprecated.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <section anchor="the-deprecation-http-response-header-field-1">
        <name>The Deprecation HTTP Response Header Field</name>
        <t>The <tt>Deprecation</tt> HTTP response header field has been added to the "Hypertext Transfer Protocol (HTTP) Field Name Registry" (<xref section="16.3.1" sectionFormat="of" target="RFC9110"/>) as follows:</t>
        <dl newline="false">
	  <dt>Field Name:</dt><dd>Deprecation</dd>
	  <dt>Status:</dt><dd>permanent</dd>
	  <dt>Structured Type:</dt><dd>Item</dd>
	  <dt>Reference:</dt> <dd>RFC 9745, <xref target="the-deprecation-http-response-header-field" format="default"/>: The Deprecation HTTP Response Header Field</dd>
	</dl>
      </section>
      <section anchor="the-deprecation-link-relation-type-1">
        <name>The <tt>Deprecation</tt> Link Relation Type</name>
        <t>The <tt>deprecation</tt> link relation type has been added to the "Link Relation Types" registry (<xref section="4.2" sectionFormat="of" target="RFC8288"/>) as follows:</t>
	<dl newline="false">
	  <dt>Relation Name:</dt><dd>deprecation</dd>
	  <dt>Description:</dt><dd>Refers to documentation (intended for human consumption) about the deprecation of the link's context.</dd>
	  <dt>Reference:</dt><dd>RFC 9745, <xref target="the-deprecation-link-relation-type" format="default"/></dd>
      </dl>
      </section>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>The <tt>Deprecation</tt> header field should be treated as a hint, meaning that the resource is indicating (but not guaranteeing with certainty) that it will be or has been deprecated. Deprecated resources function as they would have without sending the <tt>Deprecation</tt> header field, even though non-functional details may be affected (e.g., they have less efficiency and longer response times).</t>
      <t>The resource's documentation should provide additional information about the deprecation, such as recommendations for replacement. Developers of client applications consuming the resource <bcp14>SHOULD</bcp14> always check the referred resource's documentation to verify authenticity and accuracy. In cases where a <tt>Link</tt> header field is used to provide documentation, one should assume (unless served over HTTPS) that the content of the <tt>Link</tt> header field may not be secure, private, or integrity-guaranteed, so due caution should be exercised when using it (see <xref section="5" sectionFormat="of" target="RFC8288"/> for more details). In cases where the <tt>Deprecation</tt> header field value is in the past, the client application developers <bcp14>MUST</bcp14> no longer assume that the behavior of the resource will remain the same as before the deprecation date. In cases where the <tt>Deprecation</tt> header field value is a date in the future, it informs client application developers about the effective date in the future for deprecation. Therefore, client application developers consuming the resource <bcp14>SHOULD</bcp14>, if possible, consult the resource developer to discuss potential impact due to deprecation and plan for possible transition to a recommended resource(s).</t>
    </section>
  </middle>
  <back>
    <displayreference target="RFC9110" to="HTTP"/>
    <displayreference target="RFC8288" to="LINK"/>

      <references anchor="sec-normative-references">
      <name>Normative References</name>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9110.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8288.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9651.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8594.xml"/>
    </references>

    <section anchor="acknowledgments" numbered="false">
      <name>Acknowledgments</name>
      <t>The authors would like to thank <contact fullname="Nikhil Kolekar"/>,
      <contact fullname="Darrel Miller"/>, <contact fullname="Mark
      Nottingham"/>, and <contact fullname="Roberto Polli"/> for their
      contributions.</t>
      <t>The authors take all responsibility for errors and omissions.</t>
    </section>
  </back>
</rfc>
