Versioning: Why /v1 Is in the URL
Tandem's partner newsletter announces version 2 of the API. Among the changes: the field free_bikes becomes available_bikes. It is a better name — it says what the number counts without implying the bikes are free of charge — and if it went live at the address Vera calls, every report in Riverport built on that field would break on a Tuesday morning with no warning.
It will not, and the reason is the two characters you have typed on faith since Chapter 2. The /v1 in api.tandem.example/v1 is a version: a label on one particular edition of the promise. Versions are how an API changes without breaking the people who depend on it.
The Promise Problem
Chapter 1 defined an API as a promise written down: send this shape of request, receive that shape of answer. The trouble is that promises live in time. Tandem's engineers learn things, add features, and want to correct names they regret — and every one of those improvements is a chance to invalidate what somebody already built.
Two things must be true at once. The provider has to be able to change the API, or it slowly becomes useless. The consumer has to be able to not wake up broken. Versions resolve that: the old promise keeps being kept at the old address while the new one opens next door, and the consumer chooses when to walk over.
The everyday version is a bank changing a form. The new form has a renamed field and a better layout, and for a posted transition period the branch accepts both. Nobody's mortgage collapses because a box was relabelled, and nobody is turned away at the counter for holding last year's paper. What makes that civilized is not the new form. It is the posted period.
Where Versions Live
Tandem puts the version in the path, which is the most visible option and the most common one you will meet: /v1/stations and /v2/stations are two addresses, and which one you get is decided by what you typed.
Other APIs put it elsewhere. Some take a header naming the version, sometimes a dated one. Some take a query parameter. The mechanism differs; the meaning does not, and the documentation always says which edition it is describing. That is the complete explanation of the version selector Chapter 6 warned you about: a docs site can show you v1 while your URL says v2, and then the page and the wire disagree for a reason that has nothing to do with anyone being wrong.
It also closes the small mystery that chapter left open. A field named on a reference page that the response does not contain is exactly what a rename in progress looks like from below — the page and the endpoint describing two different moments of the same promise. Renaming is precisely the kind of change a version boundary exists to hold, and when Tandem's rename ships it ships at /v2, leaving free_bikes untouched at /v1.
Breaking and Non-Breaking Changes
Not every change needs a new version, and the dividing line is simple enough to hold in your head. A change is breaking if a consumer doing exactly what it did yesterday now gets something it cannot use: a field renamed, a field removed, a value that changes type, an endpoint retired. Those wait for a new version.
Adding, on the other hand, breaks nobody. If Tandem starts including a last_serviced field on every station tomorrow, Vera's report neither notices nor cares — it reads the fields it came for and lets the rest be. That is why Chapter 4 taught the habit of letting unfamiliar fields exist rather than treating them as errors. The reader has been version-tolerant since then without being told, and it is the single habit that makes additive change safe for everybody.
The Consumer's Calendar
When a version is eventually retired, that is announced rather than sprung. The provider publishes a deprecation notice — this edition is on its way out — along with a sunset date, the day it stops answering. Both usually arrive by email and in the changelog, and some APIs go further and attach a literal Sunset header to responses from the old version, so the warning rides along with the data itself. Alongside them comes a migration guide, which for a rename is often a plain table of old names against new.
Vera's move is unhurried, and it is the whole point of the mechanism. She reads the changelog when the newsletter arrives. She checks which fields her report touches. She tries v2 against the sandbox with her test key, sees available_bikes where free_bikes used to be, adjusts the two places her spreadsheet names that field, and then changes the version in the URL. Weeks of calm, done at her own pace, instead of a morning of mystery.
- "Version 2 exists, so version 1 has stopped working." It keeps its promise until a stated sunset date, which is frequently years away. The arrival of the new one is not the death of the old one, and the date is published rather than sprung on anybody.
- "Versioning is provider bureaucracy." It is the only reason an integration survives the provider improving anything. The alternative is a world where somebody else's good idea is your Tuesday morning outage.
- "A field I have never seen before means the version changed." Additions are the non-breaking lane and arrive inside a version all the time. Your Chapter 4 habit of ignoring fields you did not come for is exactly what makes them harmless.
- "I should move to the newest version as soon as it opens." There is no prize for being early, and a migration done between two other tasks is how mistakes happen. Read the changelog, test against the sandbox, move when the report is ready.
- The one piece of every URL in this book that you have been typing without explanation now has one, and the canonical rename gives the documentation drift from Chapter 6 its complete backstory.
- Knowing that sunsets are announced changes what you do with a provider's email. Offices that read the deprecation notice migrate over a quiet fortnight; offices that do not discover the sunset date as an outage, on the day.
Knowledge Check
Why does /v1 appear in the address at all?
- It reports which release of the server software is running
- So the promise can change without breaking existing callers
- It marks the tier of access a partner key has been granted
- It counts how many times the endpoint has been called today
Which change would require a new version rather than shipping inside the current one?
- Adding a last_serviced field to every station object
- Renaming free_bikes to available_bikes on stations
- Adding a new endpoint for maintenance crew schedules
- Making the stations endpoint answer twice as quickly
Tandem announces v2 with a sunset date for v1 eighteen months out. What does that commit each side to?
- Tandem keeps v1 answering indefinitely for existing partners
- Vera must move her report to v2 within the coming week
- v1 keeps working until that date, and Vera migrates before it
- Both versions stop at the date and a third one replaces them
A station object arrives with a field Vera has never seen. What should she conclude?
- She was silently moved to a newer version of the API
- Something was added, and her report can carry on ignoring it
- The response is malformed and should be fetched again
- The fields her report reads have quietly been renamed
You got correct