Use nouns for resources, HTTP methods for actions, stable identifiers in the path, and version the URL when the contract changes.
Designing REST endpoints
Nouns, not verbs
POST /orderscreates an order.POST /createOrderis RPC pretending to be REST.Methods for actions
GET reads, POST creates, PUT replaces, PATCH updates, DELETE removes. When a route has a verb in its name, the design is fighting HTTP.
Stable identifiers in the path
/users/42, not/users/current-user-with-name-ana. The path is the address; the body is the data.Version the contract
/v1/users/42lets you break the shape without breaking clients. Silent changes to endpoints are silent outages.