← All posts

Designing an API for a mobile app backend

Practical API design for mobile apps: shaping endpoints around screens, versioning for app releases you cannot recall, pagination, errors, authentication, uploads and performance on slow networks.

Author
Elie Chaaban
Published
Reading time
5 min
Topics
Architecture, Mobile Apps, Backend, React Native

A mobile app is only as good as the API behind it. Slow screens, confusing errors, broken older versions after a backend release and battery-draining sync are usually API problems, not app problems. And unlike a website, a mobile app cannot be updated instantly for everyone: users keep old versions for months.

That changes how the backend should be designed. This post covers the practices I use for mobile backends, such as the .NET Core API behind the NeonTask technician app and web app, and the Next.js backend behind Pro Clean+.

Design for screens and tasks, not tables

The most common mistake is an API that mirrors the database: one endpoint per table, leaving the app to assemble each screen from many requests. On a mobile network, every request costs time.

Instead, design around what the app needs:

Explicit actions also make business rules easier to enforce on the server: who can do what, in which state, and what happens as a result.

Versioning: old apps never disappear

When you release a new web app, everyone gets it at once. When you release a new mobile app, some users update immediately, some weeks later and some never. Your backend must serve them all.

Rules that keep this manageable:

Test new backend releases against the current and previous app versions on staging. See why you need a staging environment.

Pagination and filtering

Every list endpoint should be paginated from day one, even if lists are short at launch. Cursor-based pagination, using "give me items after this one", behaves better than page numbers when new items arrive while the user is scrolling.

Filtering and sorting should happen on the server, with indexes in the database to support them. See how far a single server can take your product for why this matters for performance.

Errors the app can act on

An error response should tell the app what happened in a way it can handle:

The app should never have to parse an English sentence to decide what to do. And for bilingual apps, messages should respect the user's language. See bilingual Arabic and English apps.

Authentication

For most business apps:

More on this in web app security basics.

Uploads

Photos are central to many apps: technicians documenting jobs, customers sending photos for a quote, as in Pro Clean+'s photo-based quotes. Uploading them well:

Slow and unreliable networks

Design for the network your users actually have:

Timestamps and time zones

Store and send timestamps in UTC with an explicit offset format, and convert to local time in the app. Bookings and appointments also need the business's time zone stored with them, so a slot at 10:00 means 10:00 where the service happens, even if the user's phone is set differently. This matters as soon as you serve customers in more than one country.

Documentation and contracts

Describe the API in a machine-readable format such as OpenAPI. It serves as documentation, lets you generate typed clients for the app, and makes changes visible in code review. A typed client turns many backend changes that would break the app into compile errors instead of crashes.

Observability

Log every request with its endpoint, status, duration, app version and a request ID that the app can show in error screens. When a user reports a problem, that ID leads straight to what happened. Track error rates and slow endpoints, and alert on them. See monitoring and alerts for a small product.

One API, several clients

Most products end up with several clients: the customer app, a staff app, a web admin. NeonTask has a web app for dispatchers and admins and a technician app, both served by one API. Share the core business logic in one backend, and shape endpoints for each client where their needs differ, rather than duplicating rules in each app.

Common mistakes

Summary

Design the API around screens and actions, treat every released app version as a client you must support, keep responses small, make retries safe, and document the contract. These habits cost little at the start and save a great deal once the app is in users' hands.

If you are planning a mobile app or reworking its backend, see my work and get in touch.

More from the blog

Let's work
together