Skip to content

APIs guide

REST API Design Checklist

A REST API is easier to use when its behaviour is predictable. Consumers should be able to guess the shape of a response, understand an error and know what changed between versions. This checklist covers the decisions that matter most.

Guide details

7 minute read
Updated 13 November 2026

This guide is general technical information. It is not a guarantee of a particular result on your hosting, data or project.

Discuss your project

Resources and naming

Name resources with nouns, not verbs. Use plural collection names and stable identifiers. Relationships can be nested when the child only makes sense within the parent, but deep nesting makes routes brittle and permissions harder to reason about.

Keep the response shape consistent. If a collection returns an object with data and pagination metadata, every collection should follow the same pattern. Consistency is more valuable than a clever one-off.

  • Nouns for resources, HTTP methods for actions
  • Stable identifiers and consistent casing
  • Nesting only where the relationship requires it
  • Consistent collection and error envelopes

Methods, status codes and validation

Use GET for reads, POST for creation, PATCH or PUT for updates and DELETE for removal. Return the status code that describes what happened: 201 for creation, 204 for an empty success, 400 for invalid input, 401 for missing authentication, 403 for insufficient permission and 404 for a missing resource.

Validate every input at the server, including fields the UI does not expose. Validation errors should identify the field and explain what is wrong. Do not rely on the client to enforce business rules.

  • Correct method and status code for each operation
  • Server-side validation for all input
  • Field-level validation messages
  • No sensitive data in URLs or logs

Authentication, authorization and errors

Authentication establishes who is calling; authorization decides what they may do. Enforce both on the server for every request. Scope tokens to the smallest set of permissions and make rotation possible without breaking every client.

Errors should be machine-readable and human-useful. Include a stable code, a message and, where appropriate, field details. Avoid leaking stack traces, SQL errors or internal identifiers in production.

  • Server-side authorization on every route
  • Scoped credentials and rotation plan
  • Stable error codes with useful messages
  • No internal details leaked in production

Versioning, documentation and limits

Version the API when a change cannot be made safely in place. Announce deprecations with a migration path instead of switching behaviour silently. Document the resources, authentication, request fields, responses and error codes.

Add rate limits where abuse or accidental load is possible. Log requests with enough context to debug them, but keep secrets and personal data out of the logs.

  • A versioning and deprecation policy
  • Endpoint reference kept current
  • Rate limits and abuse protection where needed
  • Structured logs without secrets

Key takeaways

  • Predictability beats cleverness in an API contract.
  • Validate and authorize on the server, every time.
  • Use consistent error shapes and status codes.
  • Version breaking changes and document the migration path.

Need help

Related services.

Questions

About this guide.

Should an API return JSON only?

JSON is the default for most web and mobile clients. Other formats can be supported when a consumer needs them, but the primary contract should stay consistent.

How many status codes should an API use?

Use the ones that describe the outcome accurately. A small, consistent set is easier to document and consume than a different code for every edge case.

When should an API be versioned?

When a change would break existing consumers and cannot be made backward-compatible. Additive changes can often ship without a new version; removals and shape changes usually cannot.

Next step

Tell me what you are building, and what is getting in the way.

A short brief is enough to start. You will get clear questions, a practical scope and an honest answer about fit.

A small note about cookies

Essential storage keeps preferences and security working. Analytics stays off unless you allow it and a measurement ID has been configured. Read the cookie policy.