Atlas API Design Standards
Consistency is the feature. New and changed HTTP APIs follow these conventions.
Resources and naming
- Nouns, plural, lowercase, kebab-case:
/purchase-orders,/purchase-orders/{id}/line-items. - Use HTTP methods for verbs (GET, POST, PATCH, DELETE). No verbs in paths.
Versioning and compatibility
- Version in the path:
/v1/.... Additive changes only within a version. - Never repurpose or remove a field in a released version; add a new one and deprecate the old.
Status codes
200/201/204for success,400invalid input,401/403auth,404missing,409conflict,422semantic validation,429rate limit,5xxserver.
Pagination and filtering
- Cursor-based pagination:
?limit=+?cursor=, returnnext_cursor. Do not expose raw offsets. - Filtering and sorting via explicit query params; never accept arbitrary query expressions.
Error envelope
Return a consistent JSON error body:
{ "error": { "code": "invalid_argument", "message": "human-readable", "details": [] } }
codeis a stable machine string;messageis for humans; never leak stack traces or SQL.