API versioning for mobile app backward compatibility

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
API versioning for mobile app backward compatibility
Medium
~3-5 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

API Versioning Implementation for Mobile App Backward Compatibility

Mobile apps sit in App Store and Google Play weeks after a new version releases. Users update slowly: 2 weeks post-release often finds 30-40% of users still on the previous version, and 5-10% on versions two months old. If the backend breaks API without considering old clients, those users see crashes or blank screens. API versioning isn't about RESTful perfectionism — it's commercial necessity.

Versioning Strategies: URL vs Header vs Parameter

Three common approaches, each with trade-offs:

URL versioning (/api/v1/orders, /api/v2/orders). Most obvious. Works, caches easily, visible in logs. Downside: many duplicate routes on server, temptation to copy controllers instead of abstracting changes.

Header versioning (Accept: application/vnd.myapp.v2+json). Cleaner from REST purity perspective. Harder to test (curl needs header), caches worse on CDN without Vary: Accept setup.

Parameter (/api/orders?version=2). Don't do this. Clutters URL, breaks REST semantics, parameter easy to forget.

For mobile apps we recommend URL versioning with app version in separate header:

GET /api/v2/orders
X-App-Version: 4.2.1
X-App-Platform: ios

X-App-Version doesn't drive routing but is critical for analytics: see which app versions still hit old endpoints, make deprecation decisions with data.

On the Mobile App Side

Versioning isn't only server work. Client must correctly handle different API versions during gradual migration.

Basic pattern — API Client with configurable base URL version:

// iOS — Swift
struct APIConfiguration {
    let baseURL: URL
    let version: APIVersion

    enum APIVersion: String {
        case v1, v2, v3
    }
}

class OrdersAPI {
    private let config: APIConfiguration

    func fetchOrders() async throws -> [Order] {
        let url = config.baseURL
            .appendingPathComponent(config.version.rawValue)
            .appendingPathComponent("orders")
        // ...
    }
}

This lets you switch config in one place when v3 launches, not change URLs throughout code.

Handling Changes on the Client

Most common mistake: strict JSON deserialization without optional fields. Server adds new estimatedDelivery field to /orders response — old client with strict Decodable crashes with keyNotFound. Crash on flat ground.

Correct Codable approach on iOS:

struct Order: Decodable {
    let id: String
    let status: String
    let estimatedDelivery: Date?  // Optional — doesn't crash if absent
    let legacyField: String?      // May disappear in v3 — optional
}

On Android with Gson/Moshi similarly: fields that may absent are nullable types. In Kotlin data class it's explicit: val estimatedDelivery: Date? = null.

Another pattern — Consumer-Driven Contracts via Pact: mobile app publishes contract "I expect these fields in response," CI on backend validates contract on every API change. If backend breaks a field — CI fails before change reaches production.

Deprecation Workflow

Process for retiring old API versions:

  1. Add header Deprecation: true and Sunset: Wed, 01 Jan 2026 00:00:00 GMT to old endpoint responses — RFC 8594 standard
  2. Mobile app reads this header and logs warning (or shows "update app" banner)
  3. Monitor: via X-App-Version watch if users on old app versions still hit deprecated endpoint
  4. Only when traffic to deprecated endpoint < 0.1% — turn it off

Minimum deprecation window for mobile: 3-6 months. Mobile clients don't update as fast as web.

Timeline for implementing API versioning system for existing app: 3 to 6 weeks — audit current endpoints, refactor client code, set up version monitoring. For new project — bake in from first sprint, no overhead.