THE TAKEAWAYS

What to take away

  • Treat API retirement as two stages: deprecating and shutting down. RFC 8594 also describes these as separate stages.
  • Announce deprecation with the Deprecation header (RFC 9745) and the planned shutdown with the Sunset header (RFC 8594). The Sunset date must not be earlier than the Deprecation date.
  • Deprecation does not change how the API behaves. Explain the replacement and deadlines in a document linked with the deprecation link relation.
  • Both headers are hints. Consumers should not rely on the headers alone but confirm with the documentation and the provider.
  • Put the retirement plan on one page, and in acceptance checks with your contractor confirm that headers, documents and post-shutdown responses follow the plan.

FROM PRIMARY SOURCES

What happens when an API is shut down by surprise

When an API is renewed, teams spend time designing and launching the new version but often postpone deciding how to end the old one. If you only start contacting partners and other internal systems as the shutdown date nears, you reach that date without knowing who still uses the old version or how much time they need.

For consumers, a shutdown is indistinguishable from a sudden outage. An integration that worked yesterday starts failing, and only after investigating do they learn that the provider switched off the old version. Notice emails may no longer reach anyone after a staff change, and admin-screen banners are invisible to system-to-system integrations that no one opens.

RFC 8594 notes that URIs should generally be stable and persistent, but that in many scenarios they have a limited lifetime, and when that lifetime is known in advance it can be useful for clients if resources make it known. API retirement is exactly such a case.

The key is not to rely on a single channel. If, in addition to emails and documents, the API response itself carries the retirement schedule, integration code and monitoring may notice before people do. This article looks at the two headers that make this possible.

Sources: [2]

FROM PRIMARY SOURCES

Treat deprecation and shutdown as separate stages

When teams discuss retiring an API, words such as deprecated, retired, shut down and end of service get mixed up, and people mean different points in time. RFC 8594 describes a standard scenario for Web APIs in which deprecation often happens in two stages: first the API is no longer the preferred or recommended version, and second the API or a version is decommissioned.

According to RFC 8594, the Sunset header is not appropriate for the first stage, because the API remains operational and can still be used. The Sunset header represents the second stage, when the API or version becomes unresponsive.

The Deprecation header of RFC 9745 was created for the first stage. RFC 9745 describes it as a way to signal to consumers that a resource will be or has been deprecated.

RFC 9745 also states plainly that the act of deprecation does not change any behavior of the resource; consumers can keep using it as before. Deprecation is a notice asking clients to move on, while Sunset is the planned point after which the resource is expected to stop responding. Separating the two is the starting point for any plan.

Sources: [2][1]

FROM PRIMARY SOURCES

Announce with the Deprecation header and the deprecation link

The value of the Deprecation header is the deprecation date. RFC 9745 defines it as an Item Structured Header Field whose value must be a Date, written as @ followed by seconds since 1 January 1970, for example @1688169599. A future date means the resource will be deprecated then; a past date means it was deprecated then.

The header alone does not explain why or what to migrate to. RFC 9745 therefore lets a Link header with the deprecation relation type point to a document with deprecation information. That document can include a migration guide and a timeline for moving to the replacement resource.

RFC 9745 also shows exposing only the deprecation link before any Deprecation header exists, for example to make a policy discoverable in advance, such as always signalling deprecation in dedicated places at least N days before the planned date.

This makes the provider's commitments visible. If the deprecation policy and migration guide live in one document reachable from every response, consumers know when and where they will be told before any retirement is decided.

Sources: [1]

FROM PRIMARY SOURCES

State the shutdown date with the Sunset header and decide the post-shutdown response

The Sunset header communicates that a resource is expected to become unresponsive at a specific point in time. In RFC 8594 its value is a single HTTP-date timestamp that should be in the future, such as Sun, 30 Jun 2024 23:59:59 GMT. Note that its date format differs from the Deprecation header.

RFC 9745 sets a rule for using both headers together: the Sunset timestamp must not be earlier than the Deprecation timestamp. If that happens, for example through misconfiguration, client developers should consult the resource developer. The rule prevents the contradiction of a shutdown arriving before the deprecation notice.

You also need to decide what happens after the shutdown date. According to RFC 8594, after the Sunset time interactions are likely to result in client errors (4xx), redirects (3xx), or no interaction at all, and the Sunset header does not reveal which.

RFC 8594's example mentions a 410 Gone response for resources deleted after their retention period. If the provider decides during planning whether to return 404, 410 or a redirect to the replacement, and documents it, consumers can recognise post-shutdown failures more easily.

Sources: [2][1]

FROM PRIMARY SOURCES

Both headers are hints: confirm with documents and direct contact

Both headers share a caveat: they should be treated as hints rather than guarantees. RFC 9745 says client applications should always be implemented in ways that allow them to function without deprecation-related information.

RFC 8594 likewise says clients should treat Sunset timestamps as hints: there is no guarantee the resource will be available until then and unavailable afterwards. Because an intermediary may have inserted the header, or the owner may change or withdraw the date, the advertised date should never be treated as a definitive prediction.

