API design
Designing interfaces between systems that are clear and stable.
An API is a contract other code depends on, so it is hard to change once used. Good APIs have consistent naming, clear errors, sensible pagination and versioning. For developer products the API is the product.
Why it matters for a product engineer
An API is a contract that other people’s code depends on. Once it is used, every change can break someone, so the first design matters more than in most code. For a developer product the API is the product: its names, errors and limits are the user experience.
How to do it
- Start from what the caller wants to do, and model the resources they think in, not your database tables.
- Use a few standard methods on each resource (list, get, create, update, delete) and the same naming everywhere.
- Return errors that say what went wrong and how to fix it, with a stable code a program can read.
- Add pagination, rate limits and idempotency keys from the start. They are hard to add later.
- Plan for change: add fields instead of changing them, and version only when you must.
- Write the documentation and one working example before you ship, and try them as a new user.
Common mistakes
- Exposing the database schema as the API.
- A different shape for each endpoint, so callers learn every one separately.
- Errors like “Something went wrong” with no code.
- Breaking changes without warning or a migration period.
- Building features in the dashboard first and adding the API later.
Example
Zernio is an API first. “Most features we no longer build for the UI, only for the API”, Miquel Palet said, and the site states the rule: if it is not in the API, it does not ship. One posts endpoint covers every network. Analytics are stored and refreshed on Zernio’s side, so one call returns a week across all of a user’s accounts. (Zernio in In practice)
One call from a customer's product, and the events that come back
The customer's code sees one endpoint and one event shape. The differences between 25 platforms stay behind the API.
ReportedMiquel Palet on the Itnig podcast, and zernio.com, read 15 Nov 2026
In practice
Real productsResources
1- docsGo deeper
AIP-121: resource-oriented design ↗
Google API Improvement Proposals · 7 minHow Google designs APIs around resources and a few standard methods, and why not to mirror your database.