Engineering

API Versioning Without Breaking Anyone

Additive change, deprecation policies you can enforce, and usage telemetry that tells you when it is genuinely safe to remove an endpoint.

Purushottam Kumar Suman
Purushottam Kumar Suman
Founder & CEO, Drema AI
8 min read
Colourful programming code displayed on a computer screen

Once an external client depends on your API, your freedom to change it ends. Versioning is how you get some of that freedom back — but the strategy matters less than the discipline of avoiding breaking changes in the first place.

01

Most changes need not break anything

Adding a field, adding an optional parameter, adding an endpoint — all safe, provided clients ignore unknown fields, which you should state explicitly in your documentation. The changes that break are removals, renames, type changes and semantic changes where the field name stays and the meaning shifts. That last one is the cruellest because nothing fails loudly.

The dangerous change is not the one that breaks the response. It is the one that changes its meaning silently.

02

Version at the boundary you can support

URL path versioning is explicit, cacheable and obvious in logs. Header versioning is cleaner in theory and harder to debug in practice. Whichever you pick, the real constraint is how many versions you can genuinely maintain — every additional live version multiplies your testing surface, so two is comfortable and five is a trap.

03

Deprecation is a process, not an announcement

A deprecation needs a documented date, a response header on the deprecated endpoint, direct communication to identified consumers and usage monitoring throughout. Announcing a removal without knowing who still calls it is how integrations break on a Friday.

Mark itDeprecation header with a sunset date
Tell themContact the consumers you can identify
Watch itUsage by client, tracked continuously
Remove on evidenceWhen calls reach zero, not when the date arrives
04

Contract tests catch what review misses

A test asserting the exact response shape fails when a developer removes a field they believed was unused. This is cheap to add and catches the class of change that code review reliably misses, because the removal looks harmless in the diff.

05

Errors are part of the contract

Clients branch on error codes, so changing an error response is a breaking change even when the success path is untouched. Use stable machine-readable codes alongside human messages, and treat the codes as versioned surface — the messages can change freely, the codes cannot.

06

Documentation from the specification

Hand-written API documentation drifts within weeks. Generate the reference from an OpenAPI specification that is itself validated against the implementation in CI, and hand-write only the quickstart. This guarantees the reference is accurate and puts the effort where it helps: the first successful call.

2
Live versions is comfortable; five is a trap
Zero calls
The condition for removal
Generated
Reference docs, hand-written quickstart
Purushottam Kumar Suman
Written by
Purushottam Kumar Suman
Founder & CEO, Drema AI

Founder and CEO of Drema AI. Builds AI systems, SaaS platforms and industry software — and writes about what actually survives production.

CTA Background

Got a problem like this one?

Bring it to a call with a founder.You will get a straight answer, including when the answer is no.

View Our Work
AI-First Engineering
Secure & Scalable
Built to Deliver Impact