Skip to content

For developers & agents

Stormwater permit determinations, callable by an agent

A construction or environmental compliance agent mid-task needs to know whether a site needs permit coverage, which permit governs it, how often it must be inspected and when stabilisation is due, with the permit section it can show its user. Basinwise exposes the same engine behind the site as a REST API and a hosted MCP server, so an agent calls a tool instead of reasoning about a permit from memory.

Quickstart

No key, no signup, one call

Every endpoint works at the anonymous rate with no key. Describe a site and get the governing permit, the eligibility screens and the requirements back, each with the permit section it came from.

request

curl -X POST https://basinwise.vercel.app/api/v1/determine \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: determine-demo-1" \
  -d '{"state":"MA","activity":"construction","disturbedAcres":6.5,"partOfLargerPlan":false}'

response 200

{
  "data": {
    "coverage": "required",
    "coverageReason": "The project disturbs 6.5 acres, at or above the 1 acre threshold, so it needs permit coverage.",
    "permit": {
      "id": "federal-cgp",
      "name": "2022 Construction General Permit",
      "permitNumber": null,
      "version": "2022 CGP (as modified 2025)",
      "authority": "U.S. Environmental Protection Agency",
      "agencyName": "U.S. Environmental Protection Agency",
      "agencyUrl": "https://www.epa.gov/npdes/stormwater-discharges-construction-activities",
      "permitUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
      "effectiveDate": "2022-02-17",
      "expiryDate": "2027-02-16",
      "confidence": "verified"
    },
    "jurisdiction": {
      "code": "MA",
      "name": "Massachusetts",
      "npdesAuthorized": false,
      "agencyName": "U.S. Environmental Protection Agency (EPA Region 1)",
      "agencyUrl": "https://www.epa.gov/npdes/2022-construction-general-permit-cgp",
      "credential": {
        "required": null,
        "name": "Registered professional engineer",
        "sourceUrl": "https://www.mass.gov/doc/stormwater-report-checklist/download",
        "confidence": "unverified"
      },
      "confidence": "verified",
      "note": "EPA is the permitting authority. Coverage is under EPA's 2022 CGP, permit area MAR100000. MassDEP administers separate state wetlands and water quality requirements that were not verified here; confirm state and municipal requirements alongside the federal permit. The 2022 CGP as modified became effective April 8, 2025 and expires February 16, 2027; confirm the successor permit near that date. Credential: the 2022 CGP imposes no SWPPP preparer credential. It does require inspections by a 'qualified person' (Part 4.1), which is an inspection credential, not a preparation credential."
    },
    "eligibilityScreens": [
      {
        "id": "esa",
        "label": "Endangered species screening",
        "status": "action_required",
        "detail": "You must document that you meet one of the endangered species protection criteria before coverage begins. This is a screening you complete, not one we can complete for you.",
        "citation": {
          "sourceCitation": "Part 1.1.5 (criteria labels corroborated at Part 9.2.1, Seneca Nation)",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "You can demonstrate you meet one of the criteria in the Endangered Species Protection section of the Notice of Intent (NOI) that you submit for coverage under this permit, per Part 1.4, with respect to the protection of Federally listed",
          "confidence": "verified"
        }
      },
      {
        "id": "historic",
        "label": "Historic properties screening",
        "status": "action_required",
        "detail": "You must complete the historic properties screening process and keep the documentation with your plan.",
        "citation": {
          "sourceCitation": "Part 1.1.6 (documentation duty at Part 7.2.9b)",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "You have completed the screening process in Appendix E relating to the protection of historic properties; and",
          "confidence": "verified"
        }
      },
      {
        "id": "receiving-water",
        "label": "Receiving water sensitivity",
        "status": "unknown",
        "detail": "You have not confirmed whether the site discharges to a sediment or nutrient impaired water or a Tier 2, 2.5 or 3 water. This changes your inspection frequency, so confirm it before relying on the answer above.",
        "citation": {
          "sourceCitation": "Part 3.2",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "For any portion of the site that discharges to a sediment or nutrient-impaired water or to a water that is identified by your State, Tribe, or EPA as Tier 2, Tier 2.5, or Tier 3 for antidegradation purposes, 57 you must comply with the",
          "confidence": "verified"
        }
      },
      {
        "id": "prohibited",
        "label": "Prohibited discharges",
        "status": "action_required",
        "detail": "Certain discharges are prohibited outright, including concrete washout wastewater unless managed by an approved control. Review the prohibited discharge list against your site activities.",
        "citation": {
          "sourceCitation": "Parts 1.3.1 - 1.3.5",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "Wastewater from washout of concrete, unless managed by an appropriate control as described in Part 2.3.4; 1.3.2 Wastewater from washout and/or cleanout of stucco, paint, form release oils, curing compounds, and other construction",
          "confidence": "verified"
        }
      }
    ],
    "requirements": [
      {
        "id": "inspection.frequency.option1",
        "kind": "inspection",
        "label": "Inspection frequency, option 1",
        "detail": "At least once every seven (7) calendar days",
        "value": 7,
        "citation": {
          "sourceCitation": "Part 4.2.1",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "At least once every seven (7) calendar days; or",
          "confidence": "verified"
        },
        "because": "You have not confirmed whether the site discharges to an impaired or high quality water. If it does, the increased frequency applies instead and this answer changes."
      },
      {
        "id": "inspection.frequency.option2",
        "kind": "inspection",
        "label": "Inspection frequency, option 2",
        "detail": "Once every 14 calendar days AND within 24 hours of a storm event producing 0.25 inches or more of rain in a 24-hour period, or of a discharge caused by snowmelt from a storm event producing 3.25 inches or more of snow in a 24-hour period.",
        "value": 14,
        "citation": {
          "sourceCitation": "Part 4.2.2 (with Parts 4.2.2a and 4.2.2b)",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "Once every 14 calendar days and within 24 hours 67 of the occurrence of: A storm event that produces 0.25 inches or more of rain within a 24-hour period. If a storm event produces 0.25 inches or more of rain within a 24-hour period",
          "confidence": "verified"
        },
        "because": "You have not confirmed whether the site discharges to an impaired or high quality water. If it does, the increased frequency applies instead and this answer changes."
      },
      {
        "id": "inspection.report.deadline",
        "kind": "recordkeeping",
        "label": "Inspection report deadline",
        "detail": "Complete the inspection report within 24 hours of completing the site inspection.",
        "value": 24,
        "citation": {
          "sourceCitation": "Part 4.7.1",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "You must complete an inspection report within 24 hours of completing any site inspection.",
          "confidence": "verified"
        }
      },
      {
        "id": "inspection.qualifiedPerson",
        "kind": "inspection",
        "label": "Who may inspect",
        "detail": "The person inspecting the site may be a member of your staff or a third party you hire. You are responsible for ensuring that any person conducting inspections is a \"qualified person\", meaning someone who has completed the training required by Part 6.3.",
        "value": null,
        "citation": {
          "sourceCitation": "Part 4.1",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "You are responsible for ensuring that any person conducting inspections pursuant to this Part is a “qualified person.” A qualified person is someone who has completed the training required by Part 6.3.",
          "confidence": "verified"
        },
        "because": "This is why Basinwise cannot perform your inspections. The permit requires a trained person physically on the site."
      },
      {
        "id": "stabilization.initiate",
        "kind": "stabilization",
        "label": "Initiate stabilisation",
        "detail": "\"Immediately\" means as soon as practicable, but no later than the end of the next business day, following the day when the construction activities have temporarily or permanently ceased.",
        "value": null,
        "citation": {
          "sourceCitation": "Part 2.2.14a, Table 2 (definition at footnote 39)",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "In the context of this provision, “immediately” means as soon as practicable, but no later than the end of the next business day, following the day when the construction activities have temporarily or permanently ceased.",
          "confidence": "verified"
        },
        "because": "This applies at both land disturbance amounts."
      },
      {
        "id": "stabilization.complete",
        "kind": "stabilization",
        "label": "Complete stabilisation",
        "detail": "Complete the installation of stabilization measures as soon as practicable, but no later than seven (7) calendar days after stabilization has been initiated.",
        "value": 7,
        "citation": {
          "sourceCitation": "Part 2.2.14a, Table 2 row ii",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "Complete the installation of stabilization measures as soon as practicable, but no later than seven (7) calendar days after stabilization has been initiated.",
          "confidence": "verified"
        },
        "because": "You have not told us how much land will be open at any one time, so we have assumed the whole 6.5 acres are, which takes the 7 day deadline. The permit measures this on land disturbed at any one time, not the project total: if you phase the work so no more than five acres are open at once, stabilising finished ground before opening more, the deadline is 14 days instead. Tell us your concurrent acreage to get the answer that applies to your site."
      },
      {
        "id": "filing.swpppBeforeNoi",
        "kind": "filing",
        "label": "Plan before Notice of Intent",
        "detail": "Develop the plan before submitting your Notice of Intent for coverage.",
        "value": null,
        "citation": {
          "sourceCitation": "Part 1.4.1",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "You must develop a SWPPP consistent with Part 7 before submitting your NOI for coverage under this permit.",
          "confidence": "verified"
        }
      },
      {
        "id": "filing.noi",
        "kind": "filing",
        "label": "Notice of Intent deadline",
        "detail": "At least 14 calendar days before commencing construction activities",
        "value": 14,
        "citation": {
          "sourceCitation": "Part 1.4 (deadline value from Part 1.4.3, Table 1)",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "must submit to EPA a complete and accurate NOI in accordance with the deadlines in Table 1 prior to commencement of construction activities",
          "confidence": "verified"
        },
        "because": "This is the deadline for a new site. A transfer to a new operator or an emergency related project has a different deadline."
      },
      {
        "id": "filing.not",
        "kind": "filing",
        "label": "Notice of Termination deadline",
        "detail": "Submit the Notice of Termination within 30 calendar days of meeting a termination condition.",
        "value": 30,
        "citation": {
          "sourceCitation": "Part 8.4",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "You must submit an NOT within 30 calendar days after any one of the conditions in Part 8.2 occurs.",
          "confidence": "verified"
        }
      },
      {
        "id": "corrective.minor",
        "kind": "corrective_action",
        "label": "Corrective action, minor fix",
        "detail": "By the close of the next business day after discovering the condition.",
        "value": null,
        "citation": {
          "sourceCitation": "Part 5.2.1b",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "When the problem does not require a new or replacement control or significant repair, the corrective action must be completed by the close of the next business day; or",
          "confidence": "verified"
        }
      },
      {
        "id": "corrective.major",
        "kind": "corrective_action",
        "label": "Corrective action, major fix",
        "detail": "Within 7 calendar days of discovery.",
        "value": 7,
        "citation": {
          "sourceCitation": "Part 5.2.1c",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "When the problem requires a new or replacement control or significant repair, install the new or modified control and make it operational, or complete the repair, by no later than seven (7) calendar days from the time of discovery.",
          "confidence": "verified"
        }
      },
      {
        "id": "corrective.documentation",
        "kind": "recordkeeping",
        "label": "Corrective action log entries",
        "detail": "Record the condition within 24 hours of identifying it, and record completion within 24 hours of completing the work.",
        "value": null,
        "citation": {
          "sourceCitation": "Part 5.4.1a",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "Within 24 hours of identifying the corrective action condition, document the specific condition and the date and time it was identified.",
          "confidence": "verified"
        }
      },
      {
        "id": "retention.inspection",
        "kind": "recordkeeping",
        "label": "Record retention",
        "detail": "Retain inspection reports and the corrective action log for at least 3 years from the date permit coverage expires or is terminated.",
        "value": 3,
        "citation": {
          "sourceCitation": "Part 4.7.4",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "You must retain all inspection reports completed for this Part for at least three (3) years from the date that your permit coverage expires or is terminated.",
          "confidence": "verified"
        },
        "because": "The clock runs from permit expiry or termination, not from when the record was written, so on a multi year project every record stays live for the whole project plus three years."
      },
      {
        "id": "buffer.trigger",
        "kind": "buffer",
        "label": "Natural buffer",
        "detail": "Provide and maintain a natural buffer or equivalent erosion and sediment controls where a surface water lies within 50 feet of the disturbance.",
        "value": 50,
        "citation": {
          "sourceCitation": "Part 2.2.1",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "Provide and maintain natural buffers and/or equivalent erosion and sediment controls for discharges to any receiving waters that is located within 50 feet of the site’s earth disturbances.",
          "confidence": "verified"
        }
      }
    ],
    "derivation": [
      {
        "step": "Coverage threshold",
        "result": "The project disturbs 6.5 acres, at or above the 1 acre threshold, so it needs permit coverage.",
        "citation": {
          "sourceCitation": "Part 1.1.2",
          "sourceUrl": "https://www.epa.gov/system/files/documents/2022-01/2022-cgp-final-permit.pdf",
          "quote": "Will disturb one or more acres of land, or will disturb less than one acre of land but are part of a common plan of development or sale (as defined in Appendix A) that will ultimately disturb one or more acres of land",
          "confidence": "verified"
        }
      },
      {
        "step": "Permitting authority",
        "result": "EPA. MA is not an NPDES authorized state, so EPA's Construction General Permit governs directly."
      },
      {
        "step": "Preparer credential",
        "result": "Massachusetts gates plan preparation conditionally. The gate is triggered by plan scope rather than acreage: Attaches to the Wetlands Protection Act pathway. Confirm which case applies to your plan before relying on a generated document.",
        "citation": {
          "sourceCitation": "MassDEP Stormwater Report Checklist",
          "sourceUrl": "https://www.mass.gov/doc/stormwater-report-checklist/download",
          "confidence": "unverified"
        }
      }
    ],
    "notices": [
      "Massachusetts gates plan preparation conditionally. The gate is triggered by plan scope rather than acreage: Attaches to the Wetlands Protection Act pathway. Confirm which case applies to your plan before relying on a generated document.",
      "Basinwise does not perform the physical site inspections the permit requires. Those must be carried out on site by a qualified person.",
      "The source extraction contains the permit body (Parts 1-9) only. Appendices A (Definitions), B (Eligible Permit Areas), C (Small Construction Waivers), D (ESA Eligibility Procedures), E (Historic Property Screening), F (Buffer Requirements), G (Standard Permit Conditions), H (NOI Form), I (NOT Form), J (Chemical Treatment Request) and K (Turbidity Report Form) were NOT present in the extracted text. Every fact whose operative text lives only in an appendix is marked confidence \"unverified\" with a note naming the appendix to confirm."
    ],
    "confidence": "verified",
    "datasetVersion": "2026-07-19",
    "input": {
      "state": "MA",
      "activity": "construction",
      "disturbedAcres": 6.5,
      "maxDisturbedAcresAtOneTime": null,
      "partOfLargerPlan": false,
      "sectorCode": null,
      "startDate": null,
      "endDate": null,
      "onTribalLand": false,
      "federalFacility": false,
      "dischargesToImpairedWater": null,
      "dischargesToTier2Water": null,
      "aridClimate": false
    }
  },
  "request_id": "req_2f9c41a7b0e84d15",
  "disclaimer": "Basinwise reports publicly published permit requirements and cites the permit section behind each one. It is not legal or engineering advice and it is not a permit. We do not perform the physical site inspections the permit requires; we generate the plan and keep the record. Where a jurisdiction requires a credentialed preparer, the document we generate is a draft for that person to review and sign. Always confirm against your permitting authority's current permit before you break ground.",
  "attribution": "Data from Basinwise (https://basinwise.vercel.app): NPDES stormwater permit requirements, cited to the permit section and carrying a confidence flag. Free responses require this attribution."
}

