HTTP Status Codes
1xx Informational
| Code | Name | Description |
|---|---|---|
100 |
Continue |
Client should continue sending request body |
101 |
Switching Protocols |
Server agrees to switch protocol (WebSocket upgrade) |
2xx Success
| Code | Name | Description |
|---|---|---|
200 |
OK |
Standard success response |
201 |
Created |
Resource successfully created (POST) |
202 |
Accepted |
Request accepted but processing not complete (async) |
204 |
No Content |
Success with no response body (DELETE) |
3xx Redirection
| Code | Name | Description |
|---|---|---|
301 |
Moved Permanently |
Resource permanently at new URL; update bookmarks |
302 |
Found |
Temporary redirect; keep using original URL |
304 |
Not Modified |
Cached version is still valid (conditional GET) |
307 |
Temporary Redirect |
Like 302 but preserves HTTP method |
308 |
Permanent Redirect |
Like 301 but preserves HTTP method |
4xx Client Error
| Code | Name | Description |
|---|---|---|
400 |
Bad Request |
Malformed request syntax or invalid parameters |
401 |
Unauthorized |
Authentication required (misleading name — means unauthenticated) |
403 |
Forbidden |
Authenticated but not authorized for this resource |
404 |
Not Found |
Resource does not exist at this URL |
405 |
Method Not Allowed |
HTTP method not supported for this endpoint |
408 |
Request Timeout |
Server timed out waiting for request |
409 |
Conflict |
Request conflicts with current state (duplicate, version mismatch) |
413 |
Payload Too Large |
Request body exceeds server limit |
415 |
Unsupported Media Type |
Content-Type header not supported |
422 |
Unprocessable Entity |
Syntactically correct but semantically invalid (validation error) |
429 |
Too Many Requests |
Rate limit exceeded; check Retry-After header |
5xx Server Error
| Code | Name | Description |
|---|---|---|
500 |
Internal Server Error |
Generic server failure — check server logs |
502 |
Bad Gateway |
Upstream server returned invalid response (reverse proxy issue) |
503 |
Service Unavailable |
Server overloaded or in maintenance; temporary |
504 |
Gateway Timeout |
Upstream server did not respond in time |
API Debugging Quick Reference
curl -s -o /dev/null -w '%{http_code}\n' https://api.example.com/endpoint
curl -I https://api.example.com/endpoint
# 401 → check token/credentials
# 403 → check permissions/roles
# 404 → check URL path and resource existence
# 429 → add retry logic with exponential backoff
# 502/503/504 → upstream issue, retry after delay