If the restriction is due to legal reasons, then the appropriate HTTP error code is [HTTP 451, "Unavailable due to legal reasons."](https://en.wikipedia.org/wiki/HTTP_451)

This is typically used in the case of material that has been revoked due to DMCA action or lawsuits due to harassment campaigns or the like, but the [spirit and letter of the response definition](https://www.rfc-editor.org/rfc/rfc7725) states:

> This document specifies a Hypertext Transfer Protocol (HTTP) status
> code for use when resource access is denied as a consequence of legal
> demands.

The code itself is a reference to [Fahrenheit 451](https://en.wikipedia.org/wiki/Fahrenheit_451) by Ray Bradbury.