Note the citation and because on every requirement, the derivation behind the verdict, and the notices array, which you must surface verbatim. See the full API reference for the citation shape, error codes and the hosted MCP endpoint at https://basinwise.vercel.app/api/mcp.

Built for agents

What an agent actually needs from this API

One engine behind everything

The REST API, the MCP server and the free in-browser screening all run the same pure, dependency-free determination engine. There is no separate path to drift, and no requirement is ever returned without the permit section it came from.

A permit section and a confidence on every requirement

Each requirement, screen and derivation step carries the permit section it came from and a confidence flag: "verified" means somebody read that clause in the source document, "unverified" renders as Unverified so your agent never repeats an unconfirmed value as if it were settled fact.

Single-key auth

One key unlocks the REST API and the MCP server. Send Authorization: Bearer <your-api-key>, live or test. No OAuth dance, no per-endpoint credentials, and a public sandbox key that works before you have an account at all.

Machine-readable docs

A full reference and a spec at /api/openapi, so an agent can onboard itself without a human reading a page first.

Deterministic, no model in the path

Every response is a lookup against a cited permit plus deterministic arithmetic. The same site always returns the same determination, and an empty requirements list means we have not read that jurisdiction, never that nothing is required, so an agent cannot mistake a gap in our coverage for a clear site.

