Card 04/ 07

ConceptDifficulty: Intermediate2 min

An API Design Review Checklist

Twelve questions, each from an earlier topic, that catch most design problems before a client depends on them.

A design review checks a proposed API against the rules of every earlier topic before any client depends on it. A checklist makes the review repeatable: twelve questions, grouped by the decisions they cover, each with what a failing answer looks like. A design that passes all twelve can still be wrong for its domain, but it will not fail in the ways most APIs do.

The twelve review questions, and what a failing answer looks like
GroupQuestionA failing answer
PathsAre paths nouns, plural and consistent?POST /createOrder, /getUser
MethodsDoes each method match its semantics?POST for a read, GET that changes data
MethodsAre retried writes safe?POST payment with no Idempotency-Key
Status codesDoes each response use the code that fits?200 with an error in the body
ErrorsIs every error problem details, with a type a client can act on?Plain strings, or a stack trace
CollectionsIs every list paginated, with a maximum page size?GET /orders returning every order
CachingDo responses say how long they may be cached, and by whom?Private data with no Cache-Control
ConcurrencyCan two updates overwrite each other?PUT with no ETag or If-Match
SecurityIs every object checked against the caller?A userId taken from the query
SecurityAre input fields and response fields allow-listed?The stored record bound in and returned whole
ContractIs there an OpenAPI document with examples?Behaviour known only from the code
EvolutionIs every change additive, or planned with a version and sunset date?A renamed field in place

How to use it. Review the contract, not the code, so problems are found before they are built. Ask each question of every operation, and record each failure with the evidence and the fix.

What it does not catch. Whether the resources match how the domain works, whether the names mean what the business means, and whether a task needs too many calls. Those need someone who knows the domain reading the contract against real tasks.

Automate what you can. A linter for OpenAPI documents, such as Spectral, can check paths, methods, error schemas and pagination on every change. People can then spend the review on what a linter cannot judge.

So review every API against the same twelve questions, before a client is built against it.