Home / Blog / App Development

    API Design Best Practices for Web and Mobile Apps

    By Softworth Solutions · · 4 min read · For readers in India, UAE, US, UK

    Source code on a laptop screen while a developer works

    In short: A good API for web and mobile apps is predictable, hard to misuse and able to change without breaking clients you do not control. That means consistent naming, a clear versioning policy, cursor pagination, one error format, proper OAuth, idempotent writes and responses shaped around real screens.

    Mobile raises the stakes. Old app versions stay installed for months, and you cannot force everyone to update. A careless API change that a web app shrugs off can break thousands of phones overnight.

    Why design from screens, not the database?

    Exposing tables as endpoints is the most common mistake we see. Clients end up making many calls per screen, logic leaks into every app, and every schema change becomes a breaking change. List the main screens and journeys first, then design resources around them.

    Write the contract before the code, ideally in the OpenAPI Specification, and review it with your web and mobile developers. Mock servers generated from the spec let frontend work start in parallel.

    Which REST conventions age well?

    • Plural nouns and IDs, such as /orders/{id}; use HTTP methods rather than verbs in paths.
    • Clear sub-resources for real actions, such as POST /orders/{id}/cancel.
    • One field naming style everywhere, and ISO 8601 timestamps in UTC.
    • Money as integer minor units or decimal strings with a currency code, never floats.
    • Correct status codes, including 409 for conflicts and 429 for rate limits.

    GraphQL suits products with many clients needing very different data shapes, and gRPC suits internal services. For most business apps, well-designed REST is the simplest thing that works.

    How should you version an API?

    Prefer additive change. Adding optional fields and endpoints is safe if clients ignore what they do not recognise; renaming, removing or changing meaning is breaking. When a break is unavoidable, add a new version, usually in the path as /v2/, publish a deprecation policy and track which app versions call which API. Build a minimum-supported-version check into the mobile app so you can prompt updates.

    An illustrative example

    Consider a grocery delivery start-up in Bengaluru that renames a price field from 'amount' to 'price' in a routine backend release. The web app is updated the same day. But a third of Android users are on an app version from four months ago, and their baskets suddenly show zero totals. Support tickets pile up. The fix is simple in hindsight: add the new field alongside the old one, track version usage, and remove 'amount' only when old installs fade away.

    How should you handle pagination, errors and retries?

    Paginate every list that can grow, from day one. Use one error format everywhere; RFC 9457 Problem Details is a sensible default, plus a machine-readable code and a request ID for support. And because mobile networks drop mid-request, accept an Idempotency-Key header on payments and orders so retries never create duplicates.

    Cursor vs offset pagination
    CursorOffset
    How it worksServer returns an opaque next cursorClient asks for page or offset number
    Changing dataNo skipped or repeated itemsCan skip or duplicate on inserts
    Performance at scaleStays fastSlows as offsets grow
    Best forFeeds, infinite scroll, large tablesSmall admin lists with page numbers

    What does secure API authentication look like?

    Use OAuth 2.0 and OpenID Connect through an established identity provider, with the authorisation code flow and PKCE for mobile and single-page apps. Never ship secret keys in an app binary, because they can be extracted. Most importantly, authorise every request for the specific object, not just the user. Our mobile app security checklist covers the client side.

    Source code on a laptop screen while a developer works

    What changes by market?

    In India, many users are on mid-range Android phones and variable mobile data, so payload size and round trips matter a lot; compression, ETags and screen-shaped endpoints pay off. For UAE apps, especially in government and finance, ask early whether data must be hosted in-country, since that shapes region choice and latency. US and UK enterprise buyers increasingly ask for documented APIs, OpenAPI specs and security test results during procurement.

    Key facts

    • RFC 9457, published in 2023, defines the Problem Details format for HTTP API errors and replaces RFC 7807. (RFC Editor)
    • The OWASP API Security Top 10 (2023) ranks Broken Object Level Authorization as the top API risk. (OWASP)
    • PKCE, defined in RFC 7636, protects the OAuth authorisation code flow for public clients such as mobile apps. (RFC Editor)

    Key takeaways

    • Design around screens and write the OpenAPI contract first.
    • Change additively and track app versions before removing anything.
    • Use cursor pagination, one error format and idempotency keys.
    • Authorise every object on the server, never trust the client.

    If you are planning a new product or untangling an API that grew organically, Softworth Solutions (SWS AI) designs and builds APIs for web, mobile and Microsoft Teams apps. See our app development services.

    Frequently asked questions

    Should we use REST or GraphQL for a mobile app?

    For most business apps, REST is simpler to build, cache and secure if endpoints match screens. Consider GraphQL when many clients need very different data shapes or over-fetching is a measured problem.

    How long should we support old API versions?

    Until most active installs have moved, which for mobile is often six to twelve months. Monitor version usage, publish deprecation dates and use an in-app minimum-version check.

    Do apps for UAE government clients need local hosting?

    Often, yes, particularly for government and regulated sectors, but requirements vary by entity and free zone. Confirm hosting and data rules with the client and legal counsel before choosing a cloud region.


    Planning an AI or software project? Talk to our team for a free consultation and an honest estimate.

    Previous: Measuring Microsoft 365 Copilot ROI: Usage, Adoption and Value
    Next: Computer-Use and Browser Agents: Automating Work in Legacy Software

    Keep reading