Resource Naming

noun

say it: “REE-sors NAYM-ing” /ˈriːsɔːrs ˈneɪmɪŋ/

Choosing API addresses as plural nouns and ids, such as /orders/42, and letting the HTTP method say what to do.

What is Resource Naming?

Good resource naming uses plural nouns and IDs in the path, not verbs: /orders, /orders/981, /orders/981/items. The HTTP method supplies the verb.

GET    /customers/5/orders     ✓
POST   /orders                 ✓
POST   /createOrder            ✗

In a sentence

  • “Good resource naming gives POST /orders, not POST /createOrder.”
  • “The team agreed on resource naming: plural nouns, lowercase, no verbs.”

Level: Journeyman · More REST API terms at this level

Updated