{
  "openapi": "3.1.0",
  "info": {
    "title": "Su Haritası — Türkiye Su Verisi ve Su Hukuku Açık Veri Tabanı — Açık Veri API",
    "version": "2.0.0",
    "summary": "Türkiye su verisi, havzaları ve su mevzuatı: makine-okunur JSON uçları",
    "description": "Kimlik doğrulama gerekmez. v2 uçları her yanıtta { meta, veri } döner; meta: kaynak, kaynaklar, lisans, veri_tarihi, uretim_zamani, surum (v2), belge. v1 uçları geriye uyumluluk için aynen korunur. Değişiklik günlüğü ve durum: https://suharitasi.com/api-dokumantasyonu/. Ajan erişimi: https://suharitasi.com/mcp. Kalıcı arşiv (Zenodo, kavram DOI, bütün sürümler): https://doi.org/10.5281/zenodo.23002677.",
    "license": {
      "name": "CC BY 4.0 yalnız Su Haritası derlemesi; kaynak verisi kendi koşuluna tabidir",
      "url": "https://suharitasi.com/acik-veri/#lisans"
    },
    "contact": {
      "name": "Su Haritası",
      "url": "https://suharitasi.com/api-dokumantasyonu/",
      "email": "hukuk@arslanhukuk.tr"
    }
  },
  "servers": [
    {
      "url": "https://suharitasi.com"
    }
  ],
  "tags": [
    {
      "name": "v2",
      "description": "Önerilen sürüm: tek yazım düzeni, ortak meta"
    },
    {
      "name": "v1",
      "description": "Korunan eski sürüm"
    },
    {
      "name": "veri",
      "description": "Statik veri dosyaları (v1 düzeni)"
    },
    {
      "name": "mcp",
      "description": "Model Context Protocol"
    }
  ],
  "paths": {
    "/api/v1/havzalar": {
      "get": {
        "tags": [
          "v1"
        ],
        "operationId": "api_v1_havzalar",
        "summary": "v1 — 25 havza künyesi (Function, hız sınırlı; isteğe bağlı anahtar)",
        "responses": {
          "200": {
            "description": "Havza künyesi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "405": {
            "description": "Yalnız GET/HEAD/OPTIONS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Hata"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı aşıldı (uç başına, IP+tarayıcı başına 60 istek/dk). Retry-After: 60 başlığı döner.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Hata"
                }
              }
            }
          },
          "503": {
            "description": "Kaynak veri geçici olarak okunamadı",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Hata"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/kuraklik": {
      "get": {
        "tags": [
          "v1"
        ],
        "operationId": "api_v1_kuraklik",
        "summary": "v1 — istatistiksel projeksiyon (Function, hız sınırlı; ölçüm değildir)",
        "responses": {
          "200": {
            "description": "Projeksiyon",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "405": {
            "description": "Yalnız GET/HEAD/OPTIONS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Hata"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı aşıldı (uç başına, IP+tarayıcı başına 60 istek/dk). Retry-After: 60 başlığı döner.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Hata"
                }
              }
            }
          },
          "503": {
            "description": "Kaynak veri geçici olarak okunamadı",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Hata"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/il/{il}.json": {
      "get": {
        "tags": [
          "v1"
        ],
        "operationId": "api_v1_il_il_json",
        "summary": "v1 — il künyesi (statik)",
        "parameters": [
          {
            "name": "il",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "konya"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "İl künyesi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/api/v1/havza/{havza}.json": {
      "get": {
        "tags": [
          "v1"
        ],
        "operationId": "api_v1_havza_havza_json",
        "summary": "v1 — havza künyesi (statik)",
        "parameters": [
          {
            "name": "havza",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "gediz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Havza künyesi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/veri/havzalar.json": {
      "get": {
        "tags": [
          "veri"
        ],
        "operationId": "veri_havzalar_json",
        "summary": "v1 — 25 havza künyesi (dizi)",
        "responses": {
          "200": {
            "description": "v1 — 25 havza künyesi (dizi)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/veri/iller.json": {
      "get": {
        "tags": [
          "veri"
        ],
        "operationId": "veri_iller_json",
        "summary": "v1 — 81 il → DSİ bölgesi, havza, su idaresi (dizi)",
        "responses": {
          "200": {
            "description": "v1 — 81 il → DSİ bölgesi, havza, su idaresi (dizi)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/veri/islemler.json": {
      "get": {
        "tags": [
          "veri"
        ],
        "operationId": "veri_islemler_json",
        "summary": "v1 — su işlemleri → yetkili kurum, dayanak, başvuru kanalı (dizi)",
        "responses": {
          "200": {
            "description": "v1 — su işlemleri → yetkili kurum, dayanak, başvuru kanalı (dizi)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/veri/mevzuat.json": {
      "get": {
        "tags": [
          "veri"
        ],
        "operationId": "veri_mevzuat_json",
        "summary": "v1 — mevzuat maddeleri: resmî metin, resmî başlık, metinde geçen kurum ve süreler, madde özeti (dizi)",
        "responses": {
          "200": {
            "description": "v1 — mevzuat maddeleri: resmî metin, resmî başlık, metinde geçen kurum ve süreler, madde özeti (dizi)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/veri/emsal.json": {
      "get": {
        "tags": [
          "veri"
        ],
        "operationId": "veri_emsal_json",
        "summary": "v1 — resmî sunucuda doğrulanan emsal kararlar (dizi)",
        "responses": {
          "200": {
            "description": "v1 — resmî sunucuda doğrulanan emsal kararlar (dizi)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/veri/sozluk.json": {
      "get": {
        "tags": [
          "veri"
        ],
        "operationId": "veri_sozluk_json",
        "summary": "v1 — sözlük terimleri; resmî tanımı olanlarda tanım alanı (dizi)",
        "responses": {
          "200": {
            "description": "v1 — sözlük terimleri; resmî tanımı olanlarda tanım alanı (dizi)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/veri/su-riski.json": {
      "get": {
        "tags": [
          "veri"
        ],
        "operationId": "veri_su_riski_json",
        "summary": "v1 — il/havza su riski endeksi (nesne)",
        "responses": {
          "200": {
            "description": "v1 — il/havza su riski endeksi (nesne)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/veri/kuraklik.json": {
      "get": {
        "tags": [
          "veri"
        ],
        "operationId": "veri_kuraklik_json",
        "summary": "v1 — istatistiksel projeksiyon (nesne; ölçüm değildir)",
        "responses": {
          "200": {
            "description": "v1 — istatistiksel projeksiyon (nesne; ölçüm değildir)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/veri/tek-kaynak.json": {
      "get": {
        "tags": [
          "veri"
        ],
        "operationId": "veri_tek_kaynak_json",
        "summary": "Sitede birden çok yerde geçen büyüklüklerin tek değeri ve tanımları (nesne)",
        "responses": {
          "200": {
            "description": "Sitede birden çok yerde geçen büyüklüklerin tek değeri ve tanımları (nesne)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/veri/veri-tazelik.json": {
      "get": {
        "tags": [
          "veri"
        ],
        "operationId": "veri_veri_tazelik_json",
        "summary": "Veri kümelerinin tazelik durumu (nesne) — API durum tablosunun kaynağı",
        "responses": {
          "200": {
            "description": "Veri kümelerinin tazelik durumu (nesne) — API durum tablosunun kaynağı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/veri/mevzuat-surum.json": {
      "get": {
        "tags": [
          "veri"
        ],
        "operationId": "veri_mevzuat_surum_json",
        "summary": "İzlenen mevzuatın madde bazlı özet anlık görüntüsü (nesne)",
        "responses": {
          "200": {
            "description": "İzlenen mevzuatın madde bazlı özet anlık görüntüsü (nesne)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/kisit.json": {
      "get": {
        "tags": [
          "veri"
        ],
        "operationId": "kisit_json",
        "summary": "Resmî Gazete işletme sahası ve kapatma kayıtları (dizi)",
        "responses": {
          "200": {
            "description": "Resmî Gazete işletme sahası ve kapatma kayıtları (dizi)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/api/v2/havzalar.json": {
      "get": {
        "tags": [
          "v2"
        ],
        "operationId": "api_v2_havzalar_json",
        "summary": "v2 — 25 havza özeti (DSİ, baraj, uydu, planlar)",
        "responses": {
          "200": {
            "description": "25 havza özeti (DSİ, baraj, uydu, planlar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V2Yanit"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/api/v2/havza/{slug}.json": {
      "get": {
        "tags": [
          "v2"
        ],
        "operationId": "api_v2_havza_slug_json",
        "summary": "v2 — Tek havza: özet + günlük baraj ortalaması + aylık uydu serisi",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "gediz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tek havza: özet + günlük baraj ortalaması + aylık uydu serisi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V2Yanit"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/api/v2/iller.json": {
      "get": {
        "tags": [
          "v2"
        ],
        "operationId": "api_v2_iller_json",
        "summary": "v2 — 81 il: DSİ bölgesi, su idaresi, havzalar, Resmî Gazete kayıt sayısı",
        "responses": {
          "200": {
            "description": "81 il: DSİ bölgesi, su idaresi, havzalar, Resmî Gazete kayıt sayısı",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V2Yanit"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/api/v2/baraj.json": {
      "get": {
        "tags": [
          "v2"
        ],
        "operationId": "api_v2_baraj_json",
        "summary": "v2 — Baraj doluluğu: ülke ve havza ortalamaları (tek tanım)",
        "responses": {
          "200": {
            "description": "Baraj doluluğu: ülke ve havza ortalamaları (tek tanım)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V2Yanit"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/api/v2/uydu.json": {
      "get": {
        "tags": [
          "v2"
        ],
        "operationId": "api_v2_uydu_json",
        "summary": "v2 — Uydu su depolama: Türkiye aylık seri + havza eğilimleri",
        "responses": {
          "200": {
            "description": "Uydu su depolama: Türkiye aylık seri + havza eğilimleri",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V2Yanit"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/api/v2/tahmin.json": {
      "get": {
        "tags": [
          "v2"
        ],
        "operationId": "api_v2_tahmin_json",
        "summary": "v2 — İstatistiksel projeksiyon (ölçüm değildir)",
        "responses": {
          "200": {
            "description": "İstatistiksel projeksiyon (ölçüm değildir)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V2Yanit"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/api/v2/resmi-gazete.json": {
      "get": {
        "tags": [
          "v2"
        ],
        "operationId": "api_v2_resmi_gazete_json",
        "summary": "v2 — Resmî Gazete işletme sahası ve kapatma kayıtları",
        "responses": {
          "200": {
            "description": "Resmî Gazete işletme sahası ve kapatma kayıtları",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V2Yanit"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/api/v2/emsal.json": {
      "get": {
        "tags": [
          "v2"
        ],
        "operationId": "api_v2_emsal_json",
        "summary": "v2 — Resmî sunucuda doğrulanan emsal kararlar",
        "responses": {
          "200": {
            "description": "Resmî sunucuda doğrulanan emsal kararlar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V2Yanit"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/api/v2/sozluk.json": {
      "get": {
        "tags": [
          "v2"
        ],
        "operationId": "api_v2_sozluk_json",
        "summary": "v2 — Sözlük: resmî tanımlar (birebir alıntı)",
        "responses": {
          "200": {
            "description": "Sözlük: resmî tanımlar (birebir alıntı)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V2Yanit"
                }
              }
            }
          },
          "404": {
            "description": "Statik dosya yok: Cloudflare Pages HTML 404 sayfası döner (JSON değildir).",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/mcp": {
      "get": {
        "tags": [
          "mcp"
        ],
        "operationId": "mcp_kart",
        "summary": "MCP sunucu kartı: araç listesi ve parametre şemaları",
        "responses": {
          "200": {
            "description": "Sunucu kartı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "mcp"
        ],
        "operationId": "mcp_jsonrpc",
        "summary": "MCP (JSON-RPC 2.0, oturumsuz Streamable HTTP): initialize, tools/list, tools/call",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC yanıtı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı aşıldı (IP+tarayıcı başına 60 istek/dk). Gövde JSON-RPC 2.0 hatasıdır (code -32000); Retry-After başlığı dönmez.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "jsonrpc",
                    "error"
                  ],
                  "properties": {
                    "jsonrpc": {
                      "const": "2.0"
                    },
                    "id": {},
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "const": -32000
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {},
    {
      "apiAnahtar": []
    }
  ],
  "components": {
    "securitySchemes": {
      "apiAnahtar": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "sh_…",
        "description": "İsteğe bağlı. Anahtarlı istek 600/dk + günlük kota; anonim 60/dk. Başvuru ve koşullar: /api/kosullar/"
      }
    },
    "schemas": {
      "Hata": {
        "type": "object",
        "required": [
          "hata"
        ],
        "properties": {
          "hata": {
            "type": "string",
            "description": "Türkçe hata açıklaması"
          }
        }
      },
      "Meta": {
        "type": "object",
        "required": [
          "kaynak",
          "lisans",
          "uretim_zamani",
          "surum"
        ],
        "properties": {
          "kaynak": {
            "type": "string"
          },
          "kaynaklar": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lisans": {
            "type": "object",
            "properties": {
              "kendi": {
                "type": "string"
              },
              "kapsam": {
                "type": "string"
              },
              "kosullar": {
                "type": "string",
                "format": "uri"
              }
            }
          },
          "veri_tarihi": {
            "type": [
              "string",
              "null"
            ],
            "description": "Verinin kendi tarihi (YYYY-MM-DD ya da YYYY-MM)"
          },
          "uretim_zamani": {
            "type": "string",
            "format": "date-time",
            "description": "Dosyanın üretildiği an (site derlemesiyle aynı)"
          },
          "surum": {
            "type": "string"
          },
          "belge": {
            "type": "string",
            "format": "uri"
          },
          "not": {
            "type": "string"
          }
        }
      },
      "V2Yanit": {
        "type": "object",
        "required": [
          "meta",
          "veri"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/Meta"
          },
          "veri": {}
        }
      }
    }
  }
}