HTTP 403 Forbidden vs 422 Unprocessable Content
Both HTTP 403 (Forbidden) and 422 (Unprocessable Content) belong to the 4xx Client Error category. 403 indicates that the server understood the request but refuses to authorize it. Unlike 401, authentication will not help — the user simply does not have permission. Meanwhile, 422 means that the server understands the content type and syntax, but was unable to process the contained instructions. Common in API validation errors.
Description
The server understood the request but refuses to authorize it. Unlike 401, authentication will not help — the user simply does not have permission.
When You See It
When trying to access a resource you're authenticated for but don't have permission to access.
How to Fix
Check your user role/permissions. Contact the admin to request access.
Description
The server understands the content type and syntax, but was unable to process the contained instructions. Common in API validation errors.
When You See It
When form validation fails — correct syntax but invalid data (e.g., email format wrong, date in the past).
How to Fix
Check the response body for specific validation errors and correct the input data.
Key Differences
HTTP 403: The server understood the request but refuses to authorize it. Unlike 401, authentication will not help — the user simply does not have permission.
HTTP 422: The server understands the content type and syntax, but was unable to process the contained instructions. Common in API validation errors.
You encounter 403 when when trying to access a resource you're authenticated for but don't have permission to access.
You encounter 422 when when form validation fails — correct syntax but invalid data (e.g., email format wrong, date in the past).
When to Use Which
For 403 (Forbidden): Check your user role/permissions. Contact the admin to request access. For 422 (Unprocessable Content): Check the response body for specific validation errors and correct the input data.