Design principles
This page describes the core design principles used when building APIs on the platform.
The goal is to ensure APIs are predictable, consistent, and easy to evolve over time.
API styles
Section titled “API styles”Two API styles are used:
- REST — user-facing or externally consumed APIs
- RPC — internal service-to-service communication
Choosing API style
Section titled “Choosing API style”| Question | If yes |
|---|---|
| Used by frontend or external consumers | REST |
| Used only by backend services | RPC |
REST fundamentals
Section titled “REST fundamentals”REST APIs should be:
- Resource-oriented
- Explicit rather than implicit
- Predictable via standard HTTP semantics
- Versioned via URL
Example:
/api/v1/users
## HTTP methods
Use HTTP methods according to intent:
- `GET` — retrieve- `POST` — create- `PUT` — update- `DELETE` — remove
## Versioning
All APIs must be versioned.
Guidelines:
- Version is included in the URL path- Start at `v1`- Breaking changes require a new version
## Security
Security must be enforced consistently:
- All APIs must be authenticated- Authorization is enforced server-side- Never rely on client-side filtering
<Aside type="danger">Filtering is not access control. Authorization must always happen on the server.</Aside>
## Consistency over perfection
Consistency across services matters more than theoretical purity.
Prefer shared patterns and conventions over clever or unique solutions.