← Lessons

quiz vs the machine

Silver1050

System Design

RESTful Resource Modeling

Designing URLs around nouns instead of verbs.

4 min read · intro · beat Silver to climb

Resources Are Nouns

A REST API exposes resources, the things your system manages such as orders, users, or invoices. Each resource gets a stable identifier, a URL like slash orders slash 42. You act on resources with the standard HTTP methods rather than inventing custom verbs in the path.

Mapping Methods to Actions

  • GET reads a resource or a collection.
  • POST creates a new resource inside a collection.
  • PUT replaces a resource and PATCH updates part of it.
  • DELETE removes a resource.

Good and Bad Shapes

Prefer plural collection names and nest only to show ownership, such as slash users slash 7 slash orders. Avoid verbs in paths like slash createOrder; the verb belongs in the HTTP method, not the URL. Keep identifiers stable so clients can bookmark and cache them.

Key idea

Model the API as nouns with stable URLs and let HTTP methods carry the verbs, so the interface stays uniform and predictable.

Check yourself

Answer to earn rating on the learn ladder.

1. Which URL best follows RESTful resource modeling?

2. Which method should create a new resource in a collection?