HTTP Status Codes

Complete reference of HTTP status codes

HTTP status codes are three-digit numbers returned by servers to indicate the result of a client request. They are divided into five categories: informational (1xx), successful (2xx), redirect (3xx), client error (4xx), and server error (5xx). Every developer encounters status codes daily when building or consuming APIs, and knowing what each code means is essential for effective debugging and error handling.

Browse our complete reference of HTTP status codes below. Each code links to a detailed page with causes, code examples in multiple languages (curl, fetch, Axios, Python), and recommended solutions. Use the search bar to find a specific code by number or name, or filter by category to explore related status codes.

HTTP status codes: read the category first

Status codes are grouped into five classes: informational, success, redirection, client error, and server error. Knowing the class usually tells you where to look before you memorize every individual number.

A code describes the outcome of a request, not the health of the whole system. Combine it with response time and body content before deciding what happened.

How it works

The five classes

1xx means the request was received and processing continues. 2xx means the request succeeded. 3xx means the client must take another step, usually following a redirect. 4xx means the client sent something the server could not accept. 5xx means the server failed while trying to respond.

When a request fails, start with the class. A 4xx usually points at the request shape, credentials, or route. A 5xx points at server-side code, dependencies, or infrastructure.

Codes that cause confusion

401 means authentication is missing or invalid; 403 means the identity is known but not allowed. 404 hides whether a resource exists, which is sometimes intentional. 409 signals a conflict such as a duplicate resource. 429 means rate limiting; respect Retry-After instead of retrying immediately. 502 and 504 often indicate a proxy or gateway problem upstream of the application.

304 is not an error. It tells the client that its cached copy is still valid and no body is needed. Treating it as a failure can break cache behavior.

Use cases

  • Client debugging: Identify whether a failing request needs different headers, parameters, or permissions.
  • API design review: Choose codes that describe the outcome consistently across endpoints.
  • Incident triage: Separate upstream gateway failures from application errors.

Worked examples

A rate-limited response

Wait for the indicated interval and use exponential backoff rather than hammering the endpoint.

HTTP/1.1 429 Too Many Requests
Retry-After: 30
{"error":"rate_limited"}

A redirect with no body

Test the Location target directly when measuring the real resource.

HTTP/1.1 302 Found
Location: /v2/orders/123

Frequently asked questions

Is 200 always a success?

It means the request completed as expected at the HTTP layer. The body may still describe a business-level failure, so check the payload.

What is the difference between 401 and 403?

401 means authentication is missing or invalid. 403 means the server understood who you are but refuses access.

Should clients retry 5xx responses?

Sometimes, with backoff and a capped retry count. Never retry non-idempotent writes blindly.

Why does my API return 204?

204 means the action succeeded but there is no body to send, common for deletes.

Want to go deeper? Browse the API performance guides or open the documentation.