Skip to main content

Client Error (4xx)

HTTP/1.1

401 Unauthorized

The request lacks valid authentication credentials. The client must authenticate.

CategoryClient Error (4xx)
API error types7 error schemas
Related headers7 headers
Updated2026-07-10

What does HTTP status code 401 mean?

The 401 Unauthorized status code indicates that the client must authenticate itself to receive the requested response.

When to use it in APIs

Use 401 when the client fails to provide an API key, bearer token, or session credentials, or when the credentials provided are invalid or expired. A 401 response must include a WWW-Authenticate header naming the authentication scheme the client should use (e.g. WWW-Authenticate: Bearer realm="api").

How it compares to other codes

  • 403 Forbidden: Use 403 when the client is authenticated but does not possess the permissions/scopes to access the resource.