Why Code Violations Do Not Justify Eviction
Learn how New York eviction law treats building violations, tenant complaints, and landlord retaliation.

Can a landlord evict because of code violations?
In New York, the short answer is no: building code violations do not give a landlord permission to remove a tenant without a court case and a lawful eviction order. Violations may matter in a housing dispute, but they do not erase the landlord’s obligation to follow the legal process before a tenant can be forced out. New York law treats self-help eviction as unlawful, even when the landlord believes the tenant has broken a lease or created problems in the building.
That distinction matters because many tenants assume that once a dispute starts over repairs, inspections, or violations, the landlord can simply end the tenancy. The law works differently. A landlord may seek to recover possession through court, but the process must be formal, evidence-based, and supervised by a judge. If the landlord bypasses that process, the tenant may have claims for damages and restoration of possession.
What code violations usually mean in a housing dispute
Code violations are conditions that fail to meet legal housing standards. They can involve heat, hot water, mold, leaks, unsafe electrical systems, broken locks, fire safety issues, or other conditions that make a home unsafe or unfit. In New York City, tenants are protected when an owner fails to provide required services or maintain the apartment in a habitable condition.
These violations often become important in two different ways. First, they can support a tenant’s claim that the landlord failed to maintain the premises. Second, they can be used defensively if the landlord later starts an eviction case. In other words, violations can affect the merits of a housing dispute, but they do not grant the landlord a shortcut around court.
Why a landlord cannot use “self-help” eviction
Self-help eviction is the phrase used when a landlord tries to force a tenant out without court authorization. Examples include changing the locks, shutting off utilities, removing belongings, threatening physical removal, or blocking access to the apartment. New York law does not allow that approach. A lawful eviction requires notice, a court proceeding, a judgment, and a warrant of eviction carried out by authorized personnel.
This rule applies regardless of the landlord’s complaint. Even if the tenant has not paid rent, overstayed a lease, or received multiple violations, the landlord still must go through the court process. The reason for the dispute does not make self-help legal.
- Changing locks without a warrant is unlawful.
- Shutting off essential services to force a move-out is unlawful.
- Threatening immediate removal without court approval is unlawful.
- Taking belongings or excluding the tenant from the home is unlawful.
How a lawful eviction works in New York
A landlord who wants a tenant removed must begin with the proper notice, then bring a case in Housing Court or Civil Court. The type of case depends on the reason for the eviction. For nonpayment, the landlord must pursue a nonpayment proceeding. For lease violations or holdover claims, the landlord must pursue a holdover proceeding. Either way, the court decides whether the landlord has a valid right to possession.
If the court rules for the landlord, the court may issue a judgment of possession and, if appropriate, a warrant of eviction. Only after that warrant is executed by the proper enforcement officer can the tenant be removed lawfully. The landlord does not personally carry out the eviction.
| Step | What it means | Why it matters |
|---|---|---|
| Notice | The tenant gets the required legal notice | Starts the formal process |
| Court filing | The landlord files a case in court | Lets a judge evaluate the dispute |
| Hearing or trial | Both sides present evidence | Determines whether eviction is allowed |
| Warrant of eviction | The court authorizes removal | Creates the only lawful basis for physical eviction |
| Execution of warrant | An authorized officer carries out the removal | Prevents illegal self-help eviction |
How code violations can help tenants in court
Although violations do not authorize eviction by themselves, they can strengthen a tenant’s position in several ways. A tenant may argue that the landlord has failed to maintain basic services, breached the warranty of habitability, or retaliated after complaints about unsafe conditions. Violations can also support requests for repairs, rent abatements, or other relief, depending on the facts and the case type.
In some situations, code violations may be evidence that the landlord’s eviction case is really a response to the tenant’s complaints. New York law limits retaliation, and if a landlord brings an eviction case soon after a tenant makes a good-faith complaint, the landlord may have to prove that the case is not retaliatory.
- Violations may support a defense that the apartment was not properly maintained.
- Violations may support a claim that rent should be reduced for loss of services.
- Violations may help show the landlord acted in retaliation for complaints.
- Violations may support a request for city enforcement or housing court relief.
When repairs and eviction become linked
Repair disputes and eviction disputes often overlap. A tenant who reports serious conditions may later face a notice alleging nonpayment or some other lease problem. That timing can matter. New York’s residential tenant protections recognize that a landlord should not be able to punish a tenant for raising legitimate housing complaints.
For tenants, the key is to document everything. Written complaints, photographs, inspection reports, city violation notices, and repair requests can all help establish the timeline. For landlords, the key is to show a legitimate, non-retaliatory basis for any court case and to address code issues promptly and properly.
What tenants can do after an illegal lockout or forced removal
If a tenant is locked out, the first priority is to restore access and create a record of what happened. New York City guidance notes that tenants can report an illegal lockout to the police and can also begin an illegal lockout case in Housing Court. Under New York law, a tenant who is unlawfully removed may seek damages, including treble damages in some cases.
The available remedies can include getting back into the home, recovering money for losses, and seeking attorney’s fees and costs where allowed. The specific remedy depends on the circumstances, but the law clearly rejects landlord self-help. The tenant does not lose protection simply because the landlord believes the apartment had code violations or the lease was violated.
- Contact the police if the landlord has changed the locks or barred entry.
- Save messages, notices, photos, and witness statements.
- Keep records of damaged or missing property.
- Seek court help quickly to preserve rights.
How New York City tenants should document housing conditions
Documentation is one of the most practical tools a tenant has. Code violations are easier to prove when the tenant has a clear paper trail. That means keeping copies of repair requests, violation records, building notices, and photos showing the condition of the apartment or common areas. It also means writing down dates, times, and the names of any building staff or inspectors involved.
Good documentation can help in several ways. It can support a complaint to the city, prepare a defense if the landlord files in housing court, and show whether the landlord responded reasonably. It can also help distinguish a real repair dispute from a pretextual eviction claim.
Common misconceptions about violations and eviction
One common misconception is that a landlord can evict a tenant immediately if the apartment has serious violations. That is not true. Another misconception is that code violations automatically excuse rent nonpayment or automatically end the lease. Those outcomes usually depend on the facts and on what the court decides, not on the landlord’s personal judgment.
A third misconception is that a tenant who complains about unsafe conditions is somehow at greater legal risk. In reality, New York law gives tenants tools to challenge retaliation and unsafe housing conditions. The presence of violations may change how a judge views the case, but it does not eliminate the tenant’s rights.
Frequently asked questions
Can a landlord evict me just because the building has violations?
No. Violations do not let a landlord skip the court process or force a tenant out on their own.
Can I be removed for complaining to the city?
Not lawfully. New York law restricts retaliation against tenants who make good-faith complaints about housing conditions.
What if my landlord changes the locks?
That is generally treated as an unlawful lockout. Tenants can seek police assistance and can also bring a court case to regain access and pursue damages.
Do violations help me in court?
Yes, they can. They may support defenses, repair claims, habitability arguments, or retaliation claims, depending on the case.
Can the landlord or superintendent remove my belongings?
Not lawfully without proper court authority. A landlord cannot use private force or unilateral action to evict a tenant.
What this means for tenants and landlords
For tenants, the main lesson is that unsafe conditions and eviction are separate legal issues. A tenant may have strong claims about repairs, habitability, or retaliation, yet still need to respond carefully if a court case begins. For landlords, the lesson is that even a serious housing dispute must be handled through the legal system, not through confrontation or lock changes.
When a building has code violations, the best path is usually to address the conditions, preserve records, and use the court or administrative process where needed. New York law is structured to resolve these disputes through evidence and procedure, not through force.
References
- What Constitutes an Illegal Eviction in NYC? — Gary J. Wachtel, Esquire. 2024. https://garywachtel.com/what-constitutes-an-illegal-eviction-in-nyc/
- § 26-413 Enforcement and penalties — New York City Administrative Code. 2026. https://codelibrary.amlegal.com/codes/newyorkcity/latest/NYCadmin/0-0-0-47272
- Residential Tenants’ Rights Guide — New York State Office of the Attorney General. 2026. https://ag.ny.gov/publications/residential-tenants-rights-guide
- General Eviction Information for New York — LawNY. 2026. https://www.lawny.org/page/69/general-eviction-information-new-york
- Tenant Rights and Responsibilities — NYC Department of Housing Preservation and Development. 2026. https://www.nyc.gov/site/hpd/services-and-information/tenants-rights-and-responsibilities.page
- Tenant Rights After Building Code Violations in NYC — Outerbridge Law. 2026. https://www.outerbridgelaw.com/blog/tenant-rights-after-building-code-violations-in-nyc/
- Housing & Legal Assistance — NYC Rent Guidelines Board. 2026. https://rentguidelinesboard.cityofnewyork.us/resources/legal-assistance/
- Landlord Duties, Responsibilities and Rights — New York City Bar. 2026. https://www.nycbar.org/get-legal-help/article/landlord-tenant/landlords-duties-obligations/
Read full bio of medha deb








