HTTP status codes β quick cheat sheet
β 200 OK: request succeeded
π 201 Created: new resource saved
π 204 No Content: success, nothing to return
π 301 Moved Permanently: use new URL
βͺοΈ 302 Found: temporary redirect
π§Ύ 304 Not Modified: use cached version
π 400 Bad Request: invalid input
πͺͺ 401 Unauthorized: missing/invalid auth
π« 403 Forbidden: authenticated but not allowed
β 404 Not Found: resource doesnβt exist
β³ 408 Request Timeout: client took too long
π§― 409 Conflict: state/version clash
π₯ 500 Internal Server Error: server crashed
π οΈ 502 Bad Gateway: upstream failed
πΈοΈ 503 Service Unavailable: overloaded/maintenance
β 504 Gateway Timeout: upstream too slow
tips
β’ return precise codes; donβt default to 200/500
β’ include a machine-readable error body (code, message, details)
β’ never leak stack traces in production
β’ pair 304 with ETag/If-None-Match for caching
β 200 OK: request succeeded
π 201 Created: new resource saved
π 204 No Content: success, nothing to return
π 301 Moved Permanently: use new URL
βͺοΈ 302 Found: temporary redirect
π§Ύ 304 Not Modified: use cached version
π 400 Bad Request: invalid input
πͺͺ 401 Unauthorized: missing/invalid auth
π« 403 Forbidden: authenticated but not allowed
β 404 Not Found: resource doesnβt exist
β³ 408 Request Timeout: client took too long
π§― 409 Conflict: state/version clash
π₯ 500 Internal Server Error: server crashed
π οΈ 502 Bad Gateway: upstream failed
πΈοΈ 503 Service Unavailable: overloaded/maintenance
β 504 Gateway Timeout: upstream too slow
tips
β’ return precise codes; donβt default to 200/500
β’ include a machine-readable error body (code, message, details)
β’ never leak stack traces in production
β’ pair 304 with ETag/If-None-Match for caching
β€1