API routes
Core · API routes
Core principle — Make every endpoint a small, observable protocol rather than an arbitrary function behind a URL.Stable methods, input validation, status codes, headers, errors, and cancellation.
Key concepts
Malformed JSON
400
Unauthorized
401
Forbidden
403
Boundary model
Ownership matrix
Engineering considerations
A clear HTTP contract lets clients, tests, proxies, and operators reason about behavior independently.Design constraint An API is a promise about failure as much as it is a promise about success.
Implementation notes
Decision lens
Related topics
- globe · Read HTTP semantics — Read the focused guide for this boundary.
- shield-halved · Harden boundaries — Read the focused guide for this boundary.
- chart-line · Expose signals — Read the focused guide for this boundary.

