Skip to content

Patterns and conventions

This page describes common API patterns and shared conventions used across services.

The goal is to keep APIs consistent and predictable.

Use standard CRUD patterns for resource-based APIs.

Example:

GET /api/v1/users
GET /api/v1/users/{id}
POST /api/v1/users
PUT /api/v1/users/{id}
DELETE /api/v1/users/{id}

Nested resources should only be used for strong ownership relationships.

Example:

/users/{userId}/orders

Guidelines:

  • Maximum one nesting level
  • Child resources must not exist independently

Batch APIs should be used only when clearly justified.

Example:

POST /api/v1/users/batch

Rules:

  • Requests must use arrays
  • Responses must use arrays
  • Each item should be validated independently

Follow these conventions:

  • JSON only
  • camelCase everywhere
  • Explicit field names
  • Prefer booleans over strings

Example:

{
"userActivated": true
}
  • Avoid ambiguous fields
  • Avoid silent partial failures
  • Keep behavior explicit