# Shipping API changes when your app is weeks behind

Published: 23 November 2026
Category: Technology

A backend deploy takes minutes, and if it goes wrong, a rollback takes seconds. A mobile release is a different animal. There's store review, then a phased rollout over a week or so, then the long tail of people who turned off automatic updates, are on a phone that can't run your latest build, or simply haven't opened the app since March.

The result is that every version of the app you have ever shipped is still out there talking to your API, and you can't recall any of them. Your API isn't a contract with "the app". It's a contract with every build in the wild, and the oldest of those will hang around for years.

Most of the pain I've seen on mobile projects comes from treating the API and the app as if they ship together. They don't. The practices below are what I've settled on to let the backend move at backend speed without stranding the people on last year's build.

## Build the escape hatches into version 1.0

Two things can only ever be added to an app going forward, so they need to be in the very first release. If you skip them, every build you ship before adding them is one you can never force off the platform.

### Clients identify themselves

Every request should say exactly what sent it. A few headers are enough:

```typescript
const headers = {
  "X-App-Version": "4.12.0",
  "X-App-Build": "4120031",
  "X-App-Platform": "ios",
  "X-OS-Version": "18.1",
};
```

This costs nothing and it pays for itself the first time you need to answer "who is still calling this endpoint?" or "is this bug only in 4.9 on Android?". Log these alongside every request and you can break your traffic down by build.

### A minimum supported version

The app should check, on launch and on resume, a small unauthenticated endpoint that tells it where it stands:

```json
{
  "ios": { "minimum": "4.6.0", "recommended": "4.12.0" },
  "android": { "minimum": "4.6.0", "recommended": "4.11.2" },
  "message": "This version is no longer supported. Please update to keep using the app."
}
```

Below `minimum`, the app blocks with an update screen linking to the store. Below `recommended`, it shows a dismissable nudge. Keep it on its own endpoint, serve it from somewhere that stays up when the rest of the API doesn't, and make the app fail open if it can't reach it, otherwise an outage becomes a lockout.

The forced upgrade is a last resort, not a release strategy. Users hate it and some will churn rather than update. But having it means a security fix or a truly unavoidable break is a bad week rather than a permanent problem.

## Only ever make additive changes

The single most useful rule: **a change to a live endpoint may add things, never remove or redefine them.**

Safe:

- adding a new endpoint
- adding an optional field to a response
- adding an optional parameter to a request, with a default that preserves the old behaviour

Breaking:

- removing or renaming a field
- making an optional request field required
- making a non-null response field nullable
- adding a value to an enum the client switches on (more on this below)
- changing a field's type, units, format or meaning

That last one is the sneaky category, because it doesn't show up in a schema diff. Changing `duration` from seconds to milliseconds, switching a timestamp from local time to UTC, or shrinking the default page size from 50 to 20 will all pass every type check and still break the old app. If the meaning changes, it's a new field with a new name.

### Expand, migrate, contract

When something genuinely has to change, do it in three steps rather than one:

1. **Expand.** Add the new shape alongside the old one. The API returns both `price` and `priceCents`, for example.
2. **Migrate.** Ship the app version that reads the new field. Wait for adoption.
3. **Contract.** Once your request logs show the old field's consumers have dropped to a level you're happy to cut off, raise the minimum version and remove it.

Step 3 is a decision you make from data, not a date in a sprint. Which is why the version headers matter.

## Write clients that tolerate change

The other half of the contract lives in the app. A client written defensively gives the backend much more room to move.

- **Ignore unknown fields.** Most JSON decoders already do, but check yours. Some strict decoders fail the whole payload on an extra key.
- **Handle unknown enum values.** If the app switches on `status` and the server adds `"on_hold"`, an old build should fall through to something sensible rather than crash.
- **Treat optional as optional.** If a field isn't guaranteed, don't force-unwrap it.
- **Switch on error codes, not messages.** Give every error a stable machine-readable code and handle unknown codes with a generic fallback.

