HTTP status codes are standard responses returned by a server to indicate the result of a clientβs request. They help developers understand whether a request was successful, redirected, or failed.
- Status codes are grouped into five categories:Β 1xx, 2xx, 3xx, 4xx, and 5xx.
- They are essential for API testing, debugging, and error handling.
- Each code provides clear communication between the client and the server.

HTTP Status Code Categories
HTTP status codes are grouped into five categories, with each category representing a different type of response from the server.
Category | Meaning | Purpose |
|---|---|---|
1xx | Informational | Indicates that the request is being processed |
2xx | Success | Confirms that the request was successful |
3xx | Redirection | Indicates that further action is required |
4xx | Client Error | Indicates an error in the client's request |
5xx | Server Error | Indicates a problem on the server |
1xx β Informational Response
These codes indicate that the server has received the request and is continuing to process it.
Example : 100 Continue - The client can continue sending the request.
2xx β Success Response
These codes indicate that the request was successfully received and processed.
Examples:
- 200 OK - Request completed successfully.
- 201 Created - A new resource was successfully created.
- 204 No Content - Request was successful, but there is no response body.
3xx β Redirection Response
These codes indicate that the client needs to take additional action, such as using a different URL or cached resource.
Examples:
- 301 Moved Permanently - Resource has permanently moved to a new URL.
- 302 Found - Resource is temporarily available at another URL.
- 304 Not Modified - Cached resource can be used because it has not changed.
4xx β Client Error Response
These codes indicate that the request cannot be fulfilled because of an issue with the client's request.
Examples:
- 400 Bad Request β Request contains invalid data or syntax.
- 401 Unauthorised β Authentication is required or invalid.
- 403 Forbidden - Server understood the request but refuses access.
- 404 Not Found β Requested resource could not be found.
- 429 Too many Requests - Client has sent too many requests in a given period.
5xx β Server Error Response
These codes indicate that the server encountered an error while processing a valid request.
Examples:
- 500 Internal Server Error β Unexpected error occurred on the server.
- 502 Bad Gateway - Server received an invalid response from an upstream server.
- 503 Service Unavailable β Server is temporarily unavailable.
- 504 Gateway Timeout - Server did not receive a timely response from an upstream server.
Common HTTP Status Codes
APIs commonly use a set of HTTP status codes to communicate the outcome of a request. The following codes are frequently used in API development and testing.
| Status Code | Meaning | Common Use |
|---|---|---|
200 | OK | Successful GET/PUT/PATCH request |
201 | Created | Resource successfully created |
204 | No Content | Successful request with no response body |
400 | Bad Request | Invalid request data |
401 | Unauthorized | Missing or invalid authentication |
403 | Forbidden | Access is not allowed |
404 | Not Found | Resource does not exist |
409 | Conflict | Request conflicts with existing data |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Unexpected server error |