
945 A.2d 18 (2008)
Paul McNAMARA and another
v.
Barry R. HERSH and another.
No. 2007-225.
Supreme Court of New Hampshire.
Argued: January 31, 2008.
Opinion Issued: April 4, 2008.
*19 Sheehan Phinney Bass + Green, P.A., of Manchester (Robert H. Miller, on the brief and orally), for the petitioners.
Rath, Young and Pignatelli, P.C., of Concord (Andrew W. Serell, on the brief and orally), and Donahue, Tucker & Ciandella, PLLC, of Portsmouth (Christopher L. Boldt, on the brief and orally), for the respondents.
DUGGAN, J.
The petitioners, Paul and Barbara McNamara, appeal a decision of the. Superior Court (Smukler, J.) dismissing their declaratory judgment petition against the respondents, Barry and Terry Hersh and the Town of Sanbornton (Town). We affirm.
The McNamaras allege the following. The Hershes own a lot on Broadview Drive in Sanbornton. The McNamaras own an abutting lot. On January 12, 2005, the Town Board of Selectmen issued a building permit to the Hershes' predecessors in title to construct a new residence. The Town Board of Selectmen later transferred the building permit to the Hershes. On June 15, 2005, the McNamaras purchased their home, not knowing that a building permit had been issued on the abutting lot. The Hershes began to construct their residence in mid-October 2005. The McNamaras never appealed the decision to issue the building permit to the local zoning board of adjustment. See RSA 674:33, I-III (1996); RSA 676:5 (1996).
*20 On August 21, 2006, the McNamaras sought a declaratory judgment that the building permit was unlawfully issued and thus void. Their primary argument was that the local ordinance only permitted building on ten percent of the land, but the permit allowed building on thirteen percent of the land. The Town moved to dismiss, arguing that the McNamaras had failed to exhaust their administrative remedies. The trial court ruled in the Town's favor, and this appeal followed.
In reviewing a motion to dismiss, "our standard of review is whether the allegations in the [petitioners'] pleadings are reasonably susceptible of a construction that would permit recovery." K & B Rock Crushing v. Town of Auburn, 153 N.H. 566, 568, 904 A.2d 697 (2006) (quotation omitted). We assume the McNamaras' pleadings to be true and construe all reasonable inferences in the light most favorable to them. Id. We then engage in a threshold inquiry that tests the facts in their petition against the applicable law, and if the allegations constitute a basis for legal relief, we must hold that it was improper to grant the motion to dismiss. Konefal v. Hollis/Brookline Coop. School District, 143 N.H. 256, 258, 723 A.2d 30 (1998).
The central issue in this case is whether the McNamaras' declaratory judgment action was barred because they failed to exhaust their administrative remedies. Ordinarily, challenges to decisions regarding building permits must first be made to the zoning board of adjustment. See RSA 674:33; RSA 676:5; RSA 677:3 (1996). Should a party be dissatisfied with the result from the local zoning board, the party may then appeal to the superior court. See RSA 677:4 (Supp.2007). The legislature enacted this scheme to give the local zoning board the "first opportunity to pass upon any alleged errors in its decisions so that the court may have the benefit of the board's judgment in hearing the appeal." Robinson v. Town of Hudson, 154 N.H. 563, 567, 914 A.2d 239 (2006) (citation omitted). Here, the McNamaras did not follow this statutory procedure. They argue, however, that they need not have done so because their challenge to the building permit raises a pure question of law. We disagree.
Generally, parties must exhaust their administrative remedies before appealing to the courts. See Metzger v. Brentwood, 115 N.H. 287, 290, 343 A.2d 24 (1975). This rule is "based on the reasonable policies of encouraging the exercise of administrative expertise, preserving agency autonomy and promoting judicial efficiency." Bradley v. City of Manchester, 141 N.H. 329, 331-32, 682 A.2d 1194 (1996) (quotation omitted). However, this rule, as applied, is flexible, and recognizes that exhaustion is not required under some circumstances. Metzger, 115 N.H. at 290, 343 A.2d 24. In limited situations, it is unnecessary to "burden local legislative bodies and [zoning boards] with the responsibility for rulings on subjects that are beyond their ordinary competence." Blue Jay Realty Trust v. City of Franklin, 132 N.H. 502, 509, 567 A.2d 188 (1989). Thus, a petitioner need not exhaust administrative remedies and may bring a declaratory judgment action to challenge the decisions of municipal officers and boards when the action raises a question that is "peculiarly suited to judicial rather than administrative treatment and no other adequate remedy is available." Olson v. Town of Litchfield, 112 N.H. 261, 262, 296 A.2d 470 (1972). Judicial treatment may be particularly suitable when the constitutionality or validity of an ordinance is in question or when the agency at issue lacks the authority to act. Metzger, 115 N.H. at 290, 343 A.2d 24. These are the types of legal *21 issues "as to which specialized administrative understanding plays little role." Ashland School Dist. v. N.H. Div. for Children, 141 N.H. 45, 47-48, 681 A.2d 71 (1996).
For example, in Pheasant Lane Realty Trust v. City of Nashua, 143 N.H. 140, 141, 720 A.2d 73 (1998), the City of Nashua sought to issue a supplemental tax bill on the subject property. Pheasant Lane Realty Trust argued that the city lacked the authority to do so. Pheasant Lane Realty Trust, 143 N.H. at 141, 720 A.2d 73. On appeal, we held that whether the City had the authority to issue a supplemental assessment presented a question of statutory interpretation better suited for judicial review. Id. at 142, 720 A.2d 73. Accordingly, we ruled that Pheasant Lane Realty Trust was not required to exhaust administrative remedies. Id. Similarly, we held in Porter v. Town of Sandwich, 153 N.H. 175, 176, 891 A.2d 521 (2006), that questions regarding whether the city's assessment violated an agreement and/or a statute were better suited for judicial review, and thus exhaustion was not required. Id. at 175-76, 891 A.2d 521.
In Blue Jay Realty Trust, the petitioners challenged the validity of amendments to the city's zoning ordinance by filing a declaratory judgment petition. Blue Jay Realty Trust, 132 N.H. at 503, 567 A.2d 188. On appeal, we held that the petitioners need not exhaust their administrative remedies because "the charges of invalidity raised by th[e] petition require[d] determinations of statutory and constitutional law, not customarily passed upon by city councils." Id. at 509, 567 A.2d 188; see also Ashland School Dist, 141 N.H. at 47-48, 681 A.2d 71 (holding that statutory provisions setting forth financial obligations of local school districts did not require administrative appeal); Metzger, 115 N.H. at 291, 343 A.2d 24 (holding that whether closed town road was "public right of way" was narrow legal question that did not require an application for a rehearing before appeal to superior court).
By contrast, in Property Portfolio Group, LLC v. Town of Derry, 154 N.H. 610, 616-17, 913 A.2d 750 (2006), we held that an abutter's challenge to the procedural irregularities of the planning board's decision did not raise a question of law, but rather contested the planning board's exercise of administrative discretion, and thus exhaustion was required. The issues raised by the abutter were better suited for administrative treatment, as the administrative authority had the ability to consider and weigh all the facts presented. See id. at 617, 913 A.2d 750; see also Konefal, 143 N.H. at 259, 723 A.2d 30 (holding that because the petitioner's claims required resolution of disputed fact, they were questions of administrative discretion and required her to exhaust her administrative remedies).
We also note that in some limited circumstances even constitutional challenges to zoning ordinances may require a party to exhaust its administrative remedies before bringing a declaratory judgment petition. See Town of Auburn v. McEvoy, 131 N.H. 383, 384, 553 A.2d 317 (1988). For example, in McEvoy, the defendant McEvoy conveyed a subdivision lot to the Town in 1979 in compliance with a zoning ordinance later held to be unconstitutional in J.E.D. Associates, Inc. v. Town of Atkinson, 121 N.H. 581, 432 A.2d 12 (1981). McEvoy, 131 N.H. at 384, 553 A.2d 317. After being made aware of this decision, the defendants sought to apply it to their subdivisions. Id. The Town refused. Id. We held that the failure of the defendant to appeal the 1979 planning board order within thirty days precluded relief. Id. at 385, 553 A.2d 317. We noted that although the constitutionality of a zoning *22 ordinance is an issue peculiarly suited for judicial review, "the legislature obviously expressed an intent to endue such an order with finality." Id. The Town had a great interest in the finality of the order out of fairness to the third parties who later purchased the lots. Id. Because the constitutional challenge was not raised in an appeal to the planning board in 1979, the defendant was not then entitled to raise the issue five years later. Id. at 388, 553 A.2d 317.
The only question raised in the McNamaras' declaratory judgment petition, whether a building permit complies with the ordinance, is not a question that is peculiarly suited to judicial treatment or resolution. Olson, 112 N.H. at 262, 296 A.2d 470. This is a question that is routinely resolved by the local zoning board. The McNamaras are not challenging the validity or constitutionality of the Town's zoning ordinance, nor do they argue that the Town lacked statutory authority to issue a permit. Rather, the alleged error is that the permit violates the ordinance, an error that is within the power of the zoning board to correct. The McNamaras' proper remedy, therefore, was to appeal to the zoning board. Here, "exact compliance" with the statutory procedure would have allowed the board "to reassess the facts and to use its expertise to reach a different conclusion," which may have obviated the need for judicial review. Metzger, 115 N.H. at 291, 343 A.2d 24. Even if the issue the McNamaras wished to raise was peculiarly suited to judicial resolution, they still would not be allowed to bring a declaratory judgment petition after the appeal period expired, as that would undermine the finality of the Town Board's decision and leave the Hershes subject to uncertainty as to their rights. See McEvoy, 131 N.H. at 385, 553 A.2d 317.
The trial court specifically found that "[t]he McNamaras could have appealed the issuance of this building permit within a reasonable time after they discovered that the building permit had been issued. They failed to do so." On appeal the McNamaras do not challenge this ruling. Thus, to allow the McNamaras to bring their declaratory judgment petition directly to superior court "would serve neither the purpose of the statute[s] nor the policies behind the exhaustion rule." Metzger, 115 N.H. at 290, 343 A.2d 24. Accordingly, we hold that the trial court did not err in dismissing the McNamaras' declaratory judgment petition.
Affirmed.
BRODERICK, C.J., and DALIANIS, GALWAY and HICKS, JJ., concurred.
