API Versioning
Cheat sheet · https://pcornel.dk/topic.php?topic=5310
Answer
Evolution of an API contract across URI, header, media-type or provider-specific version selectors and lifecycle states.
Remember
- Version number newer ≠ backward compatible; breaking changes can exist within policy boundaries.
- Client library version ≠ API version automatically; SDK and service contracts can evolve independently.
- Deprecated ≠ immediately unavailable; deprecation and removal dates are distinct lifecycle states.
- Same endpoint ≠ same schema across versions; defaults, fields and error contracts may change.
First checks
curl -sS <api>/v2/items— versioned path- Version header (Accept: application/vnd.x.v2+json) — alternative
- Deprecation/Sunset headers — lifecycle
Verify in this order
client pinned version → server version
Where it usually breaks
A version selector proves which contract was requested, not that the client is compatible with every behavior of that version.
Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.
API Versioning API boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Caller / request | Environment/version, identity and exact request contract are attributable | Hidden defaults, wrong endpoint/version, leaked or mismatched credentials |
| Server / response | Status, headers, structured body and request ID are interpreted together | Status-only handling, ignored error body, ambiguous async result or unsafe retry |
| State / proof | Write result is reconciled with resource read-back or acceptance test | Response success treated as final target success without verification |
| Troubleshooting | First failed boundary is preserved, changed minimally and retested | Blind retries, credential rotation, replay or payload edits before evidence is captured |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5310