REST API Basics: Resources, Routes, and CRUD/Represent actions carefully when needed

Use an action subresource only for non-CRUD workflows.

Section: Route shape examples

Represent actions carefully when needed

text
text
POST /payments/{paymentId}/refunds
Explanation

Some domain actions are best modeled as a resource creation under the target resource instead of a verb endpoint like `/refundPayment`.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Route shape examples
Prefer nouns over verbs
Model the resource, not the action name.
OpenIn sheettextsame section
Use plural collection names
Keep collection naming consistent.
OpenIn sheettextsame section
Use stable path identifiers
Put stable IDs in the path.
OpenIn sheettextsame section
List a collection
Fetch a list of users.
OpenIn sheethttp1 tag match
Create a resource
Create a new user in the collection.
OpenIn sheethttp1 tag match
Fetch a single resource
Read one user by identifier.
OpenIn sheethttp1 tag match