API Endpoint Naming
About
Core Principles
1. Use Nouns for Resources, Not Verbs
GET /getUserDetails
POST /createUser
DELETE /removeUser2. Use Lowercase and Hyphen-Separated Words
3. Use Plural for Collections
4. Follow Hierarchical Relationships
5. Avoid Verb Actions in Path
6. Keep Endpoints Predictable
7. Avoid Redundancy
8. Use Query Parameters for Filtering, Sorting, Pagination
9. Keep Versioning Consistent (If in URL)
10. Plan for Special Actions Carefully
Example: E-Commerce API
Last updated