2xx — Success
| Code | Name | Use |
|---|---|---|
200 | OK | Successful GET/PUT/PATCH |
201 | Created | Successful POST (resource created) |
204 | No Content | Successful DELETE (no body) |
3xx — Redirection
| Code | Name | Use |
|---|---|---|
301 | Moved Permanently | URL changed permanently (SEO-safe) |
302 | Found | Temporary redirect |
304 | Not Modified | Use cached version |
307 | Temporary Redirect | Keeps method (POST stays POST) |
308 | Permanent Redirect | Like 301 but keeps method |
4xx — Client Error
| Code | Name | Meaning |
|---|---|---|
400 | Bad Request | Invalid request syntax/body |
401 | Unauthorized | No/invalid authentication |
403 | Forbidden | Authenticated but not allowed |
404 | Not Found | Resource doesn't exist |
405 | Method Not Allowed | Wrong HTTP method |
409 | Conflict | Resource conflict (duplicate) |
422 | Unprocessable Entity | Validation error |
429 | Too Many Requests | Rate limited |
5xx — Server Error
| Code | Name | Meaning |
|---|---|---|
500 | Internal Server Error | Unhandled server error |
502 | Bad Gateway | Upstream server error |
503 | Service Unavailable | Server overloaded/maintenance |
504 | Gateway Timeout | Upstream server timeout |
Quick Reference for API Developers
| Scenario | Code |
|---|---|
| Successful read | 200 |
| Resource created | 201 |
| Successful delete | 204 |
| Invalid JSON body | 400 |
| Missing/bad API key | 401 |
| Not enough permissions | 403 |
| Item not found | 404 |
| Validation failed | 422 |
| Rate limit exceeded | 429 |
| Bug in your code | 500 |