Skip to content
MtrXTools

401 Unauthorized

The request needs valid credentials

Seen in APIs, browsers, web servers

The server did not accept the credentials sent, or none were sent, so it will not process the request.

Common causes

  • No Authorization header, cookie or API key was sent.
  • An expired, revoked or mistyped token or password.
  • The wrong authentication scheme, e.g. Basic sent where Bearer is expected.
  • A clock out of sync, making a fresh JWT look expired or not yet valid.

How to fix it

  1. Check the WWW-Authenticate response header: it names the scheme the server expects.
  2. Refresh or regenerate the token and confirm it is sent on every request.
  3. Check proxies or redirects are not stripping the Authorization header.
  4. Sync the client clock with NTP if tokens fail right after being issued.
Check the auth headers

Got a different message? Paste it into the error explainer.

Related errors

All 51 HTTP & CDN errors