
API Versioning Best Practices: How to Evolve APIs Without Breaking Integrations
The tricky bit about versioning is working out which promises a provider actually keeps, for how long and who has the authority to retire them.
In a 2017 engineering post, Stripe reported that every version of its API since the company’s founding in 2011 was still being honored. The same post counted close to a hundred backward-incompatible upgrades over the previous six years. Both statements held because Stripe had built machinery to absorb the difference between them. Most organizations will never build that machinery, and most do not need to.
What every API provider does need is a stated position on three things: what counts as a promise to consumers, how long a promise is kept, and who can end it. The mechanics of API versioning best practices, from URL schemes to sunset headers, follow from those answers.
What is the difference between breaking and non-breaking API changes?
A non-breaking change allows existing consumers to continue operating without code changes. A breaking change alters an established expectation and can cause an integration to fail or behave differently.
Adding a new endpoint is generally non-breaking. Removing an endpoint is not. Adding an optional parameter may be safe if existing requests retain their behavior. Making that parameter mandatory changes the contract. But the more difficult cases are behavioral. An API might return the same response structure while changing how it interprets a filter, calculates a total, sorts records, or handles an authorization failure.
From the provider’s perspective, the team may have improved the implementation. From the consumer’s perspective, the application is receiving different results from the same request. A breaking change therefore reaches beyond the schema. It is any change that disrupts behavior a correctly implemented consumer was entitled to rely on.
The three layers of API backward compatibility
Google’s API Improvement Proposals describe API backward compatibility in three layers.
- Source compatibility means client code still builds against a newer release.
- Wire compatibility means an older client can still talk to a newer server.
- Semantic compatibility means the client keeps receiving “what most reasonable developers would expect.”
It is the layer that schema-diffing tools cannot see. AIP-180 lists changes that leave every field in place and still count as breaking. One is altering a default value. Another is changing whether a field equal to its default is serialized. A third is adding pagination to a list call that previously returned everything at once.
Hyrum Wright, a Principal Scientist at Adobe, was previously a software engineer at Google. He described why this keeps happening, and Titus Winters gave the observation the name that stuck.
The gist of it is that with enough users, “all observable behaviors of your system will be depended on by somebody.”
List ordering is the textbook example. Timing and performance characteristics are another.
Enumerations are the real issue
Both the GitHub and Google Ad Manager API state that a new enum value is backward compatible. Ad Manager goes on to state that the consumer side has a duty to “handle unknown fields in API responses”.
Microsoft’s .NET design guidelines (for libraries) take a more conservative view. They admit there is a small compatibility risk when you add a value to an enum that has already been shipped. A consumer that’s been doing an exhaustive switch over a fixed set of values will fail on the new value regardless of what the provider says. The practical solution is to publish the tolerance rule where the consumer will see it. A tolerance rule that nobody has been told about is simply not going to be enforceable later on.
GitHub’s published list of API breaking changes is a good one to use as a template, as it contains all sorts of things that teams tend to omit. In addition to the standard removals, renames and new required parameters you’d expect, it also lists changes to a field’s type, new validation rules on an existing parameter and changes to the auth/authorisation requirements.

