401
4xx Client ErrorUnauthorized
Authentication is required and has failed or not been provided.
401 Unauthorized actually means 'unauthenticated': the server doesn't know who you are. Either you sent no credentials or the ones you sent are wrong or expired. It's different from 403, where the server knows who you are but won't let you in. A correct 401 response includes a WWW-Authenticate header describing how to authenticate.
About 4xx Client Error
The request has a problem the client needs to fix, like a bad URL, missing auth, or invalid input.
How to fix 401 Unauthorized
- Send credentials - an Authorization header, token, or session cookie.
- Check that the token hasn't expired and is for the right environment.
- Confirm the auth scheme matches (Bearer vs Basic vs API key).
- If credentials look right but still fail, regenerate the token or key.