{
  "openapi": "3.0.4",
  "info": {
    "title": "JuomavesidirektiiviApi API",
    "description": "<b>Juomaveden laatutekijöiden lukurajapinta</b>\n<br/>\n<p>Tarkoitettu vesi.fi-palvelun käyttöön. Tarjoilee dataa Ruokaviraston VATI-palvelusta</p>",
    "contact": {
      "name": "Feedback",
      "url": "https://www.syke.fi/en-US/SYKE_Info/Contact_information/Feedback_form(10043)?r=38611"
    },
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    },
    "version": "1"
  },
  "servers": [
    {
      "url": "/api/juomavesidirektiivi-vati"
    }
  ],
  "paths": {
    "/api/WaterQuality/ByCoordinates": {
      "get": {
        "tags": [
          "WaterQuality"
        ],
        "summary": "Hae vedenjakelualueen tiedot koordinaattien (EPSG:3067, ETRS TM35FIN) perusteella",
        "parameters": [
          {
            "name": "X",
            "in": "query",
            "description": "",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "Y",
            "in": "query",
            "description": "",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "MunicipalityNumber",
            "in": "query",
            "description": "Kuntanumero",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "description": "The requested API version",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Vedenjakelualue"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Vedenjakelualue"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Vedenjakelualue"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/WaterQuality/ByBusinessId": {
      "get": {
        "tags": [
          "WaterQuality"
        ],
        "summary": "Hae vedenjakelualueen tiedot Y-tunnuksen perusteella",
        "parameters": [
          {
            "name": "businessId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "description": "The requested API version",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Vedenjakelualue"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Vedenjakelualue"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Vedenjakelualue"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/WaterQuality/BySiteId": {
      "get": {
        "tags": [
          "WaterQuality"
        ],
        "summary": "Hae vedenjakelualueen tiedot toimipaikkatunnuksen perusteella",
        "parameters": [
          {
            "name": "siteId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "description": "The requested API version",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Vedenjakelualue"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Vedenjakelualue"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Vedenjakelualue"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/WaterQuality/Variables": {
      "get": {
        "tags": [
          "WaterQuality"
        ],
        "summary": "Hae tietoja vedenlaadun muuttujista",
        "parameters": [
          {
            "name": "analyysikoodiTunnus",
            "in": "query",
            "description": "Voit hakea tietoa yksittäisestä muuttujasta. Esim. \"AL\" alumiinille",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "description": "The requested API version",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Muuttuja"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Muuttuja"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Muuttuja"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/WaterQuality/Anomalies": {
      "get": {
        "tags": [
          "WaterQuality"
        ],
        "summary": "Hae toimipaikkakohtaiset poikkeamat",
        "parameters": [
          {
            "name": "siteId",
            "in": "query",
            "description": "toimipaikkatunnus",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "siteName",
            "in": "query",
            "description": "toimipaikan nimi",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "api-version",
            "in": "query",
            "description": "The requested API version",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ToimipaikkaPoikkeamat"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ToimipaikkaPoikkeamat"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ToimipaikkaPoikkeamat"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/WaterQuality/Sites": {
      "get": {
        "tags": [
          "WaterQuality"
        ],
        "summary": "Hae toimipaikkojen tiedot",
        "parameters": [
          {
            "name": "api-version",
            "in": "query",
            "description": "The requested API version",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Toimipaikka"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Toimipaikka"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Toimipaikka"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Desinfiointimenetelmat": {
        "type": "object",
        "properties": {
          "kloorikemikaalit": {
            "type": "boolean",
            "nullable": true
          },
          "otsonointi": {
            "type": "boolean",
            "nullable": true
          },
          "muu": {
            "type": "string"
          },
          "uv": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Katuosoite": {
        "type": "object",
        "properties": {
          "pohjoinen": {
            "type": "string"
          },
          "itainen": {
            "type": "string"
          },
          "jarjestelma": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "KayttajanSyottama": {
        "type": "object",
        "properties": {
          "pohjoinen": {
            "type": "string"
          },
          "itainen": {
            "type": "string"
          },
          "jarjestelma": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Kohdetoiminta": {
        "type": "object",
        "properties": {
          "kohdetoimintatunnus": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "toimintatyyppitunnus": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "ominaisuudet": {
            "$ref": "#/components/schemas/Ominaisuudet"
          },
          "naytteenotot": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Naytteenotot"
            }
          }
        },
        "additionalProperties": false
      },
      "Koordinaatit": {
        "type": "object",
        "properties": {
          "katuosoite": {
            "$ref": "#/components/schemas/Katuosoite"
          },
          "kayttajanSyottama": {
            "$ref": "#/components/schemas/KayttajanSyottama"
          }
        },
        "additionalProperties": false
      },
      "Muuttuja": {
        "type": "object",
        "properties": {
          "tunnus": {
            "type": "integer",
            "format": "int32"
          },
          "analyysikooditunnus": {
            "type": "string"
          },
          "muuttujaNimi": {
            "type": "string",
            "nullable": true
          },
          "rajaarvoFinMin": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "rajaarvoFinMax": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "rajaarvoFinYksikko": {
            "type": "string",
            "nullable": true
          },
          "torjuntaAine": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Naytteenotot": {
        "type": "object",
        "properties": {
          "analyysikooditunnus": {
            "type": "string"
          },
          "kuluvanVuodenSeurantatiheys": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "kuluvanVuodenSeurantaLkm": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "tulosArvo": {
            "type": "string",
            "nullable": true
          },
          "tulosYksikko": {
            "type": "string"
          },
          "naytteenottoPvm": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Ominaisuudet": {
        "type": "object",
        "properties": {
          "vedenKayttajienMaaraHenkiloa": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "toimitettavanTalousvedenMaara": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "ostovedenMaara": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "riskinarviointi": {
            "$ref": "#/components/schemas/Riskinarviointi"
          },
          "raakavesi": {
            "$ref": "#/components/schemas/Raakavesi"
          },
          "vedenkasittely": {
            "$ref": "#/components/schemas/Vedenkasittely"
          }
        },
        "additionalProperties": false
      },
      "Poikkeama": {
        "type": "object",
        "properties": {
          "muuttuja": {
            "type": "string"
          },
          "pvm": {
            "type": "string",
            "format": "date"
          },
          "arvo": {
            "type": "string"
          },
          "yksikkö": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "Raakavesi": {
        "type": "object",
        "properties": {
          "raakavedenLaatuPintavesi": {
            "type": "boolean",
            "nullable": true
          },
          "raakavedenLaatuPohjavesi": {
            "type": "boolean",
            "nullable": true
          },
          "raakavedenLaatuTekopohjavesi": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "RajaArvonYlitys": {
        "type": "object",
        "properties": {
          "muuttuja": {
            "type": "string",
            "description": "Muuttujan analyysikooditunnus"
          },
          "viimeisinHavainto": {
            "type": "string",
            "description": "Milloin viimeisin havainto on tehty",
            "format": "date"
          },
          "lkm": {
            "type": "integer",
            "description": "Ylittävien havaintojen lukumäärä",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": ""
      },
      "Riskinarviointi": {
        "type": "object",
        "properties": {
          "hyvaksytty": {
            "type": "boolean",
            "nullable": true
          },
          "toteutettuMuullaTavallaMiten": {
            "type": "string"
          },
          "toteutettuWspTyokalunAvulla": {
            "type": "boolean",
            "nullable": true
          },
          "paivitetty": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Toimija": {
        "type": "object",
        "properties": {
          "toimijatunnus": {
            "type": "integer",
            "format": "int32"
          },
          "nimi": {
            "type": "string",
            "nullable": true
          },
          "ytunnus": {
            "type": "string",
            "nullable": true
          },
          "kuntanumero": {
            "type": "string"
          },
          "katuosoite": {
            "type": "string"
          },
          "postinumero": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Toimipaikka": {
        "type": "object",
        "properties": {
          "toimipaikkatunnus": {
            "type": "integer",
            "format": "int32"
          },
          "nimi": {
            "type": "string"
          },
          "katuosoite": {
            "type": "string"
          },
          "postinumero": {
            "type": "string"
          },
          "koordinaatit": {
            "$ref": "#/components/schemas/Koordinaatit"
          },
          "dwId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ToimipaikkaPoikkeamat": {
        "type": "object",
        "properties": {
          "toimipaikkatunnus": {
            "type": "integer",
            "format": "int32"
          },
          "toimipaikkaNimi": {
            "type": "string"
          },
          "poikkeamat": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Poikkeama"
            }
          }
        },
        "additionalProperties": false,
        "description": "Yksittäistä toimipaikkaa koskeavat poikkeamat"
      },
      "ValidationProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "additionalProperties": { }
      },
      "Vedenjakelualue": {
        "type": "object",
        "properties": {
          "toimipaikka": {
            "$ref": "#/components/schemas/Toimipaikka"
          },
          "toimija": {
            "$ref": "#/components/schemas/Toimija"
          },
          "kohdetoiminta": {
            "$ref": "#/components/schemas/Kohdetoiminta"
          },
          "poikkeamat": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/RajaArvonYlitys"
              }
            }
          }
        },
        "additionalProperties": false
      },
      "Vedenkasittely": {
        "type": "object",
        "properties": {
          "desinfiointi": {
            "type": "boolean",
            "nullable": true
          },
          "radioaktiivisuudenPoisto": {
            "type": "boolean",
            "nullable": true
          },
          "saostus": {
            "type": "boolean",
            "nullable": true
          },
          "suodatus": {
            "type": "boolean",
            "nullable": true
          },
          "muu": {
            "type": "string"
          },
          "desinfiointimenetelmat": {
            "$ref": "#/components/schemas/Desinfiointimenetelmat"
          },
          "kaanteisosmoosi": {
            "type": "boolean",
            "nullable": true
          },
          "phsaato": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    }
  },
  "tags": [
    {
      "name": "WaterQuality"
    }
  ]
}