HTTP Status Codes Cheatsheet
httpHTTP status codes reference for API developers.
1xx Informational
100 ContinueServer received request headers and client should proceed to send the body
Client sends: Expect: 100-continue
Server responds: HTTP/1.1 100 Continue101 Switching ProtocolsServer is switching to a different protocol as requested by the client
Upgrade: websocket
HTTP/1.1 101 Switching Protocols2xx Success
200 OKRequest succeeded and response contains the requested data
GET /api/users/123
Response: { "id": 123, "name": "John" }201 CreatedRequest succeeded and a new resource was created
POST /api/users
Response: 201 Created
Location: /api/users/456202 AcceptedRequest accepted for processing but not yet completed
POST /api/reports/generate
Response: 202 Accepted
{ "jobId": "abc123" }204 No ContentRequest succeeded but there is no content to return
DELETE /api/users/123
Response: 204 No Content206 Partial ContentServer is delivering only part of the resource due to range header
Range: bytes=0-1023
Response: 206 Partial Content
Content-Range: bytes 0-1023/50003xx Redirection
301 Moved PermanentlyResource has permanently moved to a new URL and clients should update bookmarks
GET /old-endpoint
Response: 301 Moved Permanently
Location: /api/v2/new-endpoint302 FoundResource temporarily located at a different URL
GET /api/download
Response: 302 Found
Location: https://cdn.example.com/file.zip304 Not ModifiedResource has not been modified since the last request and cached version can be used
If-None-Match: "abc123"
Response: 304 Not Modified307 Temporary RedirectTemporary redirect that preserves the HTTP method
POST /api/submit
Response: 307 Temporary Redirect
Location: /api/v2/submit308 Permanent RedirectPermanent redirect that preserves the HTTP method
POST /old-api/data
Response: 308 Permanent Redirect
Location: /new-api/data4xx Client Errors - Resource & Method Issues
404 Not FoundRequested resource does not exist on the server
GET /api/users/99999
Response: 404 Not Found
{ "error": "User not found" }405 Method Not AllowedHTTP method is not supported for the requested resource
DELETE /api/config
Response: 405 Method Not Allowed
Allow: GET, PUT408 Request TimeoutServer timed out waiting for the client request
Client connection stalled
Response: 408 Request Timeout409 ConflictRequest conflicts with the current state of the resource
PUT /api/users/123 (duplicate email)
Response: 409 Conflict
{ "error": "Email already exists" }410 GoneResource has been permanently deleted and will not be available again
GET /api/deprecated/v1/users
Response: 410 Gone
{ "error": "API v1 discontinued" }4xx Client Errors - Validation & Rate Limiting
422 Unprocessable EntityRequest syntax is correct but semantic errors prevent processing
POST /api/orders { "quantity": -5 }
Response: 422 Unprocessable Entity
{ "error": "Quantity must be positive" }429 Too Many RequestsClient has sent too many requests in a given time period
GET /api/search (rate limited)
Response: 429 Too Many Requests
Retry-After: 605xx Server Errors
500 Internal Server ErrorGeneric server error when an unexpected condition was encountered
GET /api/data (unhandled exception)
Response: 500 Internal Server Error
{ "error": "Something went wrong" }501 Not ImplementedServer does not support the functionality required to fulfill the request
PATCH /api/legacy-resource
Response: 501 Not Implemented
{ "error": "PATCH not supported" }502 Bad GatewayServer acting as gateway received an invalid response from upstream server
GET /api/external-data
Response: 502 Bad Gateway
{ "error": "Upstream service unavailable" }503 Service UnavailableServer is temporarily unable to handle requests due to maintenance or overload
GET /api/users (during deploy)
Response: 503 Service Unavailable
Retry-After: 120504 Gateway TimeoutServer acting as gateway did not receive a timely response from upstream
GET /api/slow-query
Response: 504 Gateway Timeout
{ "error": "Request timed out" }