I have spent most of my career on the consuming side of APIs, building the interfaces that call them. That is a good seat for learning what makes an API pleasant or painful. This is the checklist I use when I design one myself.

Name resources, not actions

URLs identify things. HTTP methods say what to do with them.

GET    /orders            list
POST   /orders            create
GET    /orders/42         read one
PATCH  /orders/42         change some fields
DELETE /orders/42         remove
GET    /orders/42/items   items of one order

Use plural nouns and keep nesting to one level. When something truly is an action, such as cancelling an order, model it as a sub-resource: POST /orders/42/cancellation.

Use status codes for what they mean

The client should know what happened from the status line alone.

  • 200 success with a body, 201 created (with a Location header), 204 success with no body
  • 400 the request is malformed, 422 it is well-formed but fails validation
  • 401 not authenticated, 403 authenticated but not allowed
  • 404 no such resource, 409 conflicts with current state
  • 429 too many requests, with a Retry-After header
  • 500 the server failed; never use it for a client mistake

Returning 200 with { "success": false } forces every client to parse the body before knowing whether to show an error.

One error format everywhere

Pick a shape and never deviate. The standard one is Problem Details (RFC 9457), served as application/problem+json:

{
  "type": "https://api.example.com/problems/validation",
  "title": "The order could not be saved",
  "status": 422,
  "errors": [
    { "field": "items[0].qty", "message": "Must be at least 1" }
  ]
}

Field-level errors let a form mark the exact input that needs fixing. Messages should be safe to show to a user; stack traces and SQL belong in the logs, linked by a request ID the response includes.

Paginate from day one

Any list will grow. Adding pagination later breaks every client.

Offset pagination (?page=3&limit=20) is simple but slows down on deep pages and skips or repeats rows when data changes during browsing. Cursor pagination avoids both:

GET /orders?limit=20&after=eyJpZCI6NDJ9

{
  "data": [ ... ],
  "next": "eyJpZCI6NjJ9"
}

The cursor is an opaque token that encodes the last row seen. The client passes it back and never needs to know what is inside.

Filtering, sorting and field selection

Use query parameters with obvious names: ?status=paid&sort=-created_at. A leading minus for descending order is a common convention. Reject unknown parameters with a 400 so a typo does not silently return unfiltered data.

Version before you need to

Put the version in the path (/v1/orders). It is visible, cacheable and easy to route. Within a version, only make additive changes: new optional fields and new endpoints. Removing or renaming a field is a new version.

The rest of the list

  • Dates in ISO 8601 with a timezone, always UTC: 2026-11-18T14:30:00Z.
  • Money as integer minor units plus a currency code, never floats.
  • Idempotency keys on POST requests that create or charge, so a retry does not duplicate.
  • Consistent casing for JSON keys across the whole API.
  • An OpenAPI document generated from the code, so docs and client types cannot drift from the implementation.

None of this is novel. An API feels good to use when it is predictable, and predictability comes from making these decisions once and applying them without exceptions.