401

HTTP 401 Unauthorized

4xx Client Error

  1. Home
  2. > HTTP Status Codes >
  3. > 4xx >
  4. 401
4xx Client Error RFC 7235, Section 3.1

What is HTTP 401 Unauthorized?

The 401 (Unauthorized) status code indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource. Despite the name "Unauthorized", this actually means "unauthenticated" — the client has not provided valid credentials.

Common Use Cases

  • Missing or invalid API key
  • Expired authentication token
  • Login required for protected resources
  • Invalid credentials
Help2Code Logo
Menu