451

Unavailable For Legal Reasons

4xx Client Error

ELI5

This content is blocked by law or legal restrictions in your area. It's like a book that's banned in your country.

Server perspective

Use 451 when a legal demand prevents the resource from being provided.

When to use

  • •Return 451 for legally compelled blocks, takedowns, or jurisdiction-specific denials
  • •Use it when the denial is specifically legal in nature rather than a generic policy decision
  • •Government censorship or takedown requests
  • •Court-ordered content removal
  • •Geographic legal restrictions
  • •Copyright-related content blocking
  • •Regulatory compliance blocking

How to respond

  • •Include a human-readable explanation in the response body
  • •Optionally include Link with rel="blocked-by" to identify the entity implementing the block

Headers to consider

  • •Link

Response body

  • •Include a concise legal-block explanation and safe metadata about the restriction when appropriate.

Server-side pitfalls

  • •Do not use 451 for ordinary company policy or permission denials; use 403 instead
  • •Do not use the blocked-by Link relation to identify the legal demander when the body should explain that context
  • •General access denied (use 403 Forbidden)
  • •Resource doesn't exist (use 404 Not Found)
  • •Company policy restrictions (use 403 Forbidden)
  • •Authentication required (use 401 Unauthorized)

Examples

Government content blocking

Request:GET https://api.example.test/political-content
Response:451 Unavailable For Legal Reasons # Headers Content-Type: application/json Link: <https://spqr.example.org/legislation>; rel="blocked-by" # Body { "error": "unavailable_for_legal_reasons" }

Content blocked due to government censorship laws

DMCA copyright takedown

Request:GET https://api.example.test/copyrighted-video
Response:451 Unavailable For Legal Reasons # Headers Content-Type: application/json # Body { "error": "unavailable_for_legal_reasons" }

Content removed due to copyright infringement claim

References

Related Status Codes