REST API Basics: Naming Conventions
Designing a REST API is not just about methods and status codes, naming your resources correctly is just as important. Good naming conventions make your API predictable, easier to use, and more intuitive for clients.
Here are some basic rules to follow when naming REST API endpoints:
✅ Use Nouns, Not Verbs
Endpoints should represent resources, not actions.
✅
/users✅
/orders/123❌
/getUsers❌
/createOrder
The HTTP method (GET, POST, PUT, DELETE) already tells what action is being performed, so avoid putting verbs in your path.
✅ Use Plural Nouns
Always use plural nouns for collections.
✅
/products(collection)✅
/products/42(single resource)❌
/product
✅ Use Hierarchy to Show Relationships
Use path hierarchy to represent relationships between resources.
✅
/users/123/orders→ all orders for user 123✅
/users/123/orders/456→ a specific order for user 123
✅ Use Lowercase and Hyphens
Stick to lowercase letters and separate words with hyphens.
✅
/user-profiles/123❌
/UserProfiles/123❌
/user_profiles/123
✅ Avoid Deep Nesting
Don’t go too deep into resource paths, it makes APIs harder to manage.
✅
/users/123/orders❌
/users/123/orders/456/items/789/details
If you need that level of detail, consider using query parameters.
✅ Use Consistent Patterns
Keep your style consistent across all endpoints. For example:
Always use
/resources/{id}for single items.Always use
/resourcesfor collections.
📌 Final Thoughts
Following simple naming conventions makes your REST APIs much easier to understand and maintain. Predictability means developers can guess your endpoints without needing to check documentation every time.
If you want to go deeper into REST design, check out these related articles:
👉 Don’t forget to follow the blog for more articles on Java and backend development.





Great post, Thiago.
Do you consider it a good practice to use static analysis tools to enforce the mentioned patterns in microservices, or is this better suited for evaluation during Code Reviews?