/purchase-orders
/api-keysKebab-case is common in URLs because it is readable and avoids case-sensitivity surprises.
Naming conventions for resources, relationships, nested endpoints, and clean URL design.
Keep endpoint names predictable and uniform.
/purchase-orders
/api-keysKebab-case is common in URLs because it is readable and avoids case-sensitivity surprises.
Prefer: GET /reports/123
Avoid: GET /reports/123.jsonContent negotiation and media types are usually cleaner than path-based format suffixes.
GET /teams/{teamId}/membersA relationship collection should read clearly from left to right and preserve the domain meaning.
Better: /orders/{orderId}/items
Avoid: /customers/{customerId}/orders/{orderId}/items/{itemId}/notesDeeply nested URLs become harder to maintain, document, and cache.
/orders/{orderId}
/order-items/{itemId}Even if a resource is reachable through a nested route, it often helps to expose a canonical direct path for the item itself.
Put identity in the path and modifiers in the query string.
GET /users/123The path identifies the thing the request is about.
GET /users?role=admin&status=activeQuery parameters are a better fit for filtering, sorting, searching, pagination, and sparse fieldsets.
GET /users/123?fields=id,name,emailSparse fieldsets can reduce payload size and overfetching in large representations.
GET /orders/ord_123?include=customer,itemsOptional includes can reduce round trips while keeping the base response lightweight.