Tenant Right to Repair and Deduct in NYC

Tenants in New York City rely on their landlords for safe, decent housing. When important repairs are ignored, like leaks or heating issues, tenants may feel trapped. One option they sometimes consider is the tenant right to repair and deduct. This means a renter can make repairs themselves and subtract the cost from their next rent. But is this legal in New York? What risks come with this action?