```typescript
type OrderStatus = "pending" | "shipped" | "delivered" | "unknown";

function parseStatus(value: unknown): OrderStatus {
  switch (value) {
    case "pending":
    case "shipped":
    case "delivered":
      return value;
    default:
      return "unknown"; // render a neutral state, report it, carry on
  }
}
```

The `unknown` case is what lets the backend add a status next month without a coordinated release.

## Deploy the backend first, always

The sequencing rule falls out of everything above: the backend change ships first and supports both the old and new behaviour. The app ships second. The cleanup ships last, much later.

Never ship an app that depends on a backend change that isn't already live in production. Store review timing is unpredictable, and a phased rollout means your new build reaches its first users at a time you didn't choose. If the API isn't ready when it lands, you've shipped a broken app that you can't pull back.

## Separate deploy from release with flags

Feature flags turn app releases from events into background noise. Ship the code for a feature dark, in a build that goes out whenever it's ready, then switch it on from the server once the backend is live and you're confident in it.

This gives you three things:

- the app and backend timelines stop needing to line up
- you can roll a feature out by percentage, platform or app version
- you have a kill switch when something goes wrong, which on mobile is the closest thing you get to a rollback

Keep the flag evaluation server-side, or at least cache the flag values from the server rather than baking them into the build. A flag you can't change without a release isn't a flag.

## Versioning: fewer versions than you think

If you stick to additive changes, you need explicit API versions far less often than people expect. My preference:

- **Evolve in place** for the everyday changes, under the rules above.
- **Bump a major version** (`/v2/orders`) only for a real redesign, and keep the old one running until the minimum supported app version no longer calls it.
- **Don't run more than two** majors at once. Every live version is code you test, secure and keep compatible with new data.

Date-based versioning, where the client sends the API version it was built against and the server translates responses to match, is a nice model if you have a lot of external consumers. For a single first-party app, it's usually more machinery than you need.

## Consider a backend for frontend

If the app talks directly to a handful of internal services, every change in any of them becomes a mobile compatibility question. A thin backend for frontend (BFF) owned by the app team puts one layer in between: internal services can change shape, and the BFF keeps presenting what each app version expects. It's also the natural place to put the version check, flag evaluation and any per-version response shaping.

The cost is another service to run. For anything beyond a simple app with one backend, it's usually worth it.

## Catch breaking changes in CI

Humans miss breaking changes in review. Tools don't, at least for the structural ones.

- **Keep an OpenAPI spec** as the source of truth, generated from code or the other way round, and diff it on every pull request with a tool like `oasdiff` to fail the build on a breaking change.
- **Keep recorded responses** for each supported app version and run the app's decoding layer against fresh responses from the current API in CI. If the old decoders can't read the new payload, you know before your users do.
- **Consumer-driven contract tests** (Pact and similar) formalise the same idea if you want it across teams.

None of this catches the semantic changes, the seconds-to-milliseconds kind. That still needs a reviewer who asks "does this mean the same thing it did yesterday?"

## Measure before you remove

With version headers in your logs, you can answer the questions that drive every deprecation:

- what share of active users are on each build
- which builds still call the endpoint or read the field you want to remove
- how quickly a new release is being adopted

Put that on a dashboard and the conversation about raising the minimum version becomes "0.4% of weekly users are below 4.6, and they're mostly dormant" rather than a guess.

## The short version

- Send app version, build and platform on every request from day one.
- Ship a minimum and recommended version check in your first release, and fail open.
- Make additive changes only. A change in meaning is a new field.
- Expand, migrate, contract, with the contract step driven by usage data.
- Write clients that ignore unknown fields and survive unknown enum values and error codes.
- Backend goes first, app second, cleanup last.
- Gate features with server-side flags so releases stop needing to line up.
- Keep explicit API versions rare, and no more than two live.
- Diff your API spec in CI, and test old decoders against new responses.

The common thread is accepting that you don't control when your code reaches people's phones. Once the API is designed around that, the backend can deploy as often as it likes and the app team can release when they're ready, rather than both waiting on each other.
