What counts as a "structure" under a building code for enforcement purposes

Every code enforcement officer has stood at a property line arguing a point that sounds like semantics but isn't: is that thing a structure, and did it need a permit. The answer decides whether you write a notice of violation or walk away.
Structure vs. building: the definition that does the work
Most adopted codes (IBC, IRC, and the state or local amendments layered on top) define "building" narrowly: a structure with a roof, intended for shelter of persons, animals, or property. "Structure" is the broader term, and it's usually defined as anything built or constructed, with an inherently fixed location, whether or not it's affixed to the ground. That second definition does the heavy lifting in the field. It's why a retaining wall over a certain height, a freestanding sign, a swimming pool, and a 200-square-foot deck all land in your jurisdiction even though none of them have four walls and a roof.
The question that controls enforcement is whether the thing meets the code's definition of a structure, and whether that meeting triggers a permit threshold under your local amendments. Those two questions have different answers depending on the municipality, which is exactly why a definition that reads cleanly in the code book gets messy on a site visit.
Where accessory structures get argued
Accessory structures are where most of the pushback happens, because almost every jurisdiction carves out exemptions by size. A 120-square-foot shed might be exempt from permitting in one town and require a permit plus a setback variance in the next. Pergolas and gazebos sit in a gray zone: some codes treat an open-sided structure without a roof deck as exempt regardless of footprint, others count any permanent footing as triggering the requirement. Carports, detached garages, and pool enclosures almost always require a permit once they exceed the accessory-structure exemption, but the owner rarely knows that, and the contractor who built it off a stock plan from out of state definitely didn't check.
A few patterns show up often enough to be worth knowing cold:
- Decks attached to a dwelling and more than 30 inches off grade almost universally require a permit, even when the jurisdiction exempts small detached sheds.
- Fences are structures under most definitions but are commonly exempted up to a height limit, with pool-enclosure fencing carved back out as a safety exception.
- Retaining walls get exempted by height, often 4 feet measured from the bottom of the footing, not the exposed face, a distinction that trips up both owners and officers.
- Accessory dwelling units, however small, meet the code's definition of a building. That means they carry no exemption, no matter what label the owner puts on the permit application, or whether the owner filed an application at all.
None of this is universal. Pulling the actual definitions section and the accessory-structure exemption table from your adopted code, not the model code's boilerplate, is the only way to answer the question for your jurisdiction. The IBC and IRC set the frame; your municipality's amendments set the thresholds that matter when you're standing on the parcel.
Why the definition matters more once you stop relying on complaints
A tight definition only helps if you can act on it consistently. Most departments find out about an unpermitted structure when a neighbor calls, which means enforcement tracks who's willing to report, not what's actually out there. A shed gets built in a rear yard with no visible road frontage and sits for six years until a resale title search flags it, or doesn't.
That's the gap Unpermitted Construction Detection is built to close: quarterly comparisons of the built environment against your permit register, flagged by parcel, so the structures nobody declared surface on their own instead of waiting for a complaint.
If your definitions section is solid but your discovery method is still a windshield survey, it might be worth seeing what a parcel-level comparison catches that drive-bys don't.