What is the Sunset header?
The Sunset response header, defined in RFC 8594, carries an HTTP-date indicating the point in time after which the resource is likely to become unresponsive or be removed. It lets API providers communicate a hard end-of-life to their consumers.
API Usage & Best Practices
- Set a clear deadline: Use the date to tell integrators exactly how long they have before the endpoint stops working, so migrations can be planned.
- Pair with Deprecation:
Sunsetstates when a resource disappears, while theDeprecationheader signals that it is already discouraged; using both together gives the full timeline.
Examples
HTTP/1.1 200 OKSunset: Sat, 31 Oct 2026 23:59:59 GMTLink: <https://api.example.com/docs/migration>; rel="sunset"