Free to try, safe by default

Every endpoint works with no key, throttled to 4/min and 20/day per IP. The public sandbox key bw_test_sandbox needs no signup and raises that to 10/min against the real engine, and it never bills, so an agent loop cannot run up a surprise charge while you build.

REST API

Every endpoint

Base URL https://basinwise.vercel.app/api/v1. Every endpoint is free at the anonymous rate and needs no key to try. Send `Authorization: Bearer bw_live_...` (or `x-api-key`) to lift the throttle to your plan's quota. A `bw_test_...` key runs the real engine against the real permit dataset, is throttled, and never bills. `bw_test_sandbox` is a public sandbox key that works with no signup, so an agent can make a real authenticated call on first contact. No endpoint on this API is paywalled: what a paid plan buys is the generated plan document and the retained inspection record in the app, plus a higher throttle.

POST

/api/v1/determine

Key optional

Determine which NPDES stormwater permit governs a site and what it requires. Returns the coverage verdict (required, not_required or verify), the governing permit with the version the answer was computed against, the jurisdiction and its permitting authority, that permit's eligibility screens, the requirements that attach to THIS site (each with the permit section it came from and a `because` explaining why it applies here rather than in general), the step-by-step derivation, and a `notices` array you must surface verbatim. Deterministic: no model in the request path, so identical input always returns an identical determination. Requirements are returned ONLY where we hold the governing permit's rules; where we have identified a state permit but not read it, the requirement list is empty and a notice says so rather than substituting the federal permit's numbers. Supports an `Idempotency-Key` header for keyed callers.

