Overview
Good APIs are predictable: consistent naming, honest status codes, and a versioning strategy that respects clients.
Naming
routes
GET /v1/leads
POST /v1/leads
GET /v1/leads/:id
DELETE /v1/leads/:idErrors
error shape
{ "error": { "code": "invalid_email", "message": "Email is required" } }Versioning
Version in the path (/v1). Avoid breaking changes; add fields, deprecate old ones with a sunset header.