2xx Codes
Code Meaning Typical Use
200 OK Request successful GET, PUT, PATCH, DELETE
201 Created Resource created POST
202 Accepted Accepted for processing (async) POST, PUT
204 No Content Success, no response body DELETE, PUT
GET /orders/123 → 200 OK
POST /orders → 201 Created
DELETE /orders/123 → 204 No Content
3xx Code
301 Moved Permanently Permanent redirect URL changes
302 Found Temporary redirect Short-term routing
304 Not Modified Cached response still valid GET with caching
4xx
Code Meaning Typical Scenario
400 Bad Request Invalid request format JSON validation fails
401 Unauthorized Not authenticated Missing/invalid token
403 Forbidden Not allowed Role-based access
404 Not Found Resource not found Wrong ID
405 Method Not Allowed Verb not supported POST on read-only endpoint
429 Too Many Requests
Rate limit exceeded
API throttling
5xx
500 Internal Server Error Generic server failure Unhandled exception
502 Bad Gateway Invalid upstream response API Gateway issue
503 Service Unavailable Service down Maintenance
504 Gateway Timeout Upstream timeout Slow dependency
Code and Verbs
HTTP status codes are independent of HTTP verbs, but REST conventions define how they should be used together.
304 code
“The resource hasn’t changed since the last time you fetched it—use your cached copy.”
Client already has a cached response
Client asks: “Has this changed?”
Server says: “No” (304)
No response body is sent