California state law (Cal. Civ. Code § 1942.5) prohibits landlords from retaliating against tenants.
It is illegal for a landlord to retaliate against a tenant in California who has exercised a legal right, including:
The kinds of retaliatory acts covered by California law include terminating a tenancy or filing an eviction lawsuit; increasing the rent; or decreasing services, such as locking the laundry room. California state law presumes retaliation if the landlord acts in these types of negative ways within 180 days of the date that a tenant has exercised a legal right, such as complaining to the landlord about an unsafe heater in the apartment.
Depending on the situation, there are several ways a tenant may respond to the retaliation, such as by staying and fighting an eviction lawsuit or filing a suit in small claims court.
Fora advice on suspected landlord retaliation and other tenant issues, see Tenants Together, a statewide tenants's rights organization. Another useful resource on landlord-tenant law is LawHelpCA. Also, the Nolo book California Tenants’ Rights includes provides more detail on illegal retaliatory evictions.
Also, check your local housing ordinances, particularly if you are covered by rent control, for any city or county rules that protect tenants from landlord retaliation. To find yours, call your mayor or city manager’s office or check your city or county website.