# Versioning Public APIs Used by Mobile Clients

Mobile clients ship on human timelines—store review, MDM freezes, and ignored updates—not your backend deploy cadence. Staff engineers version public APIs with explicit epochs, additive wire evolution, measured deprecation, and contract tests on the oldest app build you still support.

Published: 2026-10-19

## Mobile lag is a permanent constraint

App store review, enterprise MDM freezes, and users who defer updates mean your API must serve multiple client generations at once. Web can hide breaking changes behind a deploy; mobile cannot git pull on Monday morning.

Staff ownership treats the oldest supported app version as a first-class consumer. Breaking changes are product decisions with published sunset windows—not surprise 400 responses when a field rename reaches production before the store approves your fix.

When product asks for a quick rename, the first question is which builds still parse the old JSON shape and how long both shapes will live on the wire. Mobile API versioning is release engineering for people who cannot refresh on your sprint calendar.

Enterprise fleets may pin builds for quarters. Consumer apps see long tails on older OS versions. Dashboards that only count "latest store version" understate skew until a deprecation cutoff hits revenue.

Pair backend deploy velocity with a published minimum app version matrix. Backend teams ship weekly; mobile ships when Apple and Google allow—and when users tap update.

Incident reviews should ask whether a client crash was a semver mistake or a missing dual-field period. Blaming "old users" without skew data repeats the same cutoff surprise every quarter.

## Version in contracts, not in vibes

Prefer explicit API epochs via headers or path prefixes over implicit "we deployed Friday." Document what is additive, what is deprecated, and what requires a new epoch. Clients should send build identity on every request so you can route, shadow, or block safely.

Never remove fields without a measured deprecation period. Return sunset hints in structured error payloads and analytics events so product can message upgrades before hard cutoffs. "Silent removal" is how support discovers a spreadsheet of minimum versions at 2 a.m.

Publish machine-readable compatibility notes alongside human release notes. Client engineers should not reverse-engineer behavior from production traffic or Slack threads.

| Practice | Why mobile cares |
| --- | --- |
| Explicit epoch header | Route old parsers without guessing |
| Additive JSON fields | Old apps ignore unknown keys |
| Structured sunset errors | In-app upgrade copy before hard stop |
| Build id on every request | Skew metrics before you cut |

Treat OpenAPI or protobuf schemas as contracts checked into the repo—not as documentation that drifts after merge. CI should fail when server responses violate the published schema for each active epoch.

Mobile parsers are often strict JSON decoders in Swift or Kotlin wrappers around JavaScript. "Optional" on the server must mean "absent is fine," not "sometimes null, sometimes missing" unless every shipped build handles both.

## Epochs, headers, and client identity

```typescript
// Mobile client — send epoch + build on every API call
const headers = {
  "X-Api-Epoch": "2026-03",
  "X-App-Build": Application.nativeBuildVersion ?? "unknown",
  "X-App-Platform": Platform.OS,
};

export async function apiFetch(path: string, init?: RequestInit) {
  return fetch(`${API_BASE}${path}`, {
    ...init,
    headers: { ...headers, ...init?.headers },
  });
}
```

Server-side, map epoch + build to capability flags. Shadow traffic from deprecated epochs in staging before you enforce blocks in production. For Expo and React Native apps, expose build metadata through `expo-application` or native modules—do not rely on JavaScript bundle version alone when store build numbers differ.

When you must introduce a breaking epoch, run both epochs in parallel with routing keyed on `X-Api-Epoch`. Dual-write or dual-read periods belong in the runbook, not in improvised hotfixes during launch week.

Log rejected epochs at the edge with counts, not full payloads. Product needs "how many daily active users are below minimum" more than stack traces.

Rotate API keys and auth independently of epoch when possible—forcing auth migration on the same train as field removal doubles client risk. If they must move together, extend dual-mode auth until skew dashboards clear both dimensions.

## Additive evolution and deprecation

Default to additive changes: new fields, optional parameters, and new endpoints. Renaming or narrowing types is a breaking event—schedule it like a migration with telemetry, comms, and a kill switch.

Mark deprecated fields in schema and responses (`deprecated: true` in OpenAPI, or parallel documentation). Emit analytics when deprecated fields appear in requests or responses so you know who still depends on them.

Forced upgrade is a product lever—use it sparingly for security, fraud, or irreversible data migrations, not for routine refactors. When you do force upgrade, coordinate store listing text, in-app modal copy, and support macros in one release train.

Backend teams often underestimate how long old apps linger. A field "nobody uses" frequently means "nobody on the latest build uses it." Skew dashboards exist to disprove that intuition with data.

