Patterns and conventions
This page describes common API patterns and shared conventions used across services.
The goal is to keep APIs consistent and predictable.
CRUD resources
Section titled “CRUD resources”Use standard CRUD patterns for resource-based APIs.
Example:
GET /api/v1/usersGET /api/v1/users/{id}POST /api/v1/usersPUT /api/v1/users/{id}DELETE /api/v1/users/{id}Nested resources
Section titled “Nested resources”Nested resources should only be used for strong ownership relationships.
Example:
/users/{userId}/ordersGuidelines:
- Maximum one nesting level
- Child resources must not exist independently
Batch APIs
Section titled “Batch APIs”Batch APIs should be used only when clearly justified.
Example:
POST /api/v1/users/batchRules:
- Requests must use arrays
- Responses must use arrays
- Each item should be validated independently
Request & response conventions
Section titled “Request & response conventions”Follow these conventions:
- JSON only
camelCaseeverywhere- Explicit field names
- Prefer booleans over strings
Example:
{ "userActivated": true}General rules
Section titled “General rules”- Avoid ambiguous fields
- Avoid silent partial failures
- Keep behavior explicit