REST API Status Codes
1xx Informational Responses
Status Code | Name | Description |
---|---|---|
100 | Continue | Server has received request headers, client should proceed with request body |
101 | Switching Protocols | Server is switching protocols as requested by client |
102 | Processing | Server has accepted request but processing is not complete |
103 | Early Hints | Used to return some response headers before final HTTP message |
2xx Success
Status Code | Name | Description |
---|---|---|
200 | OK | Request succeeded |
201 | Created | Request succeeded and new resource was created |
202 | Accepted | Request accepted for processing but not completed |
203 | Non-Authoritative Information | Request successful but response from third party |
204 | No Content | Request successful but no content to return |
205 | Reset Content | Request successful, reset document view |
206 | Partial Content | Server delivering only part of resource due to range header |
207 | Multi-Status | Multiple status codes for multiple operations |
208 | Already Reported | Members already enumerated in previous reply |
226 | IM Used | Server fulfilled GET request and response is instance-manipulations |
3xx Redirection
Status Code | Name | Description |
---|---|---|
300 | Multiple Choices | Multiple options for resource, client must choose |
301 | Moved Permanently | Resource permanently moved to new URL |
302 | Found | Resource temporarily moved to different URL |
303 | See Other | Response found at different URL using GET |
304 | Not Modified | Resource not modified since last request |
305 | Use Proxy | Must access resource through specified proxy |
307 | Temporary Redirect | Resource temporarily at different URL, keep same method |
308 | Permanent Redirect | Resource permanently at different URL, keep same method |
4xx Client Errors
Status Code | Name | Description |
---|---|---|
400 | Bad Request | Server cannot process request due to client error |
401 | Unauthorized | Authentication required |
402 | Payment Required | Payment required (rarely used) |
403 | Forbidden | Server understood request but refuses to authorize |
404 | Not Found | Requested resource not found |
405 | Method Not Allowed | Request method not supported for resource |
406 | Not Acceptable | Resource not available in acceptable format |
407 | Proxy Authentication Required | Client must authenticate with proxy |
408 | Request Timeout | Server timed out waiting for request |
409 | Conflict | Request conflicts with current state of resource |
410 | Gone | Resource no longer available and will not be available again |
411 | Length Required | Server requires Content-Length header |
412 | Precondition Failed | One or more request preconditions failed |
413 | Payload Too Large | Request entity larger than server limits |
414 | URI Too Long | URI provided was too long |
415 | Unsupported Media Type | Media type not supported |
416 | Range Not Satisfiable | Range specified in Range header cannot be fulfilled |
417 | Expectation Failed | Server cannot meet requirements of Expect header |
418 | I'm a teapot | Server refuses to brew coffee because it's a teapot (April Fools' RFC) |
421 | Misdirected Request | Request directed at server unable to produce response |
422 | Unprocessable Entity | Request well-formed but contains semantic errors |
423 | Locked | Resource being accessed is locked |
424 | Failed Dependency | Request failed due to failure of previous request |
425 | Too Early | Server unwilling to process request that might be replayed |
426 | Upgrade Required | Client should switch to different protocol |
428 | Precondition Required | Server requires request to be conditional |
429 | Too Many Requests | User has sent too many requests in given time |
431 | Request Header Fields Too Large | Request header fields too large |
451 | Unavailable For Legal Reasons | User agent requested resource that cannot legally be provided |
5xx Server Errors
Status Code | Name | Description |
---|---|---|
500 | Internal Server Error | Generic server error |
501 | Not Implemented | Server does not support functionality required |
502 | Bad Gateway | Invalid response from upstream server |
503 | Service Unavailable | Server currently unavailable |
504 | Gateway Timeout | Upstream server failed to respond in time |
505 | HTTP Version Not Supported | HTTP version not supported |
506 | Variant Also Negotiates | Transparent content negotiation results in circular reference |
507 | Insufficient Storage | Server unable to store representation needed |
508 | Loop Detected | Server detected infinite loop while processing request |
510 | Not Extended | Further extensions to request required |
511 | Network Authentication Required | Client needs to authenticate to gain network access |
Most Common Status Codes in REST APIs
Status Code | Usage | When to Use |
---|---|---|
200 | GET success | Successful retrieval of resource |
201 | POST success | Successful creation of new resource |
204 | DELETE/PUT success | Successful operation with no content to return |
400 | Bad request | Invalid request syntax or parameters |
401 | Unauthorized | Missing or invalid authentication |
403 | Forbidden | Valid request but access denied |
404 | Not found | Resource doesn't exist |
409 | Conflict | Request conflicts with current state (e.g., duplicate creation) |
422 | Validation error | Request syntactically correct but semantically invalid |
429 | Rate limiting | Too many requests from client |
500 | Server error | Generic server-side error |
503 | Service unavailable | Server temporarily unavailable |