Under California law (Code of Civil Procedure § 527.6), a person who has suffered harassment may seek a temporary restraining order and an injunction prohibiting harassment. The California Code of Civil Procedure, § 527.6, provides in part as follows:
A person who has suffered harassment as defined in subdivision (b) may seek a temporary restraining order and an injunction prohibiting harassment as provided in this section.
(b) For the purposes of this section, "harassment" is unlawful violence, a credible threat of violence, or a knowing and willful course of conduct directed at a specific person that seriously alarms, annoys, or harasses the person, and that serves no legitimate purpose. The course of conduct must be such as would cause a reasonable person to suffer substantial emotional distress, and must actually cause substantial emotional distress to the plaintiff.
As used in this subdivision: (1) "Unlawful violence" is any assault or battery, or stalking as prohibited in Section 646.9 of the Penal Code, but shall not include lawful acts of self-defense or defense of others. (2) "Credible threat of violence" is a knowing and willful statement or course of conduct that would place a reasonable person in fear for his or her safety, or the safety of his or her immediate family, and that serves no legitimate purpose. (3) "Course of conduct" is a pattern of conduct composed of a series of acts over a period of time, however short, evidencing a continuity of purpose, including following or stalking an individual, making harassing telephone calls to an individual, or sending harassing correspondence to an individual by any means, including, but not limited to, the use of public or private mails, interoffice mail, fax, or computer e-mail. Constitutionally protected activity is not included within the meaning of "course of conduct."
A civil harassment restraining order is a court order that protects people from harassment. You can ask for this court order if you are worried about your safety because someone stalked, harassed, threatened you with violence, financially abused you, or sexually assaulted you. The court can order a person not to: threaten or harass you, contact or go near you, your home, your work, or have a gun. You can also ask for protection for your family members or other household members. You can get a civil harassment restraining order against people who are not close to you, such as roommates, neighbors, co-workers, or non-immediate family members.
The protective order can be enforced by law enforcement agencies after the defendant has been served.
In some instances, a civil harassment restraining order is not appropriate. You can ask for a domestic violence restraining order if:
A person has abused you, and you have a close relationship with that person (married or registered domestic partners, divorced, separated, dating or used to date, live together, or used to live together*); or
You are related (parent, child, brother, sister, grandmother, grandfather, mother-in-law, son-in-law); or
You have a child with the person.
* You have to be more involved than just roommates.