{"openapi":"3.1.0","info":{"title":"Multi-Hazard Vulnerability Assessment API","description":"API for multi-hazard vulnerability assessments.\n\n**Authentication** (enabled when `AUTH_REQUIRED=true`):\n- `X-API-KEY` header — static API key\n- `Authorization: Bearer <token>` — Mapstore access token","version":"1.0.0"},"paths":{"/":{"get":{"tags":["General"],"summary":"Landing: API discovery","operationId":"root__get","responses":{"200":{"description":"Either the **hazard calculator** (`text/html`) when `enable_calculator_ui` is true, or a small **JSON** discovery document when the UI is off.","content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"version":{"type":"string"},"docs":{"type":"string"},"health":{"type":"string"}},"type":"object"}},"text/html":{"schema":{"type":"string"}}}}}}},"/health":{"get":{"tags":["General"],"summary":"Health Check","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/hazards":{"get":{"tags":["Information"],"summary":"List hazard configurations","description":"Returns available hazard codes with their climate scenarios, variable names, and weight schema keys.","operationId":"get_hazards_info_hazards_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HazardsInfoResponse"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"}},"type":"object"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/building-properties":{"get":{"tags":["Information"],"summary":"List building property schemas","description":"Returns allowed values and types for each building attribute used in vulnerability scoring.","operationId":"get_building_property_values_endpoint_building_properties_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildingPropertiesResponse"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"}},"type":"object"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/vulnerability":{"post":{"tags":["Vulnerability"],"summary":"Calculate Vulnerability","operationId":"calculate_vulnerability_vulnerability_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VulnerabilityRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VulnerabilityResponse"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"}},"type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}}},"components":{"schemas":{"BuildingProperties":{"properties":{"EIDOS_AKINITOU":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eidos Akinitou","description":"Building type (e.g., 'Διαμέρισμα', 'Μονοκατοικία')"},"OROFOS":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Orofos","description":"Number of floors"},"CONSTRUCTION_YEAR":{"anyOf":[{"type":"integer","maximum":2100.0,"minimum":1800.0},{"type":"null"}],"title":"Construction Year","description":"Year of construction"},"MATERIAL":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Material","description":"Building material (e.g., 'Σκυρόδεμα', 'Λιθοδομή')"},"ROOF":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Roof","description":"Roof type (e.g., 'Πλάκα Σκυροδέματος', 'Μεταλλική Στέγη')"}},"type":"object","title":"BuildingProperties"},"BuildingPropertiesResponse":{"properties":{"EIDOS_AKINITOU":{"allOf":[{"$ref":"#/components/schemas/EnumPropertyInfo"}],"description":"Building type"},"MATERIAL":{"allOf":[{"$ref":"#/components/schemas/EnumPropertyInfo"}],"description":"Structural material"},"ROOF":{"allOf":[{"$ref":"#/components/schemas/EnumPropertyInfo"}],"description":"Roof type"},"OROFOS":{"allOf":[{"$ref":"#/components/schemas/IntegerPropertyInfo"}],"description":"Number of floors"},"CONSTRUCTION_YEAR":{"allOf":[{"$ref":"#/components/schemas/IntegerPropertyInfo"}],"description":"Year of construction"}},"type":"object","required":["EIDOS_AKINITOU","MATERIAL","ROOF","OROFOS","CONSTRUCTION_YEAR"],"title":"BuildingPropertiesResponse"},"EnumPropertyInfo":{"properties":{"type":{"const":"enum","title":"Type","default":"enum"},"values":{"items":{"type":"string"},"type":"array","title":"Values","description":"Allowed string values"}},"type":"object","required":["values"],"title":"EnumPropertyInfo"},"Feature":{"properties":{"geometry":{"$ref":"#/components/schemas/PointGeometry"},"properties":{"$ref":"#/components/schemas/BuildingProperties"}},"type":"object","required":["geometry","properties"],"title":"Feature"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HazardInfo":{"properties":{"scenarios":{"items":{"type":"string"},"type":"array","title":"Scenarios","description":"Available climate scenario IDs"},"variables":{"items":{"type":"string"},"type":"array","title":"Variables","description":"Static variable names"},"scenario_variables":{"items":{"type":"string"},"type":"array","title":"Scenario Variables","description":"Per-scenario variable names"},"has_building_attributes":{"type":"boolean","title":"Has Building Attributes","description":"Whether building attributes affect scores"},"weight_schema":{"allOf":[{"$ref":"#/components/schemas/WeightSchema"}],"description":"Allowed keys per weight group"}},"type":"object","required":["scenarios","variables","scenario_variables","has_building_attributes","weight_schema"],"title":"HazardInfo"},"HazardResult":{"properties":{"hist":{"anyOf":[{"$ref":"#/components/schemas/ScenarioResult"},{"type":"null"}]},"rcp26_near":{"anyOf":[{"$ref":"#/components/schemas/ScenarioResult"},{"type":"null"}]},"rcp45_near":{"anyOf":[{"$ref":"#/components/schemas/ScenarioResult"},{"type":"null"}]},"rcp85_near":{"anyOf":[{"$ref":"#/components/schemas/ScenarioResult"},{"type":"null"}]},"rcp26_far":{"anyOf":[{"$ref":"#/components/schemas/ScenarioResult"},{"type":"null"}]},"rcp45_far":{"anyOf":[{"$ref":"#/components/schemas/ScenarioResult"},{"type":"null"}]},"rcp85_far":{"anyOf":[{"$ref":"#/components/schemas/ScenarioResult"},{"type":"null"}]}},"type":"object","title":"HazardResult"},"HazardsInfoResponse":{"properties":{"hazards":{"additionalProperties":{"$ref":"#/components/schemas/HazardInfo"},"type":"object","title":"Hazards","description":"Hazard configurations keyed by hazard code (wf, hw, dr, ls, flr, flc)"}},"type":"object","required":["hazards"],"title":"HazardsInfoResponse","example":{"hazards":{"hw":{"has_building_attributes":true,"scenario_variables":["max_temp","heat_days"],"scenarios":["hist","rcp26_near","rcp45_near","rcp85_near","rcp26_far","rcp45_far","rcp85_far"],"variables":["urban_heat_island"],"weight_schema":{"exposure":["max_temp","heat_days"],"final":["sensitivity","exposure"],"sensitivity":["urban_heat_island"]}},"wf":{"has_building_attributes":true,"scenario_variables":["fire_weather_index"],"scenarios":["hist","rcp26_near","rcp45_near","rcp85_near","rcp26_far","rcp45_far","rcp85_far"],"variables":["slope","aspect","land_cover"],"weight_schema":{"exposure":["fire_weather_index"],"final":["sensitivity","exposure"],"sensitivity":["slope","aspect","land_cover"]}}}}},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status","default":"healthy"},"timestamp":{"type":"string","title":"Timestamp"},"version":{"type":"string","title":"Version","default":"1.0.0"}},"type":"object","title":"HealthResponse"},"IntegerPropertyInfo":{"properties":{"type":{"const":"integer","title":"Type","default":"integer"},"description":{"type":"string","title":"Description"}},"type":"object","required":["description"],"title":"IntegerPropertyInfo"},"PointGeometry":{"properties":{"type":{"type":"string","title":"Type","description":"Geometry type","default":"Point"},"coordinates":{"items":{"type":"number"},"type":"array","maxItems":2,"minItems":2,"title":"Coordinates","description":"[longitude, latitude]"},"crs":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crs","description":"Coordinate reference system","default":"EPSG:4326"}},"type":"object","required":["coordinates"],"title":"PointGeometry"},"RuntimeOverrides":{"properties":{"wf":{"anyOf":[{"$ref":"#/components/schemas/WeightOverrides"},{"type":"null"}],"description":"Wildfire overrides"},"hw":{"anyOf":[{"$ref":"#/components/schemas/WeightOverrides"},{"type":"null"}],"description":"Heatwave overrides"},"dr":{"anyOf":[{"$ref":"#/components/schemas/WeightOverrides"},{"type":"null"}],"description":"Drought overrides"},"ls":{"anyOf":[{"$ref":"#/components/schemas/WeightOverrides"},{"type":"null"}],"description":"Landslide overrides"},"flr":{"anyOf":[{"$ref":"#/components/schemas/WeightOverrides"},{"type":"null"}],"description":"River flood overrides"},"flc":{"anyOf":[{"$ref":"#/components/schemas/WeightOverrides"},{"type":"null"}],"description":"Coastal flood overrides"}},"type":"object","title":"RuntimeOverrides"},"ScenarioResult":{"properties":{"sensitivity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sensitivity","description":"Sensitivity score"},"exposure":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exposure","description":"Exposure score"},"vulnerability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Vulnerability","description":"Final vulnerability score"},"used_weights":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Used Weights","description":"Applied weights (if overrides were used)"}},"type":"object","title":"ScenarioResult"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VulnerabilityRequest":{"properties":{"feature":{"allOf":[{"$ref":"#/components/schemas/Feature"}],"description":"Building feature with geometry and properties"},"runtime_overrides":{"anyOf":[{"$ref":"#/components/schemas/RuntimeOverrides"},{"type":"null"}],"description":"Optional weight overrides for hazards"}},"type":"object","required":["feature"],"title":"VulnerabilityRequest","example":{"feature":{"geometry":{"coordinates":[23.022783,40.556106],"crs":"EPSG:4326","type":"Point"},"properties":{"EIDOS_AKINITOU":"Διαμέρισμα","OROFOS":2,"CONSTRUCTION_YEAR":1995,"MATERIAL":"Σκυρόδεμα","ROOF":"Πλάκα Σκυροδέματος"}}}},"VulnerabilityResponse":{"properties":{"asset":{"allOf":[{"$ref":"#/components/schemas/Feature"}],"description":"Input asset feature"},"runtime_overrides":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Runtime Overrides","description":"Applied runtime overrides"},"results":{"additionalProperties":{"$ref":"#/components/schemas/HazardResult"},"type":"object","title":"Results","description":"Vulnerability results by hazard"},"timestamp":{"type":"string","title":"Timestamp","description":"Response timestamp"},"success":{"type":"boolean","title":"Success","description":"Request success status","default":true},"elapsed_time_seconds":{"type":"number","title":"Elapsed Time Seconds","description":"Time elapsed for vulnerability calculation in seconds"},"elapsed_time_ms":{"type":"number","title":"Elapsed Time Ms","description":"Time elapsed for vulnerability calculation in milliseconds"}},"type":"object","required":["asset","results","elapsed_time_seconds","elapsed_time_ms"],"title":"VulnerabilityResponse","example":{"asset":{"geometry":{"coordinates":[23.022783,40.556106],"crs":"EPSG:4326","type":"Point"},"properties":{"EIDOS_AKINITOU":"Διαμέρισμα","OROFOS":2,"CONSTRUCTION_YEAR":1995,"MATERIAL":"Σκυρόδεμα","ROOF":"Πλάκα Σκυροδέματος"}},"elapsed_time_ms":1234.0,"elapsed_time_seconds":1.234,"results":{"wf":{"hist":{"exposure":3.2,"sensitivity":2.5,"vulnerability":2.82}}},"success":true,"timestamp":"2024-01-01T12:00:00"}},"WeightOverrides":{"properties":{"weights":{"anyOf":[{"additionalProperties":{"additionalProperties":{"type":"number"},"type":"object"},"type":"object"},{"type":"null"}],"title":"Weights","description":"Global weight overrides: {sensitivity: {...}, exposure: {...}, final: {...}} (applied to every climate scenario)."},"weights_by_scenario":{"anyOf":[{"additionalProperties":{"additionalProperties":{"additionalProperties":{"type":"number"},"type":"object"},"type":"object"},"type":"object"},{"type":"null"}],"title":"Weights By Scenario","description":"Per climate scenario inner weights: {scenario_id: {sensitivity|exposure|final: {var: weight}}}. Merged on top of the hazard defaults (and global `weights` overrides) for that scenario only."}},"type":"object","title":"WeightOverrides"},"WeightSchema":{"properties":{"sensitivity":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Sensitivity","description":"Sensitivity weight keys"},"exposure":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Exposure","description":"Exposure weight keys"},"final":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Final","description":"Final blend keys (sensitivity, exposure)"}},"type":"object","title":"WeightSchema"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY","description":"Static API key passed in the `X-API-KEY` request header."},"HTTPBearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Mapstore access token passed as `Authorization: Bearer <token>`."}}},"tags":[{"name":"General","description":"Service root and health check."},{"name":"Information","description":"Hazard metadata and building-property schemas."},{"name":"Vulnerability","description":"Multi-hazard vulnerability computation for a GeoJSON feature."}]}