HTTP Status Codes
The response codes worth memorizing, grouped by class, with when to use each.
2xx — Success
- 200 OK
- Standard success with a body
- 201 Created
- A resource was created (return its location)
- 202 Accepted
- Accepted for async processing
- 204 No Content
- Success, nothing to return
3xx — Redirect
- 301 Moved Permanently
- Permanent new URL (SEO-safe)
- 302 Found
- Temporary redirect
- 304 Not Modified
- Use your cached copy
4xx — Client error
- 400 Bad Request
- Malformed request
- 401 Unauthorized
- Not authenticated
- 403 Forbidden
- Authenticated but not allowed
- 404 Not Found
- No such resource
- 409 Conflict
- State conflict (e.g. version clash)
- 422 Unprocessable
- Valid syntax, failed validation
- 429 Too Many Requests
- Rate limited — back off
5xx — Server error
- 500 Internal Server Error
- Unhandled failure
- 502 Bad Gateway
- Upstream returned garbage
- 503 Service Unavailable
- Overloaded or down — retry later
- 504 Gateway Timeout
- Upstream too slow