Visual API cheat sheet

HTTP Status Code Cheat Sheet

Learn API response codes with examples, tester notes, common mistakes, and interview-friendly explanations.

For DevelopersFor TestersFor StudentsREST API Friendly
request.http
GET /api/users/123
— — —
Status: 200 OK
Response received successfully
{
  "id": 123,
  "name": "Ada Lovelace",
  "role": "engineer"
}
Explore

Search every status code

Search by code, name, or keyword. Filter by category to focus on what matters.

100

Continue

1xx Informational

The server has received request headers and the client should proceed to send the body.

Click for details
101

Switching Protocols

1xx Informational

The server agrees to switch protocols as requested by the client.

Click for details
200

OK

2xx Success

The request succeeded and the response contains the requested resource.

Click for details
201

Created

2xx Success

The request was successful and a new resource was created.

Click for details
202

Accepted

2xx Success

The request was accepted for processing but has not completed yet.

Click for details
204

No Content

2xx Success

The request succeeded and there is no content to return.

Click for details
301

Moved Permanently

3xx Redirection

The resource has been permanently moved to a new URL.

Click for details
302

Found

3xx Redirection

The resource is temporarily located at a different URL.

Click for details
304

Not Modified

3xx Redirection

Cached version is still valid — no body is returned.

Click for details
400

Bad Request

4xx Client Error

The server cannot process the request due to malformed syntax or invalid input.

Click for details
401

Unauthorized

4xx Client Error

Authentication is required and has failed or has not been provided.

Click for details
403

Forbidden

4xx Client Error

The user is authenticated but does not have permission to access the resource.

Click for details
404

Not Found

4xx Client Error

The requested resource does not exist on the server.

Click for details
405

Method Not Allowed

4xx Client Error

The HTTP method is not supported for this resource.

Click for details
408

Request Timeout

4xx Client Error

The client did not send a complete request in the time the server was prepared to wait.

Click for details
409

Conflict

4xx Client Error

The request conflicts with the current state of the resource.

Click for details
415

Unsupported Media Type

4xx Client Error

The request payload format is not supported by the server.

Click for details
422

Unprocessable Content

4xx Client Error

The request was well-formed but contains semantic validation errors.

Click for details
429

Too Many Requests

4xx Client Error

The client has sent too many requests in a given amount of time.

Click for details
500

Internal Server Error

5xx Server Error

The server encountered an unexpected condition that prevented it from fulfilling the request.

Click for details
501

Not Implemented

5xx Server Error

The server does not support the functionality required to fulfill the request.

Click for details
502

Bad Gateway

5xx Server Error

The server, acting as a gateway or proxy, received an invalid response from upstream.

Click for details
503

Service Unavailable

5xx Server Error

The server is temporarily unable to handle the request, often due to overload or maintenance.

Click for details
504

Gateway Timeout

5xx Server Error

The gateway did not receive a timely response from the upstream server.

Click for details
Compare

Common Confusions Explained

Side-by-side breakdowns of the status codes developers most often mix up.

200 OK vs 201 Created

200 OK

The request succeeded. Use for successful GET, PUT, PATCH responses with a body.

201 Created

The request succeeded and a new resource was created. Use for successful POST that creates a resource.

401 Unauthorized vs 403 Forbidden

401 Unauthorized

The request lacks valid authentication. Token missing, expired, or invalid.

403 Forbidden

Authentication worked but the user is not allowed to access this resource.

400 Bad Request vs 422 Unprocessable

400 Bad Request

Malformed request — bad JSON, missing required fields, wrong types.

422 Unprocessable Content

Well-formed request but semantic validation failed, e.g. invalid email format.

404 Not Found vs 410 Gone

404 Not Found

Resource does not exist or never did. Default for missing items.

410 Gone

Resource used to exist but has been intentionally removed and will not return.

500 Internal Server Error vs 503 Service Unavailable

500 Internal Server Error

Unexpected server-side failure. Indicates a bug or unhandled exception.

503 Service Unavailable

Server is temporarily unable to respond — overload, maintenance, or upstream outage.

For Testers

What Should You Validate?

Real API scenarios mapped to the status codes you should assert against.

Login API

  • 200Successful login with valid credentials
  • 400Missing required fields
  • 401Invalid credentials
  • 429Too many login attempts
  • 500Unexpected server failure

Create User API

  • 201User created successfully
  • 400Invalid payload
  • 409Duplicate email or username
  • 422Validation errors
  • 500Server failure

File Upload API

  • 200Successful upload (returning body)
  • 201Successful upload — new file resource
  • 400Missing file
  • 415Unsupported file type
  • 500Server failure

Payment API

  • 200Payment successful
  • 400Invalid request
  • 402Payment required or failed payment
  • 409Duplicate transaction
  • 500Payment gateway / server issue
Quiz

Test Your Status Code Knowledge

Five quick multiple-choice questions. Pick an answer and see instant feedback.

1

Which status code should be returned when a resource is successfully created?

2

Which status code means authentication is missing or invalid?

3

Which status code means the user is authenticated but not allowed?

4

Which status code is commonly used for rate limiting?

5

Which status code means the server is temporarily unavailable?

Answered 0 / 5
Interview Prep

HTTP Status Codes Interview Questions

Common interview questions on REST and HTTP — with crisp, interview-ready answers.

200 OK means the request succeeded. 201 Created means the request succeeded AND a new resource was created — typically returned from a POST that creates an entity, often with a Location header pointing to the new resource.

401 Unauthorized means the request lacks valid authentication. 403 Forbidden means the user is authenticated but does not have permission for that action.

When the request is malformed — invalid JSON, missing required fields, wrong types. For semantic validation issues (e.g. invalid email format), 422 Unprocessable Content is often a better choice.

An unhandled exception or unexpected condition on the server prevented the request from completing. It always indicates a server-side bug worth investigating.

200, 201, 204, 400, 401, 403, 404, 409, 422, 429, 500, and 503 cover the vast majority of REST API scenarios.

422 Unprocessable Content is preferred for semantic validation errors. 400 Bad Request is acceptable when the API treats validation generically.

502 Bad Gateway means the upstream returned an invalid response. 504 Gateway Timeout means the upstream did not respond in time.

FAQ

Frequently Asked Questions

Everything you need to know about HTTP status codes.

HTTP status codes are three-digit numbers servers return to indicate the result of an HTTP request — success, redirection, client error, or server error.

1xx Informational, 2xx Success, 3xx Redirection, 4xx Client Error, and 5xx Server Error.

200, 201, 204, 301, 302, 304, 400, 401, 403, 404, 409, 422, 429, 500, 502, 503, and 504.

200 OK with the resource representation in the response body.

201 Created when a new resource is created, or 200 OK when the action succeeded without creating a resource.

4xx codes indicate the client made an invalid request. 5xx codes indicate the server failed to fulfill an otherwise valid request.

Status codes are the first signal of whether an API behaves correctly. Tests assert on them to validate happy paths, error handling, authentication, and rate limiting.