Not a legal obligation but a support obligation. Documenting implies stability of an API. It says, use this thing we intend for you to use. Usually, you mark an API as deprecated, and often provide an alternative, before removing it.
Sometimes backwards compatibility is preserved even to the point of preserving bugs (especially if the companies/apps depending on it are large):
Sometimes backwards compatibility is preserved even to the point of preserving bugs (especially if the companies/apps depending on it are large):
https://www.triplefault.io/2017/07/breaking-backwards-compat...
https://arstechnica.com/gadgets/2008/11/ars-investigates-doe...