Every local government has a set of building codes on the books, and it’s the responsibility of every property owner to adhere to those codes. Building codes ensure that every property is safe to inhabit and doesn’t present a threat to the safety of people around it. It’s in everyone’s interest that you keep your home “to code,” which is why you need to pull a permit when doing major repairs or renovations to your house (and why you should look into the permit history of any property you’re considering buying).

Most regular, minor maintenance projects don’t require permits—but they can trigger erroneous code violations. Most municipalities employ code enforcement professionals who respond to complaints and who can—and often do—make visual observations of the properties in the local area they cover. That means that if a neighbor files a complaint about a perceived code violation or an inspector sees something from the street that looks like a code violation, you might receive a code enforcement notice, which could include a fine as well as a requirement to pay for retroactive permits, or possibly to have the work removed if it’s deemed a violation of the existing building codes.

Reasons for a notice

The specific laws governing code enforcement, inspections, and violations vary from locality to locality, so you’ll have to do some research to familiarize yourself with your local laws. In general, code enforcement inspectors can’t just enter your private property without a legally binding court order (e.g., a warrant). But if they see something from the street, they can issue a violation based on that.

Sometimes, maintenance work can be misinterpreted. For example, if you have concrete steps in front of your house and you patch some cracks or apply a top coat to both refresh and protect them, it might look like you’re doing masonry work without a permit. If an inspector—or a nosy neighbor—notices, you might get an erroneous enforcement order. Other commonly misinterpreted maintenance projects include any roof work, window repairs, or sidewalk repair.

Don’t bother trying to sue

One thing to be clear on: Even if you feel like the code enforcement officer (or neighbor) is maliciously targeting you and citing you for code violations in bad faith, you probably can’t sue the inspector. Like most government employees, code enforcement officers are usually considered to have some form of qualified immunity against legal action.

You might be able to sue the county or city government, but proving a conspiracy to target your home with violations is going to be tough. Your best course of action is going to be going through the legal channels outlined below instead of calling your lawyer and vowing to salt the earth with your litigation.

Steps to take

If you receive a code enforcement notice concerning maintenance work that didn’t require a permit, or permitted work that you believe was done to code, take the following steps:

Gather documentation. First, get your ducks in a row. This is especially crucial if the inspector is incorrect about an aspect of your project. If the repair was a minor, superficial change (like a topcoat on a set of concrete steps), be prepared to show receipts for materials purchased and to describe in detail the work performed. Take photos, as the inspector may not have been able to get close enough to see what’s really going on (and if you have any kind of time-stamped “before” photos or video, even better)

Research. You should know the code you’ve been accused of violating. Decoding these can be challenging, so you might consider consulting a contractor or engineer if you know one. A good starting place to see your state’s building codes is here; although your local county or municipality may have their own code, the state code is a good starting place. You don’t need to be an expert overnight, but if you can speak intelligently as to the specific violation you’re accused of, you’ll have a better chance of getting the violation dismissed.

Contact the appropriate department. The enforcement notice will include contact information for the appropriate department in your local government. Use it. Armed with your evidence, respond in writing and clearly explain a) the purpose and scope of the work; b) why it did not require a permit (or evidence that you actually did pull a permit for it); and c) anything else that seems relevant. Following up with a phone call isn’t a bad idea—but don’t be angry or insulting.

If you truly didn’t violate any local building codes, this will usually be sufficient to clear up the problem. Sometimes the enforcement office will dismiss the violation if you make adjustments to your work even if you did inadvertently violate the building code.

Pull retroactive permits. If it turns out that you should have pulled a permit for your project, you may be able to apply for a retroactive permit, which is simply a permit issued after work has concluded, and scheduling the required inspections. This might require you to undo some portion of the work if the inspectors need to see inside something (and might possibly entail a small fine) but usually won’t require tearing everything out and starting from scratch.

Not all localities offer retroactive permits, however, so don’t assume you can do the work and apologize later.

Attend a hearing. If you can’t resolve the matter with a letter of explanation or other action, there will almost certainly be a hearing scheduled for your case (again, the exact procedure will vary depending on your location—here is how it works in King County, Washington as a random example; you should research the procedures followed in your area). Generally, though, this is just what it sounds like—you will usually have an opportunity to present your case, and a decision will be rendered regarding the alleged violation. You’re usually allowed to have an attorney if you want one, though it’s not required.

At the end of the hearing, a final decision will be reached regarding your violation. You might be able to appeal it, if you want to keep fighting, but at this point paying a small fine and cutting your losses might be your best option.