Tutorial · 02 Jul 2026

Designing a REST API you can version

Versioning is a design problem long before it is a routing problem. The decisions that hurt later are made in the first week.

Format
Tutorial
Reading time
14 min
Published
02 Jul 2026
Desk
DevCSE Engineering Desk

01

Model resources, not screens

An API shaped around today's interface becomes a liability the moment a second client appears. Name resources after durable domain nouns and let clients compose them; expose aggregates only where round-trip cost is measurable.

02

Decide what a breaking change is

Write the rule down and publish it: adding an optional field is additive, tightening validation is breaking, reordering an array is breaking if anyone indexes it. Without a written rule, every judgement call becomes an argument.

03

Give errors a stable shape

One envelope with a machine-readable code, a human message and an optional field map. Clients branch on the code and never on the prose, so copy can change without shipping a client release.

04

Version the contract, not the codebase

Route both versions into one implementation with a translation layer at the boundary. Forked codebases drift, and the drift shows up as bugs that only reproduce on the old version.