Bruno Pedro
API naming conventions
Why are naming conventions important in API Design?
By using naming conventions you’re making your API consistent with the industry standards. API consumers will find it easier to understand your API. Developers will find it easier to implement and maintain your API. Most tooling will work better when naming conventions are used.
Here are some examples of naming conventions across different types of APIs:
- Plural nouns to represent REST resources, e.g.,
/articles
. - Use of HTTP verbs to access REST endpoints, e.g.,
POST /articles
. - Singular nouns to represent data types in GraphQL, e.g.,
Article
. - Use of verbs for GraphQL mutations, e.g.,
CreateArticle
. - Using the word “service” to identify gRPC services, e.g.,
ArticleService
. - Verb-noun structure to define event names in asynchronous APIs, e.g.,
ArticleCreated
.