HTTP status code 401 — Unauthorized
Quick answer
Status code 401 (Unauthorized): Authentication required or failed. Send or refresh credentials (Bearer, cookie, Basic).
Send or refresh credentials (Bearer, cookie, Basic).
Despite the name, 401 means “unauthenticated.” If the user is logged in but lacks permission, expect 403 instead.
Common causes
- Missing or expired Authorization header/token
- A session cookie that expired or was cleared
- Wrong API key or key revoked
How to fix it
Refresh or re-issue the token/credential and retry — a 401 will not go away on its own, unlike a transient 5xx.
Related: 400403404405408409308307
Frequently asked questions
What is status code 401?
401 Unauthorized: Authentication required or failed. Send or refresh credentials (Bearer, cookie, Basic).
When should I expect HTTP 401?
Despite the name, 401 means “unauthenticated.” If the user is logged in but lacks permission, expect 403 instead.
What usually causes HTTP 401?
Missing or expired Authorization header/token; A session cookie that expired or was cleared; Wrong API key or key revoked.
How do I fix HTTP 401?
Refresh or re-issue the token/credential and retry — a 401 will not go away on its own, unlike a transient 5xx.
Where can I see all status codes?
Open the HTTP status codes hub on TryDevSnip for the full reference list.
Does TryDevSnip log my API traffic?
No. These pages are static reference. TryDevSnip does not proxy or inspect your HTTP calls.