Resources / Guides

API versioning best practices: URL, header or no versions at all

How to version a REST API — URL paths, headers, date-based versions — what counts as a breaking change, and how to evolve an API without breaking clients.

Once other people call your API, every change risks breaking them. Versioning is how you change it anyway — but the best versioning strategy is needing new versions rarely.

Breaking vs non-breaking changes

Usually safe (non-breaking):

Breaking:

Clients should ignore fields they don't know. If you document that, you can add fields freely.

Three ways to version

### In the URL path

GET /v1/orders/1042
GET /v2/orders/1042

### In a header

GET /orders/1042
Accept: application/vnd.example.v2+json

### Date-based versions (pinned per client)

Each client is pinned to the API version from when they started (sent as a header like Api-Version: 2026-11-01); the server translates older requests and responses. Stripe popularised this.

Practices that matter more than the scheme

  1. Avoid breaking changes. Add instead of change; deprecate instead of remove.
  2. Version the whole API, not each endpoint — mixed versions confuse everyone.
  3. Announce deprecations with dates, in docs and with Deprecation and Sunset headers.
  4. Support old versions for a defined period, and measure who still uses them before turning them off.
  5. Publish schemas (OpenAPI / JSON Schema) so clients — and AI agents — can see exactly what changed.
  6. Keep a changelog.

API versions vs deployment versions

These are different things. API versions are contracts with your callers. Deployment versions are releases of your code — you'll have many deployments per API version. Every deploy should be reversible regardless of your API versioning.

On Wisp

Every change in Wisp is a deployment version: a draft you test with ?test, publish when ready and roll back in one click — callers never see a half-deployed state. For API versions, use the path: a v2-orders endpoint next to orders, or a subpath like /orders/v2/... handled in code. Input and output schemas document each endpoint, so changes are visible before you publish.

Build it with Wisp — describe an API, get it live.

Related