APIs are products and go through the same lifecycle as all products. They get created, see some usage, get improved over time based on feedback and product management, but eventually, they will be discontinued. This may either be the case because an improved (but different) product is available, or it simply may not make sense anymore to distribute the product.
Important aspectAn important aspect of Developer Experience (DX) of an API product is to make sure that for developers they are easy to use and that relying on them is a safe thing to do. One aspect of DX is that it's useful for a product to be able to make statements about its own lifespan. You can look at this as the equivalent of the expiration dates you find on food products in supermarkets. Because of these dates (and other useful labels such as nutrition and allergen information), it's safer and more convenient to use food than without that information being available.
API Lifecycle Management: Deprecation and SunsettingLooking at APIs and their end-of-life, there are two useful pieces of information that can be exposed in an API:
- Deprecation means that the API is no longer recommended for use, even though it is still operational. This may be because it will be discontinued, or because a new version of the product is available, and consumers are encouraged to switch to that newer version.
- Sunsetting means that the API will be shut down, meaning that at the announced time, the API will no longer be available. This is a hard stop for consumers who should be able to plan ahead regarding how they are going to handle this.
- "The Deprecation HTTP Header Field" currently is an Internet Draft (I-D) and defines the Deprecation HTTP header field.
- "The Sunset HTTP Header Field" is Internet RFC 8594 and defines the Sunset HTTP header field.