Quick reference guide for HTTP status codes and common error messages
| Code | Name | Description |
|---|---|---|
| 100 | Continue | The client should continue with its request |
| 101 | Switching Protocols | Server is switching protocols as requested by the client |
| Code | Name | Description |
|---|---|---|
| 200 | OK | The request was successful |
| 201 | Created | A new resource was successfully created |
| 202 | Accepted | The request has been accepted for processing |
| 204 | No Content | The server successfully processed the request with no content to return |
| Code | Name | Description |
|---|---|---|
| 301 | Moved Permanently | The resource has been permanently moved to a new URL |
| 302 | Found | The resource temporarily resides at a different URL |
| 304 | Not Modified | The resource has not been modified since last requested |
| Code | Name | Description |
|---|---|---|
| 400 | Bad Request | The server cannot process the request due to client error |
| 401 | Unauthorized | Authentication is required and has failed or not been provided |
| 403 | Forbidden | The server understood the request but refuses to authorize it |
| 404 | Not Found | The requested resource could not be found |
| 405 | Method Not Allowed | The request method is not supported for this resource |
| 408 | Request Timeout | The server timed out waiting for the request |
| 409 | Conflict | The request conflicts with the current state of the server |
| 422 | Unprocessable Entity | The request was well-formed but contains semantic errors |
| 429 | Too Many Requests | The user has sent too many requests in a given time |
| Code | Name | Description |
|---|---|---|
| 500 | Internal Server Error | A generic error occurred on the server |
| 501 | Not Implemented | The server does not support the functionality required |
| 502 | Bad Gateway | The server received an invalid response from an upstream server |
| 503 | Service Unavailable | The server is temporarily unable to handle the request |
| 504 | Gateway Timeout | The server did not receive a timely response from an upstream server |
| Error Name | Description |
|---|---|
| Connection Timeout | Unable to establish database connection within timeout period |
| Duplicate Key | Attempt to insert a record with a duplicate primary key |
| Foreign Key Constraint | Operation violates a foreign key constraint |
| Deadlock | Two or more transactions waiting for each other to release locks |
| Error Name | Description |
|---|---|
| Connection Refused | Target server is not accepting connections |
| DNS Resolution Failed | Unable to resolve hostname to IP address |
| Network Timeout | Network operation exceeded timeout period |
| SSL/TLS Handshake Failed | Failed to establish secure connection |
| Error Name | Description |
|---|---|
| Invalid Credentials | Username or password is incorrect |
| Token Expired | Authentication token has expired and needs renewal |
| Insufficient Permissions | User lacks necessary permissions for the operation |
| Account Locked | Account has been locked due to security policy |
| Error Name | Description |
|---|---|
| Required Field Missing | A required field was not provided |
| Invalid Format | Data does not match expected format |
| Value Out of Range | Numeric value exceeds allowed range |
| Invalid Type | Data type does not match expected type |
Good Error Response:
{
"error": {
"code": "INVALID_INPUT",
"message": "Email is required",
"field": "email",
"status": 400
}
}
Include: Error code, clear message, affected field (if applicable), HTTP status code, and optionally a documentation link.