Label APIs with a version (such as v1, v2) and release a new version for incompatible changes instead of modifying the old one in place.
Why use it
Clients do not upgrade on your schedule: mobile users may go months without updating, and partner systems have their own release cadence.
Evolve with confidence: with versions, you can refactor boldly in the new one while the old one stays stable.
What counts as a breaking change
Needs a new version: removing or renaming a field, changing a field’s type or meaning, adding a required parameter, changing status-code semantics.
Does not need a new version (backward compatible): adding optional fields, adding endpoints, adding optional parameters—provided clients are “tolerant” and ignore unknown fields.
Common approaches
Approach
Example
Traits
Path version
/v1/orders
Clearest and most common; easy to cache and debug
Header version
X-Api-Version: 2
Cleaner URLs, but harder to see at a glance
Query parameter
/orders?api-version=2
Simple; fine as a default option
Beginners should use path versioning.
How to do it
🔀 Old and new versions online side by side, each used independently
Old app
New app
Server
1GET /v1/orders
2Old shape (name field)
3GET /v2/orders
4New shape (title field)
The old app keeps working without upgrading; new features ship only in v2.
Ship with v1 from day one—bolting it on later is costly.
Prefer backward-compatible evolution; open a new version only when you must.
Keep at most two or three versions alive at once; more than that overwhelms the team.
Retiring an old version needs a process: announce early, signal deprecation in response headers, set a cutoff date, and monitor who still uses it.