Reference for API Documentation
When writing API documentation, link to authoritative descriptions of the status codes you return.
34 status codes
100Continue
The server has received the request headers and the client should proceed with the body.
Continue
The server has received the request headers and the client should proceed with the body.
Used for requests with Expect: 100-continue. The server acknowledges that it's willing to receive the body before the client sends it. Rarely seen in modern web apps.
101Switching Protocols
The server is switching protocols as requested by the client.
Switching Protocols
The server is switching protocols as requested by the client.
Most commonly used for WebSocket upgrades — the client requests Upgrade: websocket and the server responds 101 to switch.
200OK
The request succeeded.
OK
The request succeeded.
The standard success response. The meaning depends on the HTTP method: GET → resource returned, POST/PUT → action completed.
201Created
A new resource was successfully created.
Created
A new resource was successfully created.
Common after a POST. The response should include a Location header pointing to the new resource's URL.
202Accepted
The request was accepted for processing, but processing is not complete.
Accepted
The request was accepted for processing, but processing is not complete.
For async operations — the server is queuing the work. The client should poll a status endpoint or check back later.
204No Content
The request succeeded but there is no response body.
No Content
The request succeeded but there is no response body.
Often used for DELETE operations or PUT updates that don't need to return a body. The client should not navigate away from the current page.
206Partial Content
The server delivered only part of the resource.
Partial Content
The server delivered only part of the resource.
Response to a Range request. Used by video players and download managers to resume interrupted downloads or stream large files.
301Moved Permanently
The resource has permanently moved to a new URL.
Moved Permanently
The resource has permanently moved to a new URL.
Use for permanent URL changes — search engines will update their index. SEO authority transfers to the new URL.
302Found (Temporary Redirect)
The resource is temporarily at a different URL.
Found (Temporary Redirect)
The resource is temporarily at a different URL.
Indicates the redirect is not permanent. Caching is less aggressive than 301. Use for things like "login required, redirecting to /login".
303See Other
Redirect to a different URL using GET.
See Other
Redirect to a different URL using GET.
Used after POST submissions — the response says "your POST worked, see this GET URL for the result". Browsers always GET the new URL.
304Not Modified
The cached version is still valid; use it.
Not Modified
The cached version is still valid; use it.
Response to a conditional request (with If-None-Match or If-Modified-Since headers). Saves bandwidth — no body is returned.
307Temporary Redirect
Like 302 but preserves the original HTTP method.
Temporary Redirect
Like 302 but preserves the original HTTP method.
If the original was POST, the redirect also uses POST. Modern alternative to 302 when method preservation matters.
308Permanent Redirect
Like 301 but preserves the original HTTP method.
Permanent Redirect
Like 301 but preserves the original HTTP method.
Modern replacement for 301 when you want POST requests to remain POST after the redirect.
400Bad Request
The server couldn't understand the request due to malformed syntax.
Bad Request
The server couldn't understand the request due to malformed syntax.
Common causes: malformed JSON in body, invalid query parameters, or missing required fields. Check the request body and headers.
401Unauthorized
Authentication is required and has not been provided.
Unauthorized
Authentication is required and has not been provided.
The client must include authentication credentials (Authorization header, cookie, token). "Unauthorized" is a misnomer — it really means "unauthenticated".
402Payment Required
Reserved for future use — sometimes used for paid API tiers.
Payment Required
Reserved for future use — sometimes used for paid API tiers.
Originally intended for digital payments. Modern usage: APIs sometimes return 402 when a user has exceeded their paid quota.
403Forbidden
The client is authenticated but doesn't have permission.
Forbidden
The client is authenticated but doesn't have permission.
Different from 401 — the user IS logged in, but their account doesn't have permission for this resource. Check role/permissions logic.
404Not Found
The requested resource doesn't exist.
Not Found
The requested resource doesn't exist.
Either the URL is wrong, the resource was deleted, or it never existed. Servers sometimes return 404 to hide that a 403 would be more accurate.
405Method Not Allowed
The HTTP method used is not allowed for this resource.
Method Not Allowed
The HTTP method used is not allowed for this resource.
For example, a GET request to an endpoint that only accepts POST. The response should include an Allow header listing valid methods.
408Request Timeout
The server timed out waiting for the request.
Request Timeout
The server timed out waiting for the request.
The client took too long to send the request body or kept the connection idle. Try the request again.
409Conflict
The request conflicts with the current state of the resource.
Conflict
The request conflicts with the current state of the resource.
Typically returned for concurrent edit conflicts or duplicate resource creation (e.g., creating a user with an email that already exists).
410Gone
The resource was deleted and won't come back.
Gone
The resource was deleted and won't come back.
Stronger than 404 — the server explicitly knows the resource USED to exist but has been permanently removed. Search engines will deindex.
413Payload Too Large
The request body exceeds the server's size limit.
Payload Too Large
The request body exceeds the server's size limit.
Common when uploading large files. Server config (nginx, apache) sets a max body size. Check the server's configuration.
415Unsupported Media Type
The server can't handle the Content-Type sent.
Unsupported Media Type
The server can't handle the Content-Type sent.
For example, sending application/xml to a server that only accepts application/json. Set the Content-Type header correctly.
418I'm a Teapot
The server refuses to brew coffee because it's a teapot.
I'm a Teapot
The server refuses to brew coffee because it's a teapot.
An April Fool's joke from 1998 (RFC 2324). Some real APIs use it for jokes or to mark deprecated endpoints. Not for production use.
422Unprocessable Content
The request was syntactically valid but semantically wrong.
Unprocessable Content
The request was syntactically valid but semantically wrong.
For example, JSON parsed correctly but a required field was missing, or a field value was out of range. Common in REST API validation responses.
429Too Many Requests
The client is being rate-limited.
Too Many Requests
The client is being rate-limited.
Slow down. The response should include a Retry-After header indicating when to try again. Common with APIs that have request quotas.
500Internal Server Error
The server encountered an unexpected condition.
Internal Server Error
The server encountered an unexpected condition.
A generic catch-all for server-side errors. Check server logs for the actual cause: unhandled exception, database error, etc.
501Not Implemented
The server doesn't support the functionality requested.
Not Implemented
The server doesn't support the functionality requested.
For example, the server doesn't recognize the HTTP method. Rare in practice — more often you'll see 405.
502Bad Gateway
The server, acting as a gateway, got a bad response from an upstream server.
Bad Gateway
The server, acting as a gateway, got a bad response from an upstream server.
Common in microservice architectures. Your load balancer or reverse proxy got a malformed response from the backend service.
503Service Unavailable
The server is temporarily unable to handle the request.
Service Unavailable
The server is temporarily unable to handle the request.
Either down for maintenance or overloaded. The response should include a Retry-After header. Often returned during deployments.
504Gateway Timeout
The gateway server timed out waiting for an upstream response.
Gateway Timeout
The gateway server timed out waiting for an upstream response.
The backend service didn't respond fast enough. Check upstream service health and timeout configurations.
507Insufficient Storage
The server is out of disk space.
Insufficient Storage
The server is out of disk space.
WebDAV-specific in origin but sometimes used by general servers. Means the server can't save the request because of storage constraints.
511Network Authentication Required
The client must authenticate to gain network access.
Network Authentication Required
The client must authenticate to gain network access.
Used by captive portals (hotel/airport WiFi) to indicate the user must log in to the network before accessing external sites.
API Docs tips
In your OpenAPI/Swagger docs, listing all possible response codes is best practice. This reference gives you authoritative descriptions.
For changelog entries about API changes ("now returns 410 for deleted resources instead of 404"), link to the reference for clarity.
For client SDK error handling, your library should distinguish 4xx (don't retry) from 5xx (retry with backoff). The reference clarifies the boundary.
Cómo funciona
¿Por qué usar el nuestro?
Also check out…
Reference for API Design
When designing REST APIs, pick the right status co
Look Up Error Codes Quickly
When your app returns a confusing HTTP error, look
Learn HTTP Status Codes
Comprehensive reference for students and developer
Quick Reference During Incidents
During production incidents, quickly look up what
