HTTP status codes cheat sheet
The status codes you will actually meet, what each means and when your API should send it. Meanings follow RFC 9110, the current HTTP standard.
checked 30 November 2026
2xx: Success
| Code | Name | Meaning and when to use it |
|---|---|---|
200 | OK | The request worked. The body holds the result. |
201 | Created | A new resource was made. Send its URL in the Location header. |
202 | Accepted | Queued for processing, not done yet. Good for background jobs. |
204 | No Content | Worked, and there is nothing to send back. Common for DELETE. |
206 | Partial Content | Part of a file, in answer to a Range request. Used for video and resumable downloads. |
3xx: Redirection
| Code | Name | Meaning and when to use it |
|---|---|---|
301 | Moved Permanently | The URL has changed for good. Search engines move ranking to the new URL. Browsers may turn a POST into a GET. |
302 | Found | Temporary redirect. Browsers may also turn a POST into a GET. |
303 | See Other | Go and GET this other URL. The classic response after a form POST. |
304 | Not Modified | The cached copy is still good, so no body is sent. Answers If-None-Match or If-Modified-Since. |
307 | Temporary Redirect | Like 302, but the method and body must not change. |
308 | Permanent Redirect | Like 301, but the method and body must not change (RFC 9110). |
4xx: Client errors
| Code | Name | Meaning and when to use it |
|---|---|---|
400 | Bad Request | The request is malformed: bad JSON, a missing field, a wrong type. |
401 | Unauthorized | Not authenticated: no credentials, or bad ones. Send a WWW-Authenticate header. |
403 | Forbidden | Authenticated, but not allowed to do this. Logging in again will not help. |
404 | Not Found | Nothing at this URL. Also used to hide that a resource exists from someone not allowed to see it. |
405 | Method Not Allowed | The URL exists but not for this method. List the allowed ones in the Allow header. |
409 | Conflict | Clashes with the current state: a duplicate username, an edit to a stale version. |
410 | Gone | Removed on purpose and not coming back. Search engines drop it faster than a 404. |
413 | Content Too Large | The upload is over the size limit (called Payload Too Large before RFC 9110). |
415 | Unsupported Media Type | The server does not accept this Content-Type. |
422 | Unprocessable Content | Well-formed, but the values fail validation, such as an end date before the start date. |
429 | Too Many Requests | Rate limited (RFC 6585). Say when to retry with a Retry-After header. |
5xx: Server errors
| Code | Name | Meaning and when to use it |
|---|---|---|
500 | Internal Server Error | Something broke on the server. Log the detail; do not send a stack trace to the client. |
501 | Not Implemented | The server does not support this method at all. |
502 | Bad Gateway | A proxy or load balancer got a bad answer from the app behind it. Often the app crashed or is restarting. |
503 | Service Unavailable | Overloaded or down for maintenance. A Retry-After header helps clients and crawlers. |
504 | Gateway Timeout | A proxy gave up waiting for the app behind it. |
Codes people mix up
401 or 403?
401 means "who are you?": the client is not logged in or the token is bad. 403 means "I know who you are, and no": the user lacks permission.
400 or 422?
400 for a request the server cannot parse. 422 for one it parsed fine but whose values break a rule. Many APIs use 400 for both, which is also acceptable; pick one and be consistent.
301 or 308? 302 or 307?
For plain page redirects, 301 and 302 are fine. For API endpoints that receive POST or PUT, use 308 and 307 so the method and body survive the redirect.
404 or 410?
410 when you deleted something on purpose and want it out of search results. 404 for everything else.
Debugging an API response? Format the body with the JSON formatter, or read an auth token with the JWT decoder.