Member-only story
10 Best Practices for Naming REST API Endpoints
Avoid special characters, use lowercase names, and more

Web developers are no strangers to APIs — especially HTTP methods like GET and POST. When it comes to designing APIs, backend engineers or API engineers are familiar with them as well. That means REST is a term that is familiar. It is said that REST is an architecture and not a standard. It was developed alongside HTTP and is most commonly used over HTTP. HTTP is a standard, whereas REST is an architecture. REST is an architectural style that provides constraints that guide API design.
REST APIs are a powerful tool that is widely used by systems to communicate and exchange information according to the Representational State Transfer (REST) architectural pattern. Be it by websites, mobile applications, or enterprise integrations, they are widely used. REST has much more flexibility compared to the previous generation of web services, namely SOAP.
However, in this article, we are going to talk about REST or RESTful only.
While REST APIs are extremely useful, creating them can be a time-consuming process. If you are building your own REST or RESTful API, you should know that there are best practices to follow. This includes the naming of your REST API endpoints.
There are basically ten guidelines that you can follow to make your API endpoints better:
- Use nouns.
- Use intuitive, clear names.
- Use lowercase letters.
- Avoid special characters.
- Use forward slash (
/
). - Separate words with hyphens.
- Don’t use file extension.
- Use camelCase for parameters.
- Use API versioning.
- Consistency.
They do seem very simple to follow, but they are what can make your endpoints look better. So, let’s get started!
1. Use Nouns
When naming your URIs, it is advised to use nouns instead of verbs or adjectives. HTTP methods are technically verbs, hence GET, POST, DELETE, etc. Also, the names represent the contents of a resource or the resources…