Strategy Guide
API Versioning
APIs evolve. Features get added, schemas change, and sometimes breaking changes are unavoidable. A solid versioning strategy lets you move forward without leaving your consumers behind.
Strategy Guide
APIs evolve. Features get added, schemas change, and sometimes breaking changes are unavoidable. A solid versioning strategy lets you move forward without leaving your consumers behind.
Every API is a contract between you and your consumers. When you change that contract — renaming a field, removing an endpoint, or altering response structures — existing integrations can break. Versioning gives you a controlled mechanism to introduce changes while maintaining backward compatibility.
Not all changes require a new version. Understanding the difference is key.
Breaking
Non-Breaking
There are several approaches. Each comes with trade-offs around complexity, discoverability, and developer experience.
The most common and most visible approach. The version number is embedded directly in the URL path.
# Version 1
GET https://api.seriousmonkey.biz/v1/bananas
# Version 2
GET https://api.seriousmonkey.biz/v2/bananas
Pros: Extremely explicit, easy to understand, simple to route, works with any HTTP client.
Cons: Increases the number of URLs, can lead to large codebases if not managed carefully.
| Strategy | Visibility | URL Cleanliness | Caching | Ease of Use |
|---|---|---|---|---|
| URL Path | High | Low | Excellent | Excellent |
| Header | Low | High | Requires config | Moderate |
| Query Param | Medium | Medium | Requires config | Good |
A good versioning strategy goes beyond choosing a format. You need a clear lifecycle for how versions are introduced, maintained, and eventually retired.
Active — The current recommended version. All new features and bug fixes land here first.
Maintained — Still supported. Receives critical bug fixes and security patches, but no new features.
Deprecated — Scheduled for removal. Consumers receive warnings in response headers and should migrate.
Retired — No longer available. Requests return 410 Gone with migration guidance.
When deprecating a version, give consumers plenty of notice and make migration easy.
# Include deprecation headers in responses
Deprecation: true
Sunset: Sat, 01 Nov 2026 00:00:00 GMT
Link: <https://docs.seriousmonkey.biz/migration/v1-to-v2>; rel="successor-version"
Pro Tip: Give at least 6 months notice before retiring a major version. Provide migration guides, tooling, and personal outreach to high-value consumers.
Don't prematurely version. Ship v1 and only create v2 when you actually have breaking changes. Over-versioning creates maintenance burden without adding value.