liveBook · Manning

Collection name

As explained in API Design Patterns

A collection name is the identifier for a URL or API element representing multiple instances of a resource.

A collection name identifies the URL or API element representing multiple instances of a resource. Resource names are often singular, while RESTful URL collections are usually plural. section 3.3.2

Choose collection names consistently:

  • Pluralize regular names, such as Book to books. section 3.3.2
  • Use clear irregular plurals, such as feet for Foot and people for Person. section 3.3.2
  • When a name is uncertain, verify the plural and apply one consistent pattern across the API. section 3.3.2
  • Consider including the collection name in resource identifiers so the resource type is immediately recognizable. section 6.3.5

Books and collection-prefixed identifiers

A Book resource can be retrieved at GET /books/1234. The same naming pattern can identify a resource as books/abcde-12345-ghjkm-67890, making its type clear while fitting naturally into an HTTP request. section 3.3.2 section 6.3.5

How API Design Patterns covers it

How deep it goes
Explains singular-versus-plural naming, irregular plurals, consistency, and collection-prefixed identifiers without descending into implementation internals.
Examples
Uses Book, Foot, Person, and Octopus resources alongside /books/1234 and collection-prefixed identifiers.
What you can do after
Evaluate plural collection choices and design identifiers that make resource types recognizable.
How it connects
Connects resource names with pluralization, RESTful URLs, resource identification, and HTTP requests.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of API Design Patterns. The section links point to the parts of the book it draws on.