Yeah, it's illegal to shout "fire" in a crowded theater, but if you hook up the fire-alarm to a web-api, the responsibility for the ensuing chaos disappears.
https://en.wikipedia.org/wiki/Shouting_fire_in_a_crowded_the...
You can contrive situations where it falls within the bounds of the law (for instance, if you do it as part of a play in a way that everyone understands it’s not real) but if you interpret it the way it’s meant to be interpreted it’s breaking a law pretty much anywhere.