QA
Intermediate LevelREST APIs & Web Services

How does the Sunset HTTP Header (RFC 8594) communicate API endpoint deprecation dates?

❓ Interview Prompt: Explain API deprecation strategy, `Sunset` HTTP header (RFC 8594), `Deprecation` header, breaking change grace periods, and developer notifications.

Decommissioning legacy API endpoints gracefully requires giving clients clear, machine-readable notice before shutting down routes:

RFC 8594 'Sunset' Header:

Returns an HTTP response header specifying the exact future date when the endpoint will be permanently retired:

•
'Sunset: Sun, 31 Dec 2026 23:59:59 GMT'
•
'Deprecation: @1753699200' (Unix timestamp when endpoint became deprecated).
•
API gateways can monitor log telemetry for clients still hitting 'Sunset' routes and automatically dispatch email warnings to developers!

Code Implementation Example

http
HTTP/1.1 200 OK
Deprecation: true
Sunset: Sun, 31 Dec 2026 23:59:59 GMT
Link: <https://api.example.com/docs/v2-migration>; rel="successor-version"
Content-Type: application/json
💡Sunset and Deprecation HTTP response headers notifying clients of upcoming retirement.
🎯 Interview Key Takeaway

Communicate API endpoint deprecation dates using Sunset (RFC 8594) and Deprecation HTTP headers.

#Sunset Header#Deprecation#API Governance#Intermediate
Back to all REST APIs & Web Services Questions→

More REST APIs & Web Services Interview Questions

Beginner LevelREST APIs & Web Services

What is HTTP Method Idempotency and how do you implement Idempotency Keys for REST APIs?

Beginner LevelREST APIs & Web Services

What are standard HTTP Status Codes (200, 201, 204, 400, 401, 403, 404, 409, 429, 500, 503)?

Beginner LevelREST APIs & Web Services

What are HTTP Verbs (GET, POST, PUT, PATCH, DELETE) and when to use PUT vs PATCH?