It is not legal to threat someone, rather it constitutes an offense of Criminal Intimidation which is mentioned in section 506 PPC. If a simple threat is given to someone then it is covered under the provisions of section 506 (i) PPC and its punishment is 3 years.
Similarly if someone is given life threat then such a threat is covered under the provisions of section 506 (ii). Such offense is punishable with an imprisonment of 7 years. If someone is threatened on telephone then section 25-D is also added in the list of offenses.
Whenever a person is threatened by anyone, such person shall reach the nearest police station without any delay and report the incident for proper criminal action against the culprit so doing it.
For more, you can consult firstname.lastname@example.org or call +923123450006