// tools
HTTP status codes
Searchable, deep-linkable. Every code has a one-line meaning, an indication of when servers should send it, and what clients typically do. Anchor on#418to deep-link a specific code in chat.
1xx — informational
- 100Continue
Server has received the request headers and the client should proceed sending the body. Rarely emitted by modern stacks.
- 101Switching Protocols
Server agrees to switch protocol per the Upgrade header. WebSockets and HTTP/2 upgrade flow use this.
- 103Early Hints
Server is sending preload hints before the final response. Used to start asset fetching during slow database queries.
2xx — success
- 200OK
Standard success. The request worked and the response body has the result.
- 201Created
A new resource was created. Conventionally returned with a Location header pointing to the new resource.
- 202Accepted
Request accepted but not yet processed. Used for async work — return the job ID in the body.
- 204No Content
Success, no body to return. Common for DELETE.
- 206Partial Content
Range request fulfilled. Used by video / large-file streaming.
3xx — redirection
- 301Moved Permanently
Resource has a new permanent URL in the Location header. Browsers and crawlers update bookmarks / indexes.
- 302Found
Temporary redirect. Originally meant to preserve the request method but historically buggy — prefer 307 for clarity.
- 303See Other
After a POST, redirect the client to GET the result. Avoids re-submitting the form on refresh.
- 304Not Modified
The cached version is still fresh. Return this when If-None-Match / If-Modified-Since matches.
- 307Temporary Redirect
Same as 302 but explicitly preserves the original method (POST stays a POST).
- 308Permanent Redirect
Same as 301 but explicitly preserves the original method.
4xx — client error
- 400Bad Request
Malformed request — bad JSON, missing required field. Clients should fix and retry.
- 401Unauthorized
Authentication required or invalid. Despite the name, this is about authentication, not authorization. Pair with WWW-Authenticate.
- 403Forbidden
Authenticated but lacks permission. Different from 401 — re-authing won't help.
- 404Not Found
Resource doesn't exist. Avoid leaking existence with subtle differences from 403.
- 405Method Not Allowed
The route exists but not for this HTTP verb. Return Allow: with the supported methods.
- 408Request Timeout
Server gave up waiting for the client to send the request. Some load balancers send this aggressively.
- 409Conflict
Optimistic-concurrency / state-mismatch failures. "Resource was edited since you fetched it" is a 409.
- 410Gone
Resource used to exist; it's now permanently removed. Stronger signal than 404 for crawlers.
- 413Payload Too Large
Request body exceeds server limit. Common for upload endpoints.
- 414URI Too Long
Move some of those query params into a POST body.
- 415Unsupported Media Type
Content-Type doesn't match what the endpoint accepts.
- 418I'm a teapot
April Fools' joke from RFC 2324, kept alive for cultural reasons. Some sites use it as a tarpit signal.
- 422Unprocessable Entity
Request was syntactically valid but semantically wrong. The form parsed but a field violated business rules. Most modern APIs use this in place of 400.
- 425Too Early
Server unwilling to risk processing a request that might be replayed (TLS 0-RTT context).
- 429Too Many Requests
Rate-limited. Pair with Retry-After. Webhook providers love this one.
- 451Unavailable For Legal Reasons
Geo / legal blocking. Reference: Fahrenheit 451.
5xx — server error
- 500Internal Server Error
Catch-all for unhandled exceptions. Return this when you have nothing more specific.
- 501Not Implemented
The server recognizes the method but can't fulfill it.
- 502Bad Gateway
A proxy / load balancer got an invalid response from upstream. Reverse-proxy users see this when the origin is down.
- 503Service Unavailable
Server is up but temporarily refusing requests — maintenance, overload. Pair with Retry-After.
- 504Gateway Timeout
A proxy timed out waiting for upstream. The origin is slow, not necessarily down.
- 507Insufficient Storage
Out of disk for the operation. WebDAV-flavored.
- 511Network Authentication Required
Captive portals. The client must authenticate to gain network access.