
Should REST API Resource Names Be Plural or Singular?
TL;DR REST API resource names should be plural. Use /pets/{id} not /pet/{id} . Plural names consistently represent collections, align with HTTP semantics, and match how developers think about resources. Modern PetstoreAPI uses plural names throughout its API, following industry best practices. Try Apidog today Introduction When designing a REST API, you’ll face the question: should your endpoint be /user/123 or /users/123 ? This is a common debate among developers. The answer: use plural. But understanding the reasoning is crucial. Plural resource names fit REST’s collection model, HTTP semantics, and developer expectations. The old Swagger Petstore used /pet/{id} —an inconsistency that spread the wrong convention. Modern PetstoreAPI fixes this by consistently using plural resource names. 💡 Tip: If you’re building or testing REST APIs, Apidog helps you validate resource naming, test endpoint consistency, and ensure your API follows REST best practices. Import OpenAPI specs, check namin
Continue reading on Dev.to
Opens in a new tab


