{
 "openapi": "3.1.0",
 "info": {
  "title": "Civesto institutional API (public reference)",
  "version": "1.0"
 },
 "paths": {
  "/v1/kurumsal/me": {
   "get": {
    "tags": [
     "kurumsal"
    ],
    "summary": "Tenant + key bilgisi",
    "description": "Aktif tenant/key kimlik bilgisini doner.",
    "operationId": "me_v1_kurumsal_me_get",
    "parameters": [
     {
      "name": "X-Civesto-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Civesto-Key"
      }
     },
     {
      "name": "X-Belgu-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Belgu-Key"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/MeResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/kurumsal/openapi.json": {
   "get": {
    "tags": [
     "kurumsal"
    ],
    "summary": "OpenAPI ozet",
    "description": "Kurumsal alt-API icin OpenAPI dokumantasyonu konumu.",
    "operationId": "openapi_link_v1_kurumsal_openapi_json_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "additionalProperties": {
          "type": "string"
         },
         "type": "object",
         "title": "Response Openapi Link V1 Kurumsal Openapi Json Get"
        }
       }
      }
     }
    }
   }
  },
  "/v1/kurumsal/ihbarlar": {
   "get": {
    "tags": [
     "kurumsal"
    ],
    "summary": "Ihbar listesi (cursor pagination)",
    "description": "Ihbar listesi; tenant scope otomatik enforce.",
    "operationId": "list_ihbarlar_v1_kurumsal_ihbarlar_get",
    "parameters": [
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Cursor"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 100,
       "title": "Limit"
      }
     },
     {
      "name": "il",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 64
        },
        {
         "type": "null"
        }
       ],
       "title": "Il"
      }
     },
     {
      "name": "ilce",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 64
        },
        {
         "type": "null"
        }
       ],
       "title": "Ilce"
      }
     },
     {
      "name": "suc_tipi",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 64
        },
        {
         "type": "null"
        }
       ],
       "title": "Suc Tipi"
      }
     },
     {
      "name": "durum",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 32
        },
        {
         "type": "null"
        }
       ],
       "title": "Durum"
      }
     },
     {
      "name": "baslangic",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date-time"
        },
        {
         "type": "null"
        }
       ],
       "title": "Baslangic"
      }
     },
     {
      "name": "bitis",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date-time"
        },
        {
         "type": "null"
        }
       ],
       "title": "Bitis"
      }
     },
     {
      "name": "min_ceza",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "number",
         "minimum": 0
        },
        {
         "type": "null"
        }
       ],
       "title": "Min Ceza"
      }
     },
     {
      "name": "max_ceza",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "number",
         "minimum": 0
        },
        {
         "type": "null"
        }
       ],
       "title": "Max Ceza"
      }
     },
     {
      "name": "X-Civesto-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Civesto-Key"
      }
     },
     {
      "name": "X-Belgu-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Belgu-Key"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/IhbarListResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/kurumsal/ihbarlar/{ihbar_id}/cap": {
   "get": {
    "tags": [
     "kurumsal"
    ],
    "summary": "CAP 1.2 alert for a single report",
    "description": "Common Alerting Protocol 1.2 rendering of a report's routing decision.\n\nCAP is offered as an interoperable envelope, not because a control room is\nalready consuming it — no European road authority publishes CAP today. It\nmatters because ETSI TS 103 479 makes CAP a mandatory NG112 interface and\nits fields feed the routing function directly.\n\n`certainty` is a judgement about the underlying event and therefore stays a\ncaller parameter: the platform does not decide how certain an authority\nconsiders a citizen's account to be.",
    "operationId": "ihbar_cap_v1_kurumsal_ihbarlar__ihbar_id__cap_get",
    "parameters": [
     {
      "name": "ihbar_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Ihbar Id"
      }
     },
     {
      "name": "certainty",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "pattern": "^(Observed|Likely|Possible|Unlikely|Unknown)$",
       "default": "Likely",
       "title": "Certainty"
      }
     },
     {
      "name": "X-Civesto-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Civesto-Key"
      }
     },
     {
      "name": "X-Belgu-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Belgu-Key"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/kurumsal/ihbarlar/export": {
   "get": {
    "tags": [
     "kurumsal"
    ],
    "summary": "Ihbar export (csv/json/xlsx/pdf/xml/pdfa3/datex2)",
    "description": "Streaming export.\n\nFormat secimi:\n- csv: UTF-8 BOM (Excel-TR uyumlu)\n- json: array\n- xlsx: 3 sayfa (ozet/detay/istatistik)\n- pdf: her ihbar yeni sayfa\n- xml: UYAP/EBYS sade sema (TR-spesifik)\n- pdfa3: pdf + PDF/A-3 metadata\n- datex2: DATEX II v3.5 (EU TCC entegrasyonu;\n  ?datex2_country=DE&datex2_language=de query'si ile ozellestirilir)",
    "operationId": "export_ihbarlar_v1_kurumsal_ihbarlar_export_get",
    "parameters": [
     {
      "name": "fmt",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/ExportFormat",
       "default": "csv"
      }
     },
     {
      "name": "datex2_country",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "pattern": "^[A-Z]{2}$"
        },
        {
         "type": "null"
        }
       ],
       "title": "Datex2 Country"
      }
     },
     {
      "name": "datex2_language",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "pattern": "^[a-z]{2}$"
        },
        {
         "type": "null"
        }
       ],
       "title": "Datex2 Language"
      }
     },
     {
      "name": "datex2_publisher",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "default": "Civesto",
       "title": "Datex2 Publisher"
      }
     },
     {
      "name": "datex2_profile",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "pattern": "^generic-3\\.5-test$",
       "default": "generic-3.5-test",
       "title": "Datex2 Profile"
      }
     },
     {
      "name": "X-Civesto-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Civesto-Key"
      }
     },
     {
      "name": "X-Belgu-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Belgu-Key"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/kurumsal/ihbarlar/agrega": {
   "get": {
    "tags": [
     "kurumsal"
    ],
    "summary": "Aggregation (gunluk/haftalik/aylik)",
    "description": "Belirli zaman granularity'sinde ihbar sayisi.",
    "operationId": "aggregate_v1_kurumsal_ihbarlar_agrega_get",
    "parameters": [
     {
      "name": "granularity",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "pattern": "^(hourly|daily|weekly|monthly)$",
       "default": "daily",
       "title": "Granularity"
      }
     },
     {
      "name": "baslangic",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date-time"
        },
        {
         "type": "null"
        }
       ],
       "title": "Baslangic"
      }
     },
     {
      "name": "bitis",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date-time"
        },
        {
         "type": "null"
        }
       ],
       "title": "Bitis"
      }
     },
     {
      "name": "X-Civesto-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Civesto-Key"
      }
     },
     {
      "name": "X-Belgu-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Belgu-Key"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Aggregate V1 Kurumsal Ihbarlar Agrega Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/kurumsal/ihbarlar/ozet": {
   "get": {
    "tags": [
     "kurumsal"
    ],
    "summary": "Period summary — aggregates only, no case-level records",
    "description": "Counts, outcome mix, response times, backlog age, recurring locations\nand arrival pattern for the period. Repeat plates are included only for a\nkey that may read cases (READ); a statistics-only key never sees them.",
    "operationId": "summary_ihbarlar_v1_kurumsal_ihbarlar_ozet_get",
    "parameters": [
     {
      "name": "days",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 366,
       "minimum": 1,
       "default": 30,
       "title": "Days"
      }
     },
     {
      "name": "baslangic",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date-time"
        },
        {
         "type": "null"
        }
       ],
       "title": "Baslangic"
      }
     },
     {
      "name": "bitis",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date-time"
        },
        {
         "type": "null"
        }
       ],
       "title": "Bitis"
      }
     },
     {
      "name": "X-Civesto-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Civesto-Key"
      }
     },
     {
      "name": "X-Belgu-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Belgu-Key"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Summary Ihbarlar V1 Kurumsal Ihbarlar Ozet Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/kurumsal/ihbarlar/heatmap": {
   "get": {
    "tags": [
     "kurumsal"
    ],
    "summary": "Hexbin heatmap (basit grid)",
    "description": "Grid-binning heatmap (lat/lon yaklasimi).\n\nresolution BUYUDUKCE hucre KUCULUR (H3 ve genel haritacilik konvansiyonu):\n    1 -> 0.2   derece (~22 km)   ulke/bolge olcegi\n    3 -> 0.05  derece (~5,5 km)  buyuksehir olcegi\n    6 -> 0.00625 derece (~700 m) sehir ici sicak nokta  <- varsayilan\n    8 -> 0.0016  derece (~175 m) sokak olcegi\n\nNOT: Bu davranis 25 Tem 2026'da DUZELTILDI. Onceki surumde\n`factor = resolution * 0.05` idi, yani resolution buyudukce hucre\nBUYUYOR ve en ince ayar bile ~5,5 km kaliyordu; sehir olceginde tum\nihbarlar tek hucreye dusuyor, isi haritasi tek lekeye donuyordu.\nAyrica `bbox` parametresi kabul edilmiyor, sessizce yok sayiliyordu.",
    "operationId": "heatmap_v1_kurumsal_ihbarlar_heatmap_get",
    "parameters": [
     {
      "name": "resolution",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 10,
       "minimum": 1,
       "default": 6,
       "title": "Resolution"
      }
     },
     {
      "name": "bbox",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "min_lat,min_lon,max_lat,max_lon — verilirse sonuc bu kutuyla sinirlanir",
       "title": "Bbox"
      },
      "description": "min_lat,min_lon,max_lat,max_lon — verilirse sonuc bu kutuyla sinirlanir"
     },
     {
      "name": "X-Civesto-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Civesto-Key"
      }
     },
     {
      "name": "X-Belgu-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Belgu-Key"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Heatmap V1 Kurumsal Ihbarlar Heatmap Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/kurumsal/ihbarlar/geo": {
   "post": {
    "tags": [
     "kurumsal"
    ],
    "summary": "Cografi sorgu (polygon / radius / bbox)",
    "description": "Cografi alandaki ihbarlari donar.",
    "operationId": "geo_query_v1_kurumsal_ihbarlar_geo_post",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 200,
       "title": "Limit"
      }
     },
     {
      "name": "X-Civesto-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Civesto-Key"
      }
     },
     {
      "name": "X-Belgu-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Belgu-Key"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/GeoFilter"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/IhbarListResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/kurumsal/ihbarlar/{ihbar_id}": {
   "get": {
    "tags": [
     "kurumsal"
    ],
    "summary": "Tek ihbar detay",
    "description": "Tek ihbar; tenant scope disindaysa 404.",
    "operationId": "get_ihbar_v1_kurumsal_ihbarlar__ihbar_id__get",
    "parameters": [
     {
      "name": "ihbar_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "title": "Ihbar Id"
      }
     },
     {
      "name": "X-Civesto-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Civesto-Key"
      }
     },
     {
      "name": "X-Belgu-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Belgu-Key"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/IhbarBase"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/kurumsal/ihbarlar/{ihbar_id}/foto": {
   "get": {
    "tags": [
     "kurumsal"
    ],
    "summary": "Ihbar delil fotografi (tenant kapsaminda)",
    "description": "Delil fotografini dondurur.\n\nDosya adiyla dogrudan erisim KAPALIDIR (vatandas mahremiyeti); goruntu\nyalnizca gecerli API anahtariyla ve tenant yetki alani icindeki ihbarlar\nicin sunulur. Yetki disindaysa 404 (varligi da sizdirmaz).",
    "operationId": "get_ihbar_foto_v1_kurumsal_ihbarlar__ihbar_id__foto_get",
    "parameters": [
     {
      "name": "ihbar_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "title": "Ihbar Id"
      }
     },
     {
      "name": "idx",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 9,
       "minimum": 0,
       "default": 0,
       "title": "Idx"
      }
     },
     {
      "name": "X-Civesto-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Civesto-Key"
      }
     },
     {
      "name": "X-Belgu-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Belgu-Key"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/kurumsal/ihbarlar/{ihbar_id}/status": {
   "post": {
    "tags": [
     "kurumsal"
    ],
    "summary": "Ihbar status'unu guncelle (authority pipeline)",
    "description": "Authority pipeline statusu degistirir.\n\nYetkili (GOV_ADMIN scope'lu) tenant API key'i ile cagrilir. Durum\n`new → validated → forwarded → acted → closed` aksinda ilerler ama\ndogrulama yumusak — geri donus de mumkun (yanlislik duzeltmek icin).\n\nHer degisiklik denetim_kaydi tablosuna yazilir (GDPR Art. 30 audit).",
    "operationId": "update_ihbar_status_v1_kurumsal_ihbarlar__ihbar_id__status_post",
    "parameters": [
     {
      "name": "ihbar_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Ihbar Id"
      }
     },
     {
      "name": "X-Civesto-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Civesto-Key"
      }
     },
     {
      "name": "X-Belgu-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Belgu-Key"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/StatusUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/IhbarBase"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "ExportFormat": {
    "type": "string",
    "enum": [
     "json",
     "csv",
     "xlsx",
     "pdf",
     "xml",
     "pdfa3",
     "datex2",
     "geojson"
    ],
    "title": "ExportFormat",
    "description": "Veri export formati."
   },
   "GeoFilter": {
    "properties": {
     "type": {
      "type": "string",
      "enum": [
       "polygon",
       "radius",
       "bbox"
      ],
      "title": "Type"
     },
     "coordinates": {
      "anyOf": [
       {
        "items": {
         "items": {
          "type": "number"
         },
         "type": "array"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Coordinates"
     },
     "center": {
      "anyOf": [
       {
        "items": {
         "type": "number"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Center"
     },
     "radius_km": {
      "anyOf": [
       {
        "type": "number",
        "maximum": 500.0,
        "minimum": 0.1
       },
       {
        "type": "null"
       }
      ],
      "title": "Radius Km"
     },
     "bbox": {
      "anyOf": [
       {
        "items": {
         "type": "number"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Bbox"
     }
    },
    "type": "object",
    "required": [
     "type"
    ],
    "title": "GeoFilter",
    "description": "Cografi sorgu (poligon veya merkez+yaricap)."
   },
   "HTTPValidationError": {
    "properties": {
     "detail": {
      "items": {
       "$ref": "#/components/schemas/ValidationError"
      },
      "type": "array",
      "title": "Detail"
     }
    },
    "type": "object",
    "title": "HTTPValidationError"
   },
   "IhbarBase": {
    "properties": {
     "id": {
      "type": "integer",
      "title": "Id"
     },
     "referans": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Referans"
     },
     "olusturulma_zamani": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Olusturulma Zamani"
     },
     "il": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Il"
     },
     "ilce": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ilce"
     },
     "mahalle": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Mahalle"
     },
     "enlem": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Enlem"
     },
     "boylam": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Boylam"
     },
     "plaka": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Plaka"
     },
     "plaka_hash": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Plaka Hash"
     },
     "suc_tipi": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Suc Tipi"
     },
     "ihlal_turu": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ihlal Turu"
     },
     "aciklama": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Aciklama"
     },
     "foto_url": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foto Url"
     },
     "durum": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Durum"
     },
     "ai_skor": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Skor"
     },
     "ai_durum": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Durum"
     },
     "oncelik": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Oncelik"
     },
     "arac_marka": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Arac Marka"
     },
     "arac_model": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Arac Model"
     },
     "arac_renk": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Arac Renk"
     },
     "foto_sayisi": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foto Sayisi"
     },
     "ihlal_madde": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ihlal Madde"
     },
     "kume_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Kume Id"
     },
     "islem_tarihi": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Islem Tarihi"
     },
     "medya_muhur": {
      "anyOf": [
       {
        "items": {
         "additionalProperties": true,
         "type": "object"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Medya Muhur"
     },
     "forensics": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Forensics"
     },
     "evidence_seal": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Evidence Seal"
     },
     "dispatch": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Dispatch"
     }
    },
    "type": "object",
    "required": [
     "id"
    ],
    "title": "IhbarBase",
    "description": "Ihbar temel alanlari (kismi mapping)."
   },
   "IhbarListResponse": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/IhbarBase"
      },
      "type": "array",
      "title": "Items"
     },
     "next_cursor": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Next Cursor"
     },
     "has_more": {
      "type": "boolean",
      "title": "Has More",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "items"
    ],
    "title": "IhbarListResponse",
    "description": "Pagination'li liste yaniti."
   },
   "MeResponse": {
    "properties": {
     "tenant": {
      "$ref": "#/components/schemas/TenantOut"
     },
     "api_key_prefix": {
      "type": "string",
      "title": "Api Key Prefix"
     },
     "scopes": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Scopes"
     },
     "role": {
      "type": "string",
      "title": "Role",
      "default": "custom"
     },
     "rate_limit_hour": {
      "type": "integer",
      "title": "Rate Limit Hour"
     }
    },
    "type": "object",
    "required": [
     "tenant",
     "api_key_prefix",
     "scopes",
     "rate_limit_hour"
    ],
    "title": "MeResponse",
    "description": "`/me` endpoint'i icin self bilgisi."
   },
   "Plan": {
    "type": "string",
    "enum": [
     "free",
     "basic",
     "pro",
     "enterprise",
     "government"
    ],
    "title": "Plan",
    "description": "Abonelik plani; rate limit ve ozellik kapilarinin tabani."
   },
   "StatusUpdate": {
    "properties": {
     "durum": {
      "type": "string",
      "maxLength": 32,
      "title": "Durum",
      "description": "new|validated|forwarded|acted|closed"
     },
     "not": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 2000
       },
       {
        "type": "null"
       }
      ],
      "title": "Not",
      "description": "Officer notu (opsiyonel)"
     }
    },
    "type": "object",
    "required": [
     "durum"
    ],
    "title": "StatusUpdate",
    "description": "Status değişikliği için isteğin body şeması."
   },
   "TenantOut": {
    "properties": {
     "slug": {
      "type": "string",
      "maxLength": 64,
      "minLength": 3,
      "pattern": "^[a-z0-9][a-z0-9-]*$",
      "title": "Slug"
     },
     "ad": {
      "type": "string",
      "maxLength": 200,
      "minLength": 2,
      "title": "Ad"
     },
     "tip": {
      "$ref": "#/components/schemas/TenantType",
      "default": "private"
     },
     "yetki_il": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Yetki Il"
     },
     "yetki_ilce": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Yetki Ilce"
     },
     "plan": {
      "$ref": "#/components/schemas/Plan",
      "default": "basic"
     },
     "durum": {
      "$ref": "#/components/schemas/TenantStatus",
      "default": "provisioning"
     },
     "kep_adresi": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Kep Adresi"
     },
     "fatura_bilgi": {
      "additionalProperties": true,
      "type": "object",
      "title": "Fatura Bilgi"
     },
     "sla_uptime": {
      "type": "number",
      "title": "Sla Uptime",
      "default": 99.5
     },
     "modul": {
      "type": "string",
      "pattern": "^(police|road_operator)$",
      "title": "Modul",
      "default": "police"
     },
     "id": {
      "type": "integer",
      "title": "Id"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
     }
    },
    "type": "object",
    "required": [
     "slug",
     "ad",
     "id",
     "created_at",
     "updated_at"
    ],
    "title": "TenantOut",
    "description": "Tenant okuma yaniti."
   },
   "TenantStatus": {
    "type": "string",
    "enum": [
     "provisioning",
     "active",
     "suspended",
     "terminated"
    ],
    "title": "TenantStatus",
    "description": "Tenant aktiflik durumu."
   },
   "TenantType": {
    "type": "string",
    "enum": [
     "egm",
     "belediye",
     "buyuksehir",
     "valilik",
     "kaymakamlik",
     "jandarma",
     "private",
     "internal"
    ],
    "title": "TenantType",
    "description": "Tenant tipi (kurum tipi)."
   },
   "ValidationError": {
    "properties": {
     "loc": {
      "items": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "integer"
        }
       ]
      },
      "type": "array",
      "title": "Location"
     },
     "msg": {
      "type": "string",
      "title": "Message"
     },
     "type": {
      "type": "string",
      "title": "Error Type"
     },
     "input": {
      "title": "Input"
     },
     "ctx": {
      "type": "object",
      "title": "Context"
     }
    },
    "type": "object",
    "required": [
     "loc",
     "msg",
     "type"
    ],
    "title": "ValidationError"
   }
  }
 }
}