Skip to main content
  1. References/
  2. Architecture Design Basics/
  3. Pattern Taxonomy/
  4. Communication & API Design/

API Versioning Strategies

·· 200 words· 1 min

🟠 P1 — how you evolve public APIs without breaking consumers

Problem #

APIs evolve. Consumers depend on existing behaviour. Breaking changes break trust (and integrations). You need a strategy to evolve while maintaining backward compatibility.

Approaches #

StrategyMechanismProsCons
URL versioning/v1/users, /v2/usersExplicit, easy to understandURL proliferation
Header versioningAccept: application/v2+jsonClean URLsHidden, harder to discover
Query param/users?version=2SimpleFeels hacky
Content negotiationMIME typesRESTfulComplex, rarely used well
Additive-onlyNever remove, only add fieldsNo versions neededSchema bloat over time

Instinct #

Stripe’s approach is instructive: they use dated API versions (2023-10-16) with an additive-only default. Each version is a set of “changes” applied on top of the previous one. This avoids the v1/v2/v3 proliferation problem while giving consumers stability. Stripe’s API versioning docs and engineering blog post describe this approach in detail.

The key insight: version the behaviour, not the URL.

For internal services, prefer additive-only changes + schema evolution (Protobuf field numbers). Versioning is a client-facing concern.

References #

DDIA 2e Reference #

  • Chapter 4: Schema evolution, forward/backward compatibility