For consumers, the important step is to check the documentation when they see a header. RFC 9745 says client developers should always check the referred documentation to verify authenticity and accuracy, and when a future date is given, should consult the provider about the impact and plan a transition where possible.

For providers, the headers supplement communication rather than replace it. Instead of assuming the notice is done once a header is sent, align headers, documentation and direct contact so that they state the same dates and content.

Sources: [1][2]

EDITORIAL PRACTICE

Our suggestion: put the retirement plan on one page

From here on are our editorial suggestions based on the primary sources. First, put the retirement plan on a single table. Listing, per stage, what the provider does, what consumers are told and what evidence confirms it makes it easier for everyone to agree on what happens when.

Use at least five stages: publishing the policy, announcing deprecation, the migration window, shutdown and after shutdown. Publishing the policy means exposing only the deprecation link; announcing deprecation means starting to send the Deprecation header; the migration window adds the Sunset header and encourages switching to the new version.

Decide three dates first: the deprecation date, the sunset date and the dates for reviewing usage. Following RFC 9745, the sunset date comes after the deprecation date. Set the length of the migration window from the number of integrators and the time they need to change their systems.

The table below is an example plan for a fictional API. The periods and methods are illustrative; decide yours from your own API and your integrators' circumstances.

Example API retirement plan (fictional; periods and methods are illustrative and not from any real service)
StageWhat the provider doesWhat consumers are toldEvidence used to confirm
Publish the policyPoint to the retirement policy document from every response with a Link header (rel="deprecation")When and where deprecation will be announcedResponse headers and the document's publication date
Announce deprecationAdd the Deprecation header to responses of the old versionThe deprecation date and the replacementHeader values and the migration guide document
Migration windowAlso add the Sunset header and review usage regularlyThe planned shutdown date and a contact pointCall counts per consumer over time
ShutdownSwitch off the old version on the planned date and return the agreed response (e.g. 410)That it has stopped, and the replacementStatus codes and logs of post-shutdown responses
After shutdownKeep monitoring requests to the old version for a set periodA contact point for questionsRequest counts and inquiry records

Sources: [1][2]

EDITORIAL PRACTICE

Our suggestion: know who still uses it, and reach out beyond headers

Because headers are only hints, consumers may not read them. RFC 8594 notes that clients that do not interpret the Sunset header operate as usual and may simply find the resource unavailable without noticing any prior notification. Providers therefore need to know for themselves who still uses the old version.

Before the migration window starts, make calls to the old version countable per API key or customer. Contact the heaviest users first and ask for their migration plans, so you are not searching for them just before the shutdown date.

RFC 9745 describes APIs that place the Deprecation header only on designated resources such as the home document and define in documentation that its scope covers the whole API. It also notes that consumers unaware of such rules will not see the wider scope.

So even if you widen the scope, it is safer to put the header on each resource you will actually retire. Then state the same dates through channels other than headers as well: email, the contact person at each customer, and admin-screen notices.

Sources: [1][2]

EDITORIAL PRACTICE

Our suggestion: acceptance checks with your contractor and the shutdown-day procedure

If a contractor develops or runs the API, make the retirement plan itself a deliverable. Receiving the plan table, the policy and migration guide documents, the header configuration and the usage reporting together lets the plan survive staff changes.

In acceptance checks, confirm in real responses that old-version responses carry the Deprecation and Sunset headers, that the values match the planned dates, that the sunset date is after the deprecation date, and that the deprecation link points to the right document. Also check that new-version responses do not carry these headers by mistake.

Decide the shutdown-day procedure in advance: the switch-off time, the response returned afterwards, the criteria and steps for rolling back, and the contact point for inquiries. If you decide to return 410 as in RFC 8594's example, check and record the actual post-shutdown status code.

Finally, keep monitoring requests to the old version for a while after shutdown. Contact consumers whose requests do not decline, and review the plan table and guide so the same problem does not recur at the next retirement. Turning retirement from a one-off task into a repeatable procedure is what makes providing an API over the long term manageable.

Sources: [1][2]

WITH OPERUN.

Delegate everyday AI management.

Retiring an API is not just picking a shutdown date and announcing it. As RFC 8594 explains, retirement splits into the stage where an API is no longer recommended and the stage where it is decommissioned. Announce the first with the Deprecation header (RFC 9745) and the second with the Sunset header (RFC 8594), with the sunset date after the deprecation date. Because both headers are only hints, combine them with a migration guide and direct contact, and know for yourself who still uses the old version. Put the plan on one page and, in acceptance checks with your contractor, verify headers, documents and post-shutdown responses in practice. Then shutting down an API becomes a planned migration rather than a sudden outage.

Discuss your product and AI work

Primary sources

Sources checked on 23 November 2026. The workflows and checklists are editorial proposals.

  1. [1]
  2. [2]

Share this insight