401 UnauthorizedWhat 401 Unauthorized means
HTTP 401 means the target server requires authentication it didn't get: the credential is missing, expired, malformed, or wrong for this resource. The response carries a WWW-Authenticate header naming the scheme it expects (Bearer, Basic, or a custom one). Despite the name 'Unauthorized', it's an authentication failure — who are you — not an authorization failure, which is 403.
The first triage step is separating 401 from its proxy cousin, 407 Proxy Authentication Required. A 401 comes from the site or API you're calling and is about your credentials for that service. A 407 comes from the proxy itself and means your proxy username or password was rejected. Mixing these up sends people down the wrong debugging path for hours.
Typical concrete causes: no Authorization header on the request, an expired or revoked token, Bearer sent where Basic is expected (or vice versa), a sandbox key used against a production host, a session cookie that has lapsed — or, in proxy pipelines specifically, a session the server invalidated because your exit IP changed mid-flow.