Understanding 1xx–5xx Status Codes

HTTP status codes are grouped by their first digit.

  • 1xx: informational
  • 2xx: successful processing
  • 3xx: redirection or caching-related behavior
  • 4xx: client-side request problems
  • 5xx: server-side failures

Common API responses include 200 OK, 201 Created, 202 Accepted, 204 No Content, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 409 Conflict, 422 Unprocessable Content, 429 Too Many Requests, 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable, and 504 Gateway Timeout.

The difference between 401 and 403 is particularly important: 401 indicates missing or invalid authentication credentials, while 403 indicates that the request is understood but the authenticated principal is not permitted to perform the operation.

Specifications & Requirements
  • Successful creation:201 Created
  • Accepted asynchronous work:202 Accepted
  • No response body:204 No Content
  • Authentication required/invalid:401 Unauthorized
  • Permission denied:403 Forbidden
  • Resource conflict:409 Conflict
  • Rate limited:429 Too Many Requests