Client Error · 4xx

403 Forbidden

The server understood the request and knows who you are, but refuses to authorize it.

What 403 Forbidden means

403 Forbidden is the authorization-failure code. Unlike 401, which means "we do not know who you are", 403 means "we know exactly who you are, and you are not allowed to do this". The classic 403 cases: trying to access another user's data, attempting an admin-only operation as a regular user, or hitting a resource that has been blocked at the firewall level (Cloudflare 403, AWS WAF 403, etc.).

When servers should return it: Return 403 when authentication succeeded but the user lacks the permission, scope, or role to perform the action. Do not return 403 for missing auth (that is 401) or missing resources (that is 404).

Common causes

How to fix 403 Forbidden

Example response

curl -i -H "Authorization: Bearer $READ_ONLY_TOKEN" \
  -X DELETE https://api.example.com/users/42

HTTP/2 403
content-type: application/json
{"error":"forbidden","reason":"token lacks 'users:write' scope"}

Related status codes

Frequently Asked Questions

401 vs 403?
401 = unauthenticated (who are you?). 403 = unauthorized (we know you, you cannot do this).
Should 403 reveal why?
Sometimes yes (helps debugging), sometimes no (avoids leaking information). For internal APIs, be specific. For public APIs facing potential attackers, be vague.
Why am I getting 403 from Cloudflare?
Cloudflare returns 403 when its WAF, bot management, or firewall rules block your request. Check the Cloudflare event log for the specific rule that fired.
Defined in: RFC 9110 · Class: 4xx Client Error

More references

For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.