Avoid breaking mobile when web could absorb the same change with a deploy. If web and mobile share one API, mobile constraints win the compatibility debate unless product explicitly retires old app versions.

GraphQL and BFF layers do not remove the obligation—mobile still ships binaries that cache selection sets. Document which fields are stable for mobile clients even when web experiments behind the same gateway.

## Coordinate with release and support

Pair API sunsets with in-app upgrade prompts and support macros. Success teams need a single matrix of minimum versions, epoch cutoffs, and user-visible error strings—otherwise every incident rediscovers the same skew spreadsheet.

Mobile release managers should see API deprecation dates in the same calendar as store submissions. Shipping a backend cutoff the day before a holiday app review is a predictable outage.

Document which errors are "upgrade required" versus "try again." Mobile users cannot open devtools; error copy is UX and versioning policy at once.

Align marketing site promises with minimum app versions when public APIs power mobile features. Nothing erodes trust faster than a landing page feature that requires a build not yet approved in the store.

Run a short tabletop exercise twice a year: "We deprecate epoch N in 30 days—what breaks, who pages, what do support scripts say?" Staff engineers treat that drill like fire drills for on-call.

Localization matters: upgrade modals shipped only in English still block non-English users who never understood why the app suddenly logged them out. Versioning policy includes copy review in every supported store locale.

## Contract tests on oldest supported builds

Contract tests should run against the oldest supported client bundle in CI—not only the latest main branch. Record golden JSON fixtures per epoch and assert server responses still match what shipped builds parse.

Consumer-driven contract tests (Pact or schema snapshots) catch backend drift before it becomes a spinner that never resolves in production. Mobile E2E is expensive; contract failure is cheap and belongs on every pull request that touches serializers.

Keep one staging environment where epoch N and N+1 both answer with production-like data. Mobile QA installs old IPAs or APKs from artifact storage—do not assume TestFlight always equals store behavior.

When Expo over-the-air updates can change JavaScript without store review, separate native build compatibility from OTA bundle compatibility in your matrix. A native module upgrade may require a store build even when JS looks fine.

Link contract failures to the mobile hire and services pages in internal runbooks so teams know who owns client fixes versus server rollbacks.

## Measure skew before you cut

Dashboard active app versions against API epoch usage. Spikes in deprecated endpoints after a release often mean a client bug, not stubborn users. Cut only when metrics show negligible traffic on deprecated paths and when in-app upgrade coverage makes the hard stop survivable.

Define guardrails: minimum daily active users on supported builds, maximum allowed 410 rate after cutoff, and rollback criteria if error budgets burn. Product signs those thresholds—not only backend leads.

A disciplined versioning story lets you ship backend improvements without holding mobile hostage. The goal is predictable evolution, not infinite backward compatibility for builds you no longer security-patch.

Compare skew metrics to sibling reliability work— flaky E2E and slow marketing routes often correlate with API timeouts when old clients hit deprecated paths. Fix versioning before you blame the network stack.

Review skew weekly in product ops until a deprecation completes, then archive the dashboard slice as a postmortem appendix for the next epoch migration.

Export skew snapshots to the same warehouse as release metrics so finance and support can answer "who is affected" without paging backend on every store delay.

## Operational checklist for mobile API versioning

Version-control a compatibility matrix next to your API repo: epoch id, minimum iOS/Android builds, sunset date, owner, and link to client migration PRs. Pull requests that remove fields must cite skew metrics and upgrade coverage—not only unit test green.

Publish internal links to mobile app delivery and services scopes when planning epoch work—teams shipping Expo MVPs need the same versioning rules as mature apps.

Run shadow requests from oldest supported builds against staging before production cutoff. Automate that job nightly; manual "we tested on someone's phone" does not scale across locales and OS versions.

Train support on three error classes: retryable network, business validation, and forced upgrade. Misclassified upgrade errors generate refund churn and bogus backend rollbacks.

Finally, align with performance budgets on marketing and app routes—slow endpoints feel like versioning bugs when old clients retry deprecated paths with aggressive timeouts. Treat API evolution as part of mobile product quality, not a backend-only concern.

Document rollback: how to re-enable epoch N routing, how long dual-epoch mode can run, and who approves extending sunset when store review delays your client fix. Rollback plans written after outage are fiction; write them when you announce the sunset.

Share epoch calendars with sibling mobile quality posts— flaky E2E and performance budgets fail when deprecated endpoints slow cold start or retry loops. Versioning is part of the same mobile confidence story as green CI and store-ready builds.
