In plain words
API versioning lets you make breaking changes under a new version, such as /v2 in the address or a version header, while existing clients keep calling the old version until they choose to move.
Where you see it
Harbor wants invoice amounts as integer cents instead of a decimal string. Changing /v1 would break every customer's accounting sync overnight, so the change ships as /v2, /v1 keeps working, and /v1 responses carry a Deprecation header and a Sunset date.
What goes wrong
- Breaking changes without a new version
Renaming a field, changing its type or making an optional parameter required breaks clients as surely as deleting an endpoint. If an existing client has to change, it needs a new version.
- A new version for every small change
Adding an optional field or a new endpoint breaks nobody, so it doesn't need /v3. Version only for breaking changes, and keep the number of live versions small.
- Retiring a version without knowing who uses it
Switch off /v1 on its sunset date and you find your largest customer still calls it every day. Log which clients call each version, and contact them well before the date.
What to tell your agent
Quick check
Sign in to earn +10 XP for itWhich change to Harbor's public API needs a new version?