request

curl -X POST https://basinwise.vercel.app/api/v1/determine \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: determine-demo-1" \
  -d '{"state":"MA","activity":"construction","disturbedAcres":6.5,"partOfLargerPlan":false}'
GET

/api/v1/requirements

Key optional

The requirements for a site, as a GET so an agent can ask with a URL and nothing else. Same engine and same parser as POST /api/v1/determine, projected down to inspection frequency, stabilisation deadlines, filing deadlines, corrective-action windows, recordkeeping and buffers, each carrying its permit citation. The coverage verdict, the eligibility screens and the notices come with it: a requirement list detached from whether coverage is triggered at all, and from which jurisdictions we have not verified, is a half-answer. An empty requirements array with a notice is the honest response for a state whose permit we have not read.

request

curl "https://basinwise.vercel.app/api/v1/requirements?state=MA&activity=construction&acres=6.5"
GET

/api/v1/jurisdictions

Key optional

Every state, territory and DC we hold a row for: NPDES authorisation status, the governing permit and its number, the agency name and URL, and the preparer-credential gate that applies there. Unverified jurisdictions are LISTED rather than omitted, each carrying confidence "unverified" and a note naming the agency to confirm with: a jurisdiction missing from a coverage list reads as "no permit applies", which is never what it means. Free, keyless and not rate-limited.

