HTTP Status Codes

Last Updated : 6 Oct, 2026

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_codes
HTTP Status Codes

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 CodeMeaningCommon Use
200OKSuccessful GET/PUT/PATCH request
201CreatedResource successfully created
204No ContentSuccessful request with no response body
400Bad RequestInvalid request data
401UnauthorizedMissing or invalid authentication
403ForbiddenAccess is not allowed
404Not FoundResource does not exist
409ConflictRequest conflicts with existing data
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server error
Comment

Explore