A field rename can break a client
Renaming customer_name to full_name may be easy when the API and web app are released together. A partner integration still reading the old field will fail unless it has time to update.
An API versioning policy makes those dependencies explicit. It defines which changes break compatibility, how clients hear about them and how long the old behavior remains available.
What counts as a breaking change
A breaking change is anything that can make a client that works today fail tomorrow without the client changing a line of code. The obvious ones:
- removing an endpoint, a field or an accepted value;
- renaming a field or changing its type, for example a number becoming a string;
- making an optional request field required;
- changing the meaning of a field while keeping its name.
The less obvious ones cause more incidents:
- tightening validation, such as a shorter maximum length or a stricter date format;
- changing default sorting or pagination size, which silently alters what clients see;
- returning a new error code or status where clients only handle the old ones;
- changing authentication scopes so an existing token can no longer call an endpoint;
- making responses noticeably slower or larger, which can break clients with tight timeouts.
If you are not sure whether a change breaks clients, treat it as breaking. Being wrong in that direction costs a version bump. Being wrong in the other direction costs a partner.
Changes that are usually safe
Additive changes are the backbone of an API that evolves without constant new versions:
- adding a new endpoint;
- adding an optional request parameter with a sensible default;
- adding a new field to a response;
- adding a new value to an enum, if clients were told to expect that.
The word "usually" matters. Adding a response field is only safe if clients ignore fields they do not recognize. Adding an enum value is only safe if clients have a fallback for unknown values. State both rules in your documentation from day one, so you can rely on them later. A strict client that rejects unknown fields turns every additive change into a breaking one.
Versioning strategies and their trade-offs
There are three common ways to tell the server which version a client expects. Each works. Each has a cost.
Version in the URL
Paths such as /v1/orders and /v2/orders. It is the easiest scheme to understand, to see in logs and to test in a browser. Routing and caching are simple.
The downside is granularity. A version bump tends to cover the whole API, so one breaking change in one endpoint drags everything into v2. Teams respond by bundling many changes into rare big versions, which makes upgrades painful for clients.
Version in a header
The client sends a header naming the version, and the URL stays the same. This keeps URLs clean and lets you version more finely.
The cost is visibility. Versions are harder to spot in logs and harder to try by hand, and clients that forget the header need a clearly documented default. That default becomes a quiet contract of its own.
Date-based versions
Each breaking change gets a dated version, and each client is pinned to the version that was current when it first integrated, or to the date it sends in a header. The server translates older requests and responses through a chain of small changes.
This scales well for public APIs with many clients upgrading at their own pace, and each change stays small and documented. It also demands real engineering: a transformation layer, tests for every supported version and solid tooling. For a small API with three clients it is usually more machinery than the problem needs.
Our take
For most product and partner APIs, versioning in the URL is a sensible default, combined with a strong preference for additive changes so that new major versions are rare. The scheme matters less than the discipline. Whichever you choose, use it everywhere and write down the rules.
Deprecation: dates, signals, people
A deprecation without a date is a wish. A good deprecation notice says what is going away, what replaces it, why, and the exact date it stops working.
Then repeat that message through every channel you have:
- the changelog and the reference docs, with the deprecated parts clearly marked;
- response headers that flag a deprecated endpoint and its sunset date, so client logs show it;
- email to the technical contacts of every client still calling the old version;
- a reminder at fixed points before the cutoff, for example a few months, a few weeks and a few days out.
The timeline depends on who your clients are. Internal apps can move in a sprint. Partners with their own release cycles need months. Enterprise customers may need longer and a named person to talk to. Pick a minimum and publish it, so nobody is surprised.
Catch breaking changes before they ship
Process alone will not catch every renamed field. Automation can catch most of them.
Keep the contract in OpenAPI
Write the API contract as an OpenAPI specification and keep it in the repository next to the code. When the contract is the source of truth, every change to it is visible in review.
Diff the contract in CI
Run a tool that compares the specification in a pull request with the one on the main branch and fails the build when it detects a breaking change: a removed field, a changed type, a new required parameter. This is the single cheapest safeguard against the Friday release.
Test against real usage
Contract tests written from the client's side, for example the requests your mobile app and key partners actually make, check that those requests still succeed. They catch behavior changes that a schema diff cannot see.
This is the same discipline that kept a multi-client banking API stable while it grew; the banking API case study describes how documentation and a sandbox supported it.
Compatibility also applies to what your API sends to clients, not only what they send to you. If you push events to partner systems, old consumers must keep working across versions, and delivery failures and repeated notifications need their own handling; see webhook retries and idempotency.
Retiring an old version
Switching off a version is the moment of truth. Do it with data:
- Log which clients call which version, by API key or client ID, well before the deadline.
- Contact every client that is still active on the old version, personally if the list is short.
- Run a short brownout: return errors for the old version for an hour or a day, announced in advance, to flush out clients who missed every email.
- Switch it off on the published date, and keep the team ready to help stragglers move quickly.
Then delete the old code. A version that is officially gone but still running is a security and maintenance cost nobody budgeted for.
Mistakes to avoid
- Versioning too eagerly. A new major version for every change trains clients to ignore upgrades.
- Silent changes in place. Altering behavior under an existing version, because it seemed minor, breaks the trust that versioning is supposed to build.
- No usage data. Without knowing who calls what, every deprecation is guesswork.
- Supporting old versions forever. Each live version multiplies testing and slows every change.
- Docs that lag the code. If the reference does not match reality, clients will build on reality and break later.
Write the versioning policy
Pull last month's request logs and list every client and the endpoints and fields it uses. Then write a one-page versioning policy: which changes count as breaking, which scheme you use, the minimum deprecation period and how clients will be told. Put the contract diff into CI the same week. These steps give clients notice of changes and help your team catch compatibility problems before release. If you are designing a new API or untangling an existing one, our API development page describes how we set up contracts, versioning and documentation from the start.


