Reference
HTTP Status Codes
A searchable reference of HTTP status codes with short guidance on when to use each one and how it differs from the codes people confuse it with.
1xx · Informational
2xx · Success
OKcommon
Generic success. The body contains the result.
Createdcommon
A resource was created. Include a Location header pointing at it.
Accepted
Request accepted for asynchronous processing that hasn't finished. Return a way to poll for the outcome.
Non-Authoritative Information
A proxy modified the origin's 200 response. Rare.
No Contentcommon
Success with no body. Typical for DELETE or a PUT that returns nothing.
Reset Content
Success; the client should reset the form/view that sent the request.
Partial Content
Response to a Range request: video seeking, resumable downloads.
Multi-Status
WebDAV: the body holds status for multiple resources.
3xx · Redirection
Multiple Choices
Several representations available. Browsers don't do anything useful with it.
Moved Permanentlycommon
Permanent redirect, cached aggressively. Clients may change POST to GET; use 308 to forbid that.
Foundcommon
Temporary redirect. Historically turns POST into GET; 303/307 say what you mean.
See Other
Redirect that must be followed with GET. The classic Post/Redirect/Get after a form submit.
Not Modifiedcommon
Conditional GET hit: the cached copy (ETag / Last-Modified) is still valid. No body.
Temporary Redirect
Like 302 but the method and body must be kept.
Permanent Redirect
Like 301 but the method and body must be kept.
4xx · Client error
Bad Requestcommon
Malformed request: invalid JSON, missing fields, bad syntax. Use 422 if the syntax is fine but the values aren't.
Unauthorizedcommon
Actually means unauthenticated: no or invalid credentials. Must include WWW-Authenticate.
Payment Required
Reserved; some APIs use it for exhausted quotas or billing problems.
Forbiddencommon
Authenticated but not allowed. Re-authenticating won't help (unlike 401).
Not Foundcommon
No resource here. Also used instead of 403 to avoid revealing that something exists.
Method Not Allowedcommon
The resource exists but not for this verb. Include an Allow header.
Not Acceptable
Can't produce a representation matching the Accept headers.
Proxy Authentication Required
Like 401, but for a proxy.
Request Timeout
The client took too long to send the request. Safe to retry.
Conflictcommon
Conflicts with the current state: duplicate unique key, edit conflict, version mismatch.
Gone
Deleted on purpose and not coming back. Search engines drop it faster than a 404.
Length Required
The server requires a Content-Length header.
Precondition Failed
An If-Match / If-Unmodified-Since check failed. Optimistic locking.
Content Too Largecommon
Body exceeds the server limit (think nginx client_max_body_size).
URI Too Long
The URL is too long. Usually a GET that should have been a POST.
Unsupported Media Typecommon
The Content-Type isn't supported, e.g. sending form data to a JSON-only endpoint.
Range Not Satisfiable
The requested Range lies outside the resource.
Expectation Failed
The server can't meet the Expect header.
I'm a teapot
An April Fools' joke (RFC 2324) that never went away. Refuses to brew coffee.
Misdirected Request
The request reached a server that can't answer for this host. Seen with HTTP/2 connection reuse.
Unprocessable Contentcommon
Well-formed but semantically invalid: validation errors. The usual choice for form errors in APIs.
Locked
WebDAV: the resource is locked.
Failed Dependency
WebDAV: failed because a previous request failed.
Too Early
The server won't risk processing a request that might be replayed (TLS early data).
Upgrade Required
The client must switch protocols, given in the Upgrade header.
Precondition Required
The server requires conditional requests to prevent lost updates.
Too Many Requestscommon
Rate limited. Send Retry-After so clients know when to come back.
Request Header Fields Too Large
Headers too big. Often too many or too large cookies.
Unavailable For Legal Reasons
Blocked for legal reasons such as censorship or a court order. A nod to Fahrenheit 451.
Client Closed Request
Non-standard (nginx): the client hung up before the server answered.
5xx · Server error
Internal Server Errorcommon
Generic server failure, usually an unhandled exception. Check the logs.
Not Implemented
The server doesn't support the functionality (e.g. an unknown method).
Bad Gatewaycommon
A proxy got an invalid response from upstream. Usually your app crashed or isn't listening.
Service Unavailablecommon
Overloaded or down for maintenance. Add Retry-After.
Gateway Timeoutcommon
A proxy gave up waiting for upstream. Your app is too slow or stuck.
HTTP Version Not Supported
The HTTP version in the request isn't supported.
Insufficient Storage
WebDAV: no space left to store the representation.
Loop Detected
WebDAV: infinite loop while processing.
Network Authentication Required
Captive portal: log in to the network (hotel / airport wifi) first.
Web Server Returned an Unknown Error
Cloudflare: the origin returned something empty or unexpected.
Web Server Is Down
Cloudflare: the origin refused the connection.
Connection Timed Out
Cloudflare: the TCP connection to the origin timed out.
A Timeout Occurred
Cloudflare: connected to the origin but it didn't respond within 100 seconds.
No status code matches that.