RESTful API Design Standards: HTTP Verbs, Status Codes & Idempotency0%

RESTful API Design Standards: HTTP Verbs, Status Codes & Idempotency

Beginner12 min read•Updated: Jul 11, 2026
Study MaterialsCheatsheet

RESTful API Design Standards: HTTP Verbs, Status Codes & Idempotency

REST (Representational State Transfer) is the dominant architectural style for designing scalable, maintainable web APIs. Following strict REST conventions ensures predictable, developer-friendly endpoints that conform to international web standards.


1. Resource-Oriented URL Naming Conventions

In REST, URLs represent resources (nouns, not actions/verbs). Use plural nouns and lowercase kebab-case:

Good RESTful Design (Nouns)Bad Anti-Pattern (Verbs in URL)Intent
GET /api/v1/usersGET /api/v1/getAllUsersFetch list of users
POST /api/v1/usersPOST /api/v1/createNewUserCreate a new user
GET /api/v1/users/42GET /api/v1/getUserById?id=42Fetch single user
PATCH /api/v1/users/42POST /api/v1/updateUserPartial update of user
DELETE /api/v1/users/42POST /api/v1/deleteUserDelete user
GET /api/v1/users/42/ordersGET /api/v1/getUserOrders?u=42Nested sub-resource

2. Standard HTTP Status Codes

Using the correct HTTP status code communicates the result unambiguously:

  • 200 OK: Standard successful GET, PUT, or PATCH.
  • 201 Created: Successful POST resulting in a newly created resource.
  • 204 No Content: Successful request with intentionally empty response body (typical for DELETE).
  • 400 Bad Request: Client sent malformed syntax or invalid input payload.
  • 401 Unauthorized: Client is unauthenticated (missing or invalid JWT token).
  • 403 Forbidden: Client is authenticated but lacks permission (e.g. non-admin accessing admin portal).
  • 404 Not Found: Requested resource or endpoint does not exist.
  • 409 Conflict: State conflict (e.g. trying to register with an email that already exists).
  • 422 Unprocessable Entity: Payload is syntactically valid JSON but violates domain rules.
  • 500 Internal Server Error: Unhandled server-side crash or database failure.

3. What is Idempotency?

An HTTP method is idempotent if making the same request multiple times produces the exact same server-side state as making it once.

MethodIdempotent?Safe (Read-Only)?Explanation
GETYesYesReading data never mutates state
HEAD / OPTIONSYesYesMetadata inspection only
PUTYesNoOverwriting an entity 10 times results in identical state
DELETEYesNoDeleting resource ID 5 multiple times leaves it deleted
POSTNoNoCalling POST /orders 5 times creates 5 separate orders
PATCHTypically NoNoIncrement operations (e.g. price += 5) produce different states

Interactive Quiz

Multiple Choice Questions

Question 1
Which of the following endpoints strictly adheres to RESTful resource-oriented naming standards?
Question 2
Which HTTP status code should be sent when a user submits a valid login token but does NOT have admin privileges to view the page?
Question 3
What does it mean for an HTTP method to be "idempotent"?
Question 4
Why is HTTP POST classified as non-idempotent?
Question 5
Why should APIs include a version prefix in their path (e.g., /api/v1/products)?

Next Lesson

MVC Architecture: Splitting Routes, Controllers & Service Layers

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

PrevNext