StoicBuilder

HandbookXI the TabulariumAPI versioning

XIthe Tabularium, Model the data

API versioning

1 min readUpdated 28 November

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.

Response headers from /v1/invoicesserver
HTTP/1.1 200 OKDeprecation: @1796083200Sunset: Wed, 30 Jun 2027 00:00:00 GMTLink: <https://docs.harbor.example/migrate-to-v2>; rel="deprecation"
Old clients keep working, and the headers tell them since when /v1 has been deprecated, when it ends and where the migration guide lives.

What goes wrong

  1. 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.

  2. 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.

  3. 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

Copy this into Lovable, Bolt, Cursor or any agent
This change alters the invoice response shape, so add it as /v2 and keep /v1 behaving exactly as it does now. Add Deprecation and Sunset headers to /v1 responses, log which API keys still call /v1, and write a short migration note listing every difference.

Quick check

Sign in to earn +10 XP for it

Which change to Harbor's public API needs a new version?

Got a prompt that touches API versioning?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.