request

curl https://basinwise.vercel.app/api/v1/jurisdictions
GET

/api/v1/jurisdictions/{code}

Key optional

One jurisdiction: who permits (the state or EPA), the governing permit and number, the agency links, and the preparer-credential gate. A code we hold no row for returns invalid_request with details.known_states so a caller can correct itself; a code we hold but have not verified returns 200 with confidence "unverified" and the agency to confirm with. Free, keyless and not rate-limited.

request

curl https://basinwise.vercel.app/api/v1/jurisdictions/CA
GET

/api/v1/credentials

Key optional

Does this state require a credentialed preparer to prepare or sign the stormwater plan, and does the requirement bite for a site of this size? This is the question that decides whether a generated document is the operator's deliverable or a draft somebody else has to sign, so it gets an endpoint of its own. The answer is a structured gate (open, gated, conditional or unknown) rather than a boolean, because states differ on three independent axes: which credentials qualify, whether a state course is layered on top, and what triggers the gate (acreage in Utah and Oregon, plan scope in New York). A state we have not verified returns "unknown", never "open": defaulting an unverified state to open would be the most dangerous answer this product could give. `documentStatus` states the consequence in plain language on every response.

request

curl "https://basinwise.vercel.app/api/v1/credentials?state=CA"
GET

/api/v1/pricing

Key optional

Machine-readable pricing: every plan id, its monthly price (read live from lib/plans.ts, never hardcoded), what it includes, the included monthly API-call allowance (a hard ceiling, not a meter), rate limits, and the public sandbox key. Lets an agent self-select a plan without a human reading the pricing page. Free, keyless, not rate-limited.

request

curl https://basinwise.vercel.app/api/v1/pricing

Basinwise reports publicly published permit requirements and cites the permit section behind each one. It is not legal or engineering advice and it is not a permit. We do not perform the physical site inspections the permit requires; we generate the plan and keep the record. Where a jurisdiction requires a credentialed preparer, the document we generate is a draft for that person to review and sign. Always confirm against your permitting authority's current permit before you break ground.

Full API reference MCP server setup

Keys are not being issued yet.

Accounts open at launch, so you cannot mint a test or live API key on this deployment today. Every endpoint still works right now with no key at the anonymous rate, and the MCP server answers the same way. Everything above describes how a key lifts the throttle once accounts open.

A key lifts the throttle, it does not gate the data

Every endpoint is free at the anonymous rate. The public sandbox key needs no signup, and a test key is free on every plan; both run the real engine and never bill, so you can build against the whole surface before you pay. A live key raises you to your plan's quota. See /api/v1/pricing for the machine-readable version.

See plans & quotas