Backend DevelopmentAdvanced10 min readUpdated 2026-03-24

RESTful API Design: HTTP Verbs, Resource Naming, Status Codes, and Idempotency

Representational State Transfer (REST) is an architectural style for distributed hypermedia systems. RESTful APIs utilize standard HTTP protocol features to expose resources, manipulate entity state, and enable seamless interoperability across web and mobile clients.

Internal-Link Graph TelemetryNode: art-backend-rest
View Full Topology →
In-Degree:6 links (was 0)
Out-Degree:5 links
Click Depth:2 clicks (baseline orphan)
PageRank Est:0.52

The Six Architectural Constraints of REST

Coined by Roy Fielding in his 2000 doctoral dissertation, REST mandates six architectural constraints: Client-Server separation, Statelessness, Cacheability, Uniform Interface, Layered System, and Code-on-Demand (optional).

Statelessness ensures that every HTTP request contains all necessary credentials and context needed for the server to process it without relying on stored session affinity.

Resource-Oriented URI Design

URIs should represent nouns (resources) rather than verbs (actions). Let HTTP verbs specify the intended action instead of cluttering URIs with verbs like `/getArticle` or `/deleteUser`.

MethodURI EndpointIntended Operation
GET/articlesRetrieve a collection of articles
POST/articlesCreate a new article resource
GET/articles/101Retrieve single article by ID or slug
PUT/articles/101Completely replace article 101
PATCH/articles/101Partially update specific fields of article 101
DELETE/articles/101Remove article 101

HTTP Verbs and Idempotency Rules

An HTTP method is idempotent if making multiple identical requests has the exact same side effect on the server as making a single request.

`GET`, `HEAD`, `PUT`, and `DELETE` are idempotent. `POST` is non-idempotent because submitting it multiple times creates duplicate records.

api-response.jsonjson
{
  "status": "success",
  "data": {
    "id": "art-09",
    "title": "REST API Architecture",
    "slug": "rest-api",
    "viewCount": 1420
  },
  "links": {
    "self": "https://api.devpath.local/v1/articles/rest-api",
    "topicHub": "https://api.devpath.local/v1/topics/backend"
  }
}
Standardized REST JSON envelope pattern

Mastering HTTP Status Code Families

Leverage standard status codes so clients and caching proxies instantly understand response states:

• 200 OK: Standard success. • 201 Created: Entity successfully created via POST. • 400 Bad Request: Malformed payload or validation error. • 401 Unauthorized vs 403 Forbidden: Identity missing vs identity recognized but permission denied. • 404 Not Found: Resource does not exist. • 500 Internal Error: Unhandled server exception.

Handling Pagination, Sorting, and Filtering

Large dataset queries should always be paginated to safeguard server memory and speed up response time. Query parameters like `?page=2&limit=20&sort=-createdAt` are the recognized standard.

Architecture Continuity

Combine REST API principles with Express.js middleware to build scalable, documented endpoints.

Tags:#Backend#REST#HTTP#Architecture#APIs

Related Tutorials & Conceptual Bridges

Contextual Graph Links