How can I return HTTP 403 from a template? I'm building a rough JSON API using normal Craft templates (i.e. rendering the JSON with Twig) but would like to be able to return HTTP 403 to unauthenticated requests.

For example:

{% if not user %}
    {% respond 403 %}
{% endif %}


Is something like this built in?
Exit tag is what you're looking for.

{% exit 403 %}