HTTP 451 — Unavailable For Legal Reasons

A server operator has received a legal demand to deny access to a resource or to a set of resources

When to use it

Use status 451 when this is the correct HTTP response semantic: A server operator has received a legal demand to deny access to a resource or to a set of resources

Request and response example

GET /protected-resource HTTP/1.1
Host: api.example.com

HTTP/1.1 451 Unavailable For Legal Reasons
Content-Type: application/json

{"error":"Request cannot be completed"}

Related status codes

400, 401, 402, 403

References

MDN · RFC 9110