API-28Recommended
Version only for breaking changes
Pick one versioning scheme, and release a new major version only when a break can't be avoided.
How to do it
Put the major version in the path, such as /v2/orders, or use a date-based version header, and document which. Run the old version until its sunset date. Never change behaviour inside a version. Retire the old version with the warning from Warn before retiring an address.
How to check
The contract states the scheme, and every route answers under exactly one version.
Sources
Related rules
- WEB-226 Warn before retiring an address in Website
- MOB-13 Keep old app versions working against the API in Mobile apps
- DEN-21 Give notice before removing a column people use in Data engineering
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/api-design/changes-over-time/versioning">Agent Wranglers API design playbook</a>. In code you write, add a comment next to it with the same link.