Choosing an API versioning strategy
Most REST API versioning boils down to where the version is. Path versioning (e.g. /v1/customers, /v2/customers) is everywhere in the logs and trivial to route, at the cost of having to multiply your gateway configurations, documentation, your SDKs,s and your test environments with every major version.
Header versioning leaves the resource URL untouched and allows for a more granular approach, though you do have to get all your caches, gateways and monitoring tools to deal with the header in the same way. Date based versioning is the third option and is used by both Stripe and GitHub.
Stripe pins each account to the version in effect at the time of its first request
Stripe pins each account to the version in effect at its first request. Individual requests can override that pin with a Stripe-Version header, and a user can upgrade the account to a later version from the dashboard.
Internally, Stripe builds each response in the current shape and then passes it back through a chain of version-change modules until it matches the version the caller asked for.” GitHub name their versions by release date and pick them via the X-GitHub-Api-Version header. In both cases, the provider bears the complexity so that the consumer can upgrade on their own schedule.
That makes perfect sense when breaking changes are frequent. At the rate Stripe were reporting in 2017 (roughly one every three weeks) you simply don’t need a transformation chain. A team that ships one breaking change a year isn’t going to benefit from a transformation chain at all, and the sensible default is a URL-based major version with a strict additive-only rule within each major.
Whichever mechanism a team chooses, one detail deserves a decision up front: what happens to requests that name no version. GitHub’s documentation warns that once a version’s support window closes, unversioned requests fall to the next oldest supported version, so a client that never pinned anything will see behavior change without having changed itself.
The compatibility policy also has to go beyond endpoints. Webhook payloads, error formats, rate limits and SDK behavior are all part of the contract. Moving from API keys to OAuth 2.0 client credentials, or from page number pagination to cursors, doesn’t change the URL at all and still represents a migration for every consumer.
How to version an API without breaking existing integrations
Existing integrations survive because of a few habits. Consumers can pin the version they built against so a release never changes their behavior underneath them.
Changes within a version are additive, and there’s a published rule for unknown fields and enum values. Each release is checked against what the consumers actually depend on via contract tests and gateway usage data. Removals only happen through a dated, signaled retirement with a named replacement. That’s how incidents start, really. If you’ve got pinning without additive discipline, then you’re going to break clients on upgrade day.
If you’ve got additive discipline without a published tolerance rule then you’re going to break the strict ones.
What a supported version costs
Brandur Leach (author of Stripe’s versioning post) described the whole thing as a compromise between developer experience and the cost of maintaining the old versions.
The cost falls on engineering time, shifting away from new features and toward old code. Stripe’s first line of defense is to need the machinery as little as possible. The team is focused on “getting the design of our APIs right the first time “. A subsequent write-up by the same author on the rationale for why Stripe doesn’t auto-upgrade accounts describes the approach as safety first’ and notes an API of 30+ resources and circa 130 endpoints.
The fundamental budget question for any provider is how many versions they can run at any one time. GitHub’s answer is very clear: the prior version will be supported for a minimum of 24 months after the next version has shipped. Overlap becomes a permanent cost, and the release cadence determines its magnitude.
With a new version every 12 months and a 24-month support commitment, that means two prior versions will be in active use alongside the current one in steady state, each one requiring security patches, documentation, and test coverage.
How do you deal with breaking changes in APIs?
Provider side tests confirm what the provider thinks it built. They tell us nothing about what the consumer believes they were promised.
Ian Robinson (Thoughtworks) looked at the gap in a 2006 article on Martin Fowler’s site. Schema-based protection protects the consumer from change, he said, but gives the provider absolutely no insight as to how it is being used. His pattern is the consumer driven contract. Each consumer states the subset of the interface that it uses. The union of those statements is what the provider must not break.
Consumer-driven contract testing turns that idea into a pipeline stage. With Pact, a common tool for it, a consumer writes tests against a mock, and the resulting expectations are published as a contract. The provider’s build replays those contracts against real responses and fails when a change would violate one. The failure names the affected consumer, which is half the work of impact analysis. Microsoft’s engineering playbook adds a caution: contracts do not replace conversation between teams, and a failed verification is the cue to have one.
The boundaries are obvious. A contract only exists for interactions that someone has actually written down. It won’t find the partner integration that nobody ever documented, nor will it find the script that’s running on a customer’s finance server. Hyrum’s Law applies here too. Contract tests are most effective when used in conjunction with schema diffing in CI and field level usage analysis from gateway logs (which tells you what the consumers are actually reading).
When should an API version be deprecated?
A version is ready for deprecation when a replacement exists that meets consumer needs, usage data tells us who is still using the old one, and the end date can be justified to the person it affects. Age in itself doesn’t qualify: an old version doing a quiet reconciliation job is worth more care than a newer one that nobody uses at all.
The length of the deprecation window for an API is a judgment. GitHub’s 24 month window is a good public benchmark, though a smaller API with only a few known integrators can move much quicker. A longer window protects the slowest consumer and also tells all the other consumers that it’s safe to wait. That’s in favour of having firm milestones within the window (e.g. reminders, announced brownouts) rather than simply a longer window.
Standards now exist for signaling
RFC 9745 (March 2025, Sanjay Dalal & Erik Wilde) defines a Deprecation response header which carries the date on which a resource is or will be deprecated, plus a Link relation of type deprecation which points to the deprecation documentation. The older Sunset header from RFC 8594 indicates when a resource is likely to stop responding. A Sunset date cannot be earlier than the Deprecation date and for historical reasons the two headers use different date formats so client parsers have to be able to parse both. GitHub uses Sunset in this manner and will return a 410 Gone once a version is retired.
Headers can’t carry a deprecation on their own. RFC 8594 is very clear in that it tells clients to “treat Sunset timestamps as hints” and that automated tooling will never get to the person who owns the quarterly job. Direct notification is still important: you need to email the registered technical contacts, you need a banner on the dashboard and you need a named contact at the major accounts.
The headers also work at the resource level. There’s an individual IETF draft from June 2026 which proposes field-level signaling, but that’s not a standard.
How do you migrate the consumers to a new API version?
Releasing v2 doesn’t mean that consumers have adopted it. Migration has to be a project with owners and dates. The first thing we deliver is a migration guide which shows the differences between the contracts rather than a tour of v2. If the auth flow has changed then the guide needs to show the new flow end to end. If pagination has changed then it needs to give you working request pairs. The updated SDKs will go a long way to removing the manual work for customers who are using the generated clients, though each consumer will still have to go through their own business logic and test it against the new behavior.
How do you migrate from API v1 to v2? A working API version migration checklist
- Inventory every v1 consumer by account, endpoint, SDK version and last seen date.
- Publish the v2 contract with a field-by-field diff against v1.
- Ship updated SDKs and a sandbox that behaves like production.
- Run v1 and v2 in parallel with separate dashboards for traffic, errors and latency.
- Fix the dates, then add the Deprecation and Sunset headers to v1 responses with a Link to the migration guide.
- Assign a named contact to each high-risk account and get in touch directly.
- Schedule a series of short, announced v1 brownouts prior to the sunset date to reach those consumers who missed out on the initial notices.
- Review the usage over a full business cycle, confirm the retirement date and return 410 Gone with a pointer to the guide.
How do you monitor API version adoption?
Request counts by version are the least informative figure on the dashboard. Much more useful are the distinct consumers per version, traffic by account and endpoint, the SDK versions in the field, each consumer’s last seen date, the error rates and the auth failures on the new version (which will usually be the first thing to flag up any issues with a migration).
Volume is misleading in both directions. A job will disappear from the traffic graph for weeks at the end of a month or quarter. Then reappear on schedule, so a quiet week tells you nothing. You need to look at the traffic over a full business cycle before you can get any real insight into a retirement decision.
A sudden drop can also mean the customer has migrated, failed and gone quiet. The real question is who is still using the old version, for what, and what breaks for them when it stops answering.
API lifecycle management comes down to ownership
API lifecycle management covers design, release, operation, deprecation, and retirement, and it tends to fail at the handoffs between them. One named owner needs to hold the contract. The policy should state the definition of breaking, the notice periods, the approval route for changes. Also, it should state the evidence required before a version is retired.
It should also state when the policy can be overridden. GitHub’s documentation names its exceptions: security, availability and reliability problems, and services with very low usage. Notice is given where feasible, and none where immediate action is required. Writing exceptions down in advance is what keeps them from becoming the ordinary way breaking changes ship.
A team starting from nothing can begin with two documents. One is a consumer inventory, and the other is a one-page definition of what counts as breaking Both cost little, and most other API versioning best practices depend on them.
In brief
- A change is breaking when it changes behavior that a correctly built consumer relies on, even if the schema itself hasn’t moved. Defaults, pagination, and validation rules all count.Defaults, pagination, and validation rules all count.
- For the majority of teams the practical default is URL based major versions with just additive changes within each version. Date based versioning is where you start to see the benefits when you have a regular flow of breaking changes.
- Every supported version has an ongoing cost. GitHub guarantees at least 24 months of overlap, and the release cadence determines how many versions are running at any one time.
- Consumer driven contract tests will tell you which consumer a change would break, but only in the case of interactions that someone has actually recorded.
- A version is ready for deprecation when a replacement is in place and the usage data identifies who is left. The deprecation and sunset headers are helpful in this process, but direct contact is still required and adoption should be monitored throughout the full business cycle.