Zest.
4xx · Client error

HTTP 401 Unauthorized

Authentication is missing or invalid. Despite the name, this is about who you are.

Common causes and fixes

  • Send valid credentials or a fresh token.
  • A WWW-Authenticate header should say how to authenticate.

Example response

HTTP
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer realm="api"
Content-Type: application/json; charset=utf-8

{ "error": "Unauthorized" }

Look up the headers shown here in the HTTP headers reference.

Common questions

What does HTTP 401 mean?
Unauthorized. Authentication is missing or invalid. Despite the name, this is about who you are.
How do I fix a 401 error?
Send valid credentials or a fresh token. A WWW-Authenticate header should say how to authenticate.
Is 401 an error?
Yes. 4xx codes are client errors: The request contains a mistake or can't be fulfilled as sent.

Other 4xx codes