Skip to content
routebase
API Versioning12 chapters

Chapter 08 of 12

API Deprecation and the Sunset Header

How to retire an endpoint or a version without ambushing anyone, using the Deprecation and Sunset headers, dated phases and a usable migration guide.

Deleting an endpoint takes a minute and somebody else pays for it. Deprecating one is the alternative, and it works only if it is a dated plan with a migration path rather than a note in a changelog.

Announcement, grace, sunset, removal

Every workable deprecation has the same four stages, whatever you call them internally.

Announcement. The change becomes public with an end date attached. Nothing behaves differently yet, and consumers can plan.

Grace period. The window in which migration is expected. Both the old and the new path work, and the old one is signalling that it is on the way out.

Sunset phase. The last stretch before the date. This is where escalating signals belong, since anybody still calling at this point has not seen the earlier ones.

Removal. The endpoint stops answering. That the date arrived and that you are ready are two different statements, and only one of them should come from a timer.

The two versions as lanes on one timeline, with the grace period shaded between the announcement and the sunset date. The old version keeps answering for the whole of that window while the new one is already live. The Deprecation header from RFC 9745 sits on the announcement and the Sunset header from RFC 8594 sits on the date it names, so a consumer's own monitoring can read both without anybody opening an email.

The number that matters most is the gap between the announcement and the sunset. Ninety days is a common floor for public APIs, and enterprise or regulated consumers routinely need six months, because their release process runs on quarters. Set the date once and never move it closer, since a shortened deprecation teaches consumers that your dates are negotiable.

The headers, with their sources

Two HTTP headers carry this in-band, so a consumer's own monitoring can find out without anybody reading an email.

Deprecation is standardised in RFC 9745, published in March 2025 on the standards track. It carries a structured field date saying when the resource became, or will become, deprecated. Sunset comes from RFC 8594, published in May 2019 as informational, and it carries an HTTP date for when the resource is expected to become unresponsive. The two are designed to be used together, and RFC 9745 states that the sunset timestamp cannot be earlier than the deprecation timestamp.

RFC 8594 also registers a sunset link relation, which is the right way to point at the page explaining the retirement. A response carrying both headers and a link to a migration guide tells a machine and a person everything they need.

One header to leave alone is Warning. It was the older way to attach a human-readable note to a response, and RFC 9111 obsoletes it, stating that it is not widely generated or surfaced to users. If you send it, send it as an extra on top of the two headers above and never as the only signal.

Escalation that respects the calendar

The point of a phased retirement is that the signal grows while the consequence stays deferred. A workable escalation looks like this.

StageWhat the consumer experiences
AnnouncementDeprecation and Sunset headers, changelog entry, portal banner
Grace periodThe same headers, plus scheduled reminders as the date approaches
Sunset phaseStronger signals, and in testing environments a preview of the removal
After sunset410 Gone, which says the resource existed and is intentionally gone

410 rather than 404 is worth the extra thought. A 404 reads as a mistake in the caller's URL and sends a developer looking for a typo, while a 410 says the resource is deliberately gone and sends them looking for the migration guide.

Practising the removal in a non-production environment before the date is the single most effective step in this list. A consumer who hits the removal in their own test run has time to react, while one who hits it in production does not.

The migration guide is the deliverable

Everything else is scaffolding around one artefact, which is the text a consumer reads at the moment they discover the problem.

A useful migration guide names the replacement, shows the old call and the new call side by side, states what changed about the response, and describes anything that has no equivalent. That last part is the one people skip and the one that matters, because a consumer who cannot find the replacement for a field assumes the migration is impossible and escalates.

Where there is no replacement, say so plainly and explain why the capability is going away. That is a harder message and a shorter conversation than letting them search.

Tell the people who are still calling

The final piece is knowing whether anyone is listening. Usage data for a deprecated endpoint turns the removal decision from a guess into an observation, and traffic that has been at zero for two weeks is the strongest signal you will get.

Where you have identifiable consumers, a direct message beats a changelog. A team that receives an email naming their integration and the date it stops working will act, while the same information in a release note will not reach them.

In Routebase

A deprecation in Routebase is a dated plan with phases rather than a flag. The wizard asks for the sunset date, the successor endpoint, the migration guide and the sunset policy, and it validates the date against the minimum grace period your organisation set.

The deprecation wizard on its successor step, with an endpoint search open and one replacement endpoint selected.
The wizard collects the sunset date, the successor and the migration guide before anything is announced.

Phases advance on their own as their dates come due, with one deliberate exception, since retirement happens automatically only if you asked for it. Consumers see a banner on the portal page with the remaining days, the rendered migration guide and a link to the successor, and your team gets reminders before the date. Against a Routebase mock server the sunset policy also changes behaviour, adding the deprecation warning, reducing the rate limit, and answering 410 Gone during an optional soft-shutdown window so consumers meet the removal in testing first. Organisation-wide presets set the floor for the grace period and can require a migration guide, a successor or an approval. The Deprecation guide covers the phases and the policy in full, and the blog post on versioning without breaking your consumers works through a deprecation end to end.

Frequently asked questions

What is API deprecation?

Deprecation is the announcement that something still works today and will stop working on a stated date. It changes no behaviour by itself, which is exactly why it is useful, since it gives consumers a window to migrate while everything is still functioning. A deprecation without a date is not a deprecation, it is a note.

What is the Sunset HTTP header?

The Sunset header, defined in RFC 8594, carries an HTTP date saying when a resource is expected to become unresponsive. The same document registers a sunset link relation for pointing at a page that explains the retirement. It is informational rather than a standard, and it is widely enough implemented to be worth sending.

What is the difference between the Deprecation and Sunset headers?

Deprecation, standardised in RFC 9745, says when the resource became or will become deprecated. Sunset, from RFC 8594, says when it will stop responding. They answer different questions and are designed to be sent together, and RFC 9745 notes that the sunset timestamp cannot be earlier than the deprecation timestamp.

How long should an API deprecation period be?

Long enough for a consumer to fit the migration into an ordinary release cycle rather than an emergency. Ninety days is a common floor for a public API, and regulated or enterprise customers often need six months or more, because their release process is measured in quarters. What matters more than the number is that you announce the date at the start and do not move it inward.

Last reviewed by The Routebase Team.

Ready to ship on it?

Routebase is live. Design your API once — docs, mocks, tests, and monitoring all follow from the same source.

14-day Pro trial — no credit card required.