Skip to content
4xx · Client Error

401 Unauthorized

Authentication is required and has failed or not been provided.

What it means

HTTP 401 Unauthorized means the request lacks valid authentication credentials. Despite the name, it is about authentication (proving who you are), not authorization. The response includes a WWW-Authenticate header describing how to authenticate.

When it happens

It happens when accessing a protected resource without logging in, with an expired session or token, or with incorrect credentials.

How to fix it

  • Provide valid credentials or a current access token with the request.
  • Refresh expired sessions or tokens before retrying.
  • Confirm the WWW-Authenticate scheme the server expects (Bearer, Basic, etc.).
  • For APIs, verify the Authorization header is being sent and not stripped by a proxy.

SEO impact

Pages behind 401 are not indexed, which is usually intended for private content. Make sure pages you want ranked are not accidentally gated behind authentication.

Check it with Sitewell

Find out which of your URLs return 401

Paste a list of URLs and Sitewell checks the status code of every one at once — free and without signup.

Related codes

Related guides