{
  "openapi": "3.1.0",
  "info": {
    "title": "Erfmark",
    "version": "0.1.0",
    "description": "Dutch zoning and Omgevingswet rules at an address: plans, heights, versions, from open data."
  },
  "servers": [],
  "security": [
    {
      "bearer": []
    },
    {}
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/v1/tools/building_envelope": {
      "post": {
        "operationId": "building_envelope",
        "summary": "Land use, building plot and maximum height at a Dutch address",
        "description": "Returns what the in-force IMRO zoning plans say about building at one Dutch address or point: the land use (enkelbestemming) with its plan, whether the point lies inside a building plot (bouwvlak), the maximum building height drawn on the plan map with the plan it comes from (and a conflict note when plans differ), every other map measurement (goothoogte, bebouwingspercentage, bouwlagen), heights in pending drafts, and links to the rules text. Give the location as bag_id, postcode with house_number, street with house_number and city, one address string, rd_x with rd_y, or lat with lon. Call it before a bid, a valuation or a feasibility check when the question is how high or what for. It reads the plan map only: a height set in the rules text appears as null with a pointer to the text. It cannot tell whether the municipality has already replaced the plan (the pons), and it is not a permit decision.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "bag_id": {
                    "type": "string",
                    "pattern": "^[0-9]{16}$",
                    "description": "BAG verblijfsobject id, 16 digits, for example 0344010000007134."
                  },
                  "postcode": {
                    "type": "string",
                    "maxLength": 7,
                    "description": "Dutch postcode, for example 3511GB or 3511 GB. Give it with house_number."
                  },
                  "house_number": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 99999,
                    "description": "House number, with postcode or with street and city."
                  },
                  "house_letter": {
                    "type": "string",
                    "maxLength": 1,
                    "description": "Optional house letter, for example A."
                  },
                  "addition": {
                    "type": "string",
                    "maxLength": 4,
                    "description": "Optional house number addition (toevoeging), for example 2 or BIS."
                  },
                  "street": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Street name exactly as in the BAG (openbare ruimte), with house_number and city."
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Place name (woonplaats) exactly as in the BAG, for example Utrecht or 's-Hertogenbosch."
                  },
                  "address": {
                    "type": "string",
                    "maxLength": 160,
                    "description": "A whole address in one string, for example 'Catharijnesingel 26, Utrecht' or '3511GB 26'. Parsed into postcode and number, or street, number and place."
                  },
                  "rd_x": {
                    "type": "number",
                    "minimum": -7000,
                    "maximum": 300000,
                    "description": "RD New (EPSG:28992) x in metres, with rd_y."
                  },
                  "rd_y": {
                    "type": "number",
                    "minimum": 289000,
                    "maximum": 629000,
                    "description": "RD New (EPSG:28992) y in metres, with rd_x."
                  },
                  "lat": {
                    "type": "number",
                    "minimum": 50.6,
                    "maximum": 53.8,
                    "description": "WGS84 latitude, with lon."
                  },
                  "lon": {
                    "type": "number",
                    "minimum": 3.2,
                    "maximum": 7.3,
                    "description": "WGS84 longitude, with lat."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    },
    "/v1/tools/zoning_plans_at_location": {
      "post": {
        "operationId": "zoning_plans_at_location",
        "summary": "Every IMRO zoning plan and zoning object at a Dutch address",
        "description": "Lists the IMRO plans (bestemmingsplannen, wijzigingsplannen, uitwerkingsplannen, inpassingsplannen and parapluplannen) whose area covers one Dutch address or point, newest first within each stage (in force, adopted not yet in force, consolidated, draft), each with plan id and version, status, date, municipality, relations to other plans, the Ruimtelijkeplannen.nl viewer and rules text links, and the zoning objects it places at the point: land use, overlay uses (dubbelbestemmingen such as archaeology or water defences), function, building and area designations, building plot and measurements. Lapsed plans and superseded drafts are left out unless include names them. Give the location as bag_id, postcode with house_number, street with house_number and city, one address string, rd_x with rd_y, or lat with lon. Since 2024 these plans are the transitional part of the omgevingsplan; for the new Omgevingswet documents use omgevingswet_documents_at_location. It does not know the pons and does not say which plan governs a rule.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "bag_id": {
                    "type": "string",
                    "pattern": "^[0-9]{16}$",
                    "description": "BAG verblijfsobject id, 16 digits, for example 0344010000007134."
                  },
                  "postcode": {
                    "type": "string",
                    "maxLength": 7,
                    "description": "Dutch postcode, for example 3511GB or 3511 GB. Give it with house_number."
                  },
                  "house_number": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 99999,
                    "description": "House number, with postcode or with street and city."
                  },
                  "house_letter": {
                    "type": "string",
                    "maxLength": 1,
                    "description": "Optional house letter, for example A."
                  },
                  "addition": {
                    "type": "string",
                    "maxLength": 4,
                    "description": "Optional house number addition (toevoeging), for example 2 or BIS."
                  },
                  "street": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Street name exactly as in the BAG (openbare ruimte), with house_number and city."
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Place name (woonplaats) exactly as in the BAG, for example Utrecht or 's-Hertogenbosch."
                  },
                  "address": {
                    "type": "string",
                    "maxLength": 160,
                    "description": "A whole address in one string, for example 'Catharijnesingel 26, Utrecht' or '3511GB 26'. Parsed into postcode and number, or street, number and place."
                  },
                  "rd_x": {
                    "type": "number",
                    "minimum": -7000,
                    "maximum": 300000,
                    "description": "RD New (EPSG:28992) x in metres, with rd_y."
                  },
                  "rd_y": {
                    "type": "number",
                    "minimum": 289000,
                    "maximum": 629000,
                    "description": "RD New (EPSG:28992) y in metres, with rd_x."
                  },
                  "lat": {
                    "type": "number",
                    "minimum": 50.6,
                    "maximum": 53.8,
                    "description": "WGS84 latitude, with lon."
                  },
                  "lon": {
                    "type": "number",
                    "minimum": 3.2,
                    "maximum": 7.3,
                    "description": "WGS84 longitude, with lat."
                  },
                  "include": {
                    "type": "array",
                    "maxItems": 7,
                    "items": {
                      "type": "string",
                      "enum": [
                        "in_force",
                        "adopted_not_in_force",
                        "consolidated",
                        "draft",
                        "superseded_draft",
                        "lapsed",
                        "unknown"
                      ]
                    },
                    "description": "Stages to list. Default: in_force, adopted_not_in_force, consolidated, draft."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    },
    "/v1/tools/omgevingswet_documents_at_location": {
      "post": {
        "operationId": "omgevingswet_documents_at_location",
        "summary": "Omgevingswet documents and area designations at a Dutch address",
        "description": "Lists the Omgevingswet documents whose area covers one Dutch address or point: the municipality's omgevingsplan with the date its current version took effect, the provincial omgevingsverordening, the water board's waterschapsverordening, national rules (Omgevingsbesluit and others), programmes, voorbereidingsbesluiten and voorbeschermingsregels, each with its official identifier, type, level and valid-from date; plus the area designations (gebiedsaanwijzingen) the omgevingsplan places there, such as soil quality classes or archaeological expectation. Give the location as bag_id, postcode with house_number, street with house_number and city, one address string, rd_x with rd_y, or lat with lon. Call it to see which new-system rules and pending preparatory decisions touch a site. It does not return rule texts or activity rules, and its data is a periodic copy of the DSO with the date stated.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "bag_id": {
                    "type": "string",
                    "pattern": "^[0-9]{16}$",
                    "description": "BAG verblijfsobject id, 16 digits, for example 0344010000007134."
                  },
                  "postcode": {
                    "type": "string",
                    "maxLength": 7,
                    "description": "Dutch postcode, for example 3511GB or 3511 GB. Give it with house_number."
                  },
                  "house_number": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 99999,
                    "description": "House number, with postcode or with street and city."
                  },
                  "house_letter": {
                    "type": "string",
                    "maxLength": 1,
                    "description": "Optional house letter, for example A."
                  },
                  "addition": {
                    "type": "string",
                    "maxLength": 4,
                    "description": "Optional house number addition (toevoeging), for example 2 or BIS."
                  },
                  "street": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Street name exactly as in the BAG (openbare ruimte), with house_number and city."
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Place name (woonplaats) exactly as in the BAG, for example Utrecht or 's-Hertogenbosch."
                  },
                  "address": {
                    "type": "string",
                    "maxLength": 160,
                    "description": "A whole address in one string, for example 'Catharijnesingel 26, Utrecht' or '3511GB 26'. Parsed into postcode and number, or street, number and place."
                  },
                  "rd_x": {
                    "type": "number",
                    "minimum": -7000,
                    "maximum": 300000,
                    "description": "RD New (EPSG:28992) x in metres, with rd_y."
                  },
                  "rd_y": {
                    "type": "number",
                    "minimum": 289000,
                    "maximum": 629000,
                    "description": "RD New (EPSG:28992) y in metres, with rd_x."
                  },
                  "lat": {
                    "type": "number",
                    "minimum": 50.6,
                    "maximum": 53.8,
                    "description": "WGS84 latitude, with lon."
                  },
                  "lon": {
                    "type": "number",
                    "minimum": 3.2,
                    "maximum": 7.3,
                    "description": "WGS84 longitude, with lat."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "description": "Maximum area designations to return, default 50."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    },
    "/v1/tools/resolve_address": {
      "post": {
        "operationId": "resolve_address",
        "summary": "Find the BAG object, use and point for a Dutch address",
        "description": "Resolves a Dutch address to its BAG verblijfsobject: the 16-digit BAG id, the full address as registered, its registered use (gebruiksdoel), floor area, build year, status, building (pand) id and its RD point, from the BAG on PDOK. Give bag_id, postcode with house_number (safest), street with house_number and city, or one address string. Street and place names are matched exactly as in the BAG, without fuzzy search. Call it to pin an address before the zoning tools, or to read its registered use; the zoning tools resolve addresses themselves, so this call is optional. It does not return owners or any personal data.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "bag_id": {
                    "type": "string",
                    "pattern": "^[0-9]{16}$",
                    "description": "BAG verblijfsobject id, 16 digits, for example 0344010000007134."
                  },
                  "postcode": {
                    "type": "string",
                    "maxLength": 7,
                    "description": "Dutch postcode, for example 3511GB or 3511 GB. Give it with house_number."
                  },
                  "house_number": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 99999,
                    "description": "House number, with postcode or with street and city."
                  },
                  "house_letter": {
                    "type": "string",
                    "maxLength": 1,
                    "description": "Optional house letter, for example A."
                  },
                  "addition": {
                    "type": "string",
                    "maxLength": 4,
                    "description": "Optional house number addition (toevoeging), for example 2 or BIS."
                  },
                  "street": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Street name exactly as in the BAG (openbare ruimte), with house_number and city."
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Place name (woonplaats) exactly as in the BAG, for example Utrecht or 's-Hertogenbosch."
                  },
                  "address": {
                    "type": "string",
                    "maxLength": 160,
                    "description": "A whole address in one string, for example 'Catharijnesingel 26, Utrecht' or '3511GB 26'. Parsed into postcode and number, or street, number and place."
                  },
                  "rd_x": {
                    "type": "number",
                    "minimum": -7000,
                    "maximum": 300000,
                    "description": "RD New (EPSG:28992) x in metres, with rd_y."
                  },
                  "rd_y": {
                    "type": "number",
                    "minimum": 289000,
                    "maximum": 629000,
                    "description": "RD New (EPSG:28992) y in metres, with rd_x."
                  },
                  "lat": {
                    "type": "number",
                    "minimum": 50.6,
                    "maximum": 53.8,
                    "description": "WGS84 latitude, with lon."
                  },
                  "lon": {
                    "type": "number",
                    "minimum": 3.2,
                    "maximum": 7.3,
                    "description": "WGS84 longitude, with lat."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    },
    "/v1/tools/plan_details": {
      "post": {
        "operationId": "plan_details",
        "summary": "One IMRO plan or dossier from the national index",
        "description": "Returns one IMRO plan version (plan_id, such as NL.IMRO.0344.BPNWHOOGCATHARIJNE-0601) or every version of a dossier (dossier_id, the plan id without its version suffix) from the national index of every plan area PDOK publishes: name, type, plan status and dossier status with Erfmark's stage, date, municipality then and now (after mergers), relations such as 'ter vervanging van', the rules text and decision links and the Ruimtelijkeplannen.nl viewer link. Call it when an answer or a document names a plan id. It holds plans as of the index date; it says not found rather than guess.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "plan_id": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 80,
                    "description": "IMRO plan version id, for example NL.IMRO.0344.BPNWHOOGCATHARIJNE-0601."
                  },
                  "dossier_id": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 80,
                    "description": "IMRO dossier id, for example NL.IMRO.0344.BPNWHOOGCATHARIJNE."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    },
    "/v1/tools/municipality_status": {
      "post": {
        "operationId": "municipality_status",
        "summary": "Omgevingsplan version and IMRO plans of a Dutch municipality",
        "description": "Returns where one Dutch municipality stands in the transition: its omgevingsplan's identifier and the date the current version took effect, its province, how many IMRO plan versions it still lists by stage and by type (including plans of municipalities merged into it), its ten newest in-force plans and its pending drafts. Give the name (Utrecht, 's-Hertogenbosch, Súdwest-Fryslân) or the four-digit CBS code. Call it to brief a team on a municipality or to see how recent its plans are. It cannot say how much of the old plans the omgevingsplan has already replaced.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "municipality"
                ],
                "properties": {
                  "municipality": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 60,
                    "description": "Municipality name or four-digit code, for example Utrecht or 0344."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    },
    "/v1/tools/source_status": {
      "post": {
        "operationId": "source_status",
        "summary": "Datasets, dates, licences and what Erfmark cannot see yet",
        "description": "Returns the data version, each source dataset with its date, licence and feed, what the shipped index covers, and the list of things Erfmark does not know yet (the pons and Ozon rule texts, pending a DSO API key) or never serves (permits and annexes). Call it once to cite dates, or when an answer seems out of date. It takes no input.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "429": {
            "description": "Limit reached"
          }
        }
      }
    }
  }
}
