{"openapi":"3.0.2","info":{"title":"Catastrophe Risk API","description":"API for catastrophe risk data","version":"1.0.0"},"paths":{"/version/":{"get":{"summary":"Get Version","description":"Return build version information (message, branch, hash).","operationId":"get_version_version__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/version":{"get":{"summary":"Get Version","description":"Return build version information (message, branch, hash).","operationId":"get_version_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/earthquake":{"post":{"summary":"Post Earthquakes","description":"Handle POST requests for earthquake data","operationId":"post_earthquakes_v1_earthquake_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EarthquakeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/earthquake/_events":{"post":{"summary":" Post Earthquakes Internal","operationId":"_post_earthquakes_internal_v1_earthquake__events_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EarthquakeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/earthquake/benchmark":{"post":{"summary":"Post Earthquake Benchmark","description":"Handle benchmark requests for earthquake data","operationId":"post_earthquake_benchmark_v1_earthquake_benchmark_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EarthquakeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/weather":{"post":{"summary":"Post Weather","description":"Handle POST requests for weather data","operationId":"post_weather_v1_weather_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WeatherRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/weather/benchmark":{"post":{"summary":"Post Weather Benchmark","description":"Handle benchmark requests for weather data","operationId":"post_weather_benchmark_v1_weather_benchmark_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WeatherRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/weather/report":{"post":{"summary":"Create Weather Report","description":"Create a new weather report for long-running analysis","operationId":"create_weather_report_v1_weather_report_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WeatherReportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]},"options":{"summary":"Options Weather Report","description":"Handle OPTIONS requests for CORS preflight","operationId":"options_weather_report_v1_weather_report_options","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/weather/report/{report_id}":{"get":{"summary":"Get Weather Report Status","description":"Get the status of a weather report","operationId":"get_weather_report_status_v1_weather_report__report_id__get","parameters":[{"required":true,"schema":{"title":"Report Id","type":"integer"},"name":"report_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]},"put":{"summary":"Update Weather Report","description":"Update a weather report (e.g., to associate/disassociate payout structures)","operationId":"update_weather_report_v1_weather_report__report_id__put","parameters":[{"required":true,"schema":{"title":"Report Id","type":"integer"},"name":"report_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetReportPolicyId"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]},"delete":{"summary":"Delete Weather Report","description":"Mark a weather report as deleted","operationId":"delete_weather_report_v1_weather_report__report_id__delete","parameters":[{"required":true,"schema":{"title":"Report Id","type":"integer"},"name":"report_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/weather/location-groups":{"get":{"summary":"Get All Location Groups","description":"Get all location groups for a user with optimized DB queries","operationId":"get_all_location_groups_v1_weather_location_groups_get","parameters":[{"required":false,"schema":{"title":"Userid","type":"string"},"name":"userId","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]},"post":{"summary":"Post Location Group","description":"Create a new location group","operationId":"post_location_group_v1_weather_location_groups_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationGroupCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/weather/location-groups/{group_id}":{"get":{"summary":"Get Single Location Group","description":"Get a specific location group","operationId":"get_single_location_group_v1_weather_location_groups__group_id__get","parameters":[{"required":true,"schema":{"title":"Group Id","type":"integer"},"name":"group_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]},"put":{"summary":"Update Single Location Group","description":"Update a location group","operationId":"update_single_location_group_v1_weather_location_groups__group_id__put","parameters":[{"required":true,"schema":{"title":"Group Id","type":"integer"},"name":"group_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationGroupCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]},"delete":{"summary":"Delete Single Location Group","description":"Delete a location group","operationId":"delete_single_location_group_v1_weather_location_groups__group_id__delete","parameters":[{"required":true,"schema":{"title":"Group Id","type":"integer"},"name":"group_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/weather/policies":{"get":{"summary":"Get User Payout Structures","description":"Get all payout structures for a user and metric","operationId":"get_user_payout_structures_v1_weather_policies_get","parameters":[{"required":false,"schema":{"$ref":"#/components/schemas/WeatherMetric"},"name":"metric","in":"query"},{"required":true,"schema":{"title":"Userid","type":"string"},"name":"userId","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]},"post":{"summary":"Post Payout Structure","description":"Create a new payout structure","operationId":"post_payout_structure_v1_weather_policies_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutStructureCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/weather/policies/{structure_id}":{"get":{"summary":"Get Single Payout Structure","description":"Get a specific payout structure","operationId":"get_single_payout_structure_v1_weather_policies__structure_id__get","parameters":[{"required":true,"schema":{"title":"Structure Id","type":"integer"},"name":"structure_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]},"put":{"summary":"Update Single Payout Structure","description":"Update a payout structure","operationId":"update_single_payout_structure_v1_weather_policies__structure_id__put","parameters":[{"required":true,"schema":{"title":"Structure Id","type":"integer"},"name":"structure_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutStructureCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]},"delete":{"summary":"Delete Single Payout Structure","description":"Delete a payout structure","operationId":"delete_single_payout_structure_v1_weather_policies__structure_id__delete","parameters":[{"required":true,"schema":{"title":"Structure Id","type":"integer"},"name":"structure_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/":{"get":{"summary":"Root","description":"Root endpoint that returns API information","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Is Alive","description":"Health check endpoint to verify API service is running correctly.\nReturns status 200 if the service is healthy.","operationId":"is_alive_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/detailed":{"get":{"summary":"Health Check Detailed","description":"Detailed health check that verifies all system dependencies\nand provides comprehensive system status. Protected by API key.","operationId":"health_check_detailed_health_detailed_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/admin/weather/reports/volatile-storage":{"get":{"summary":"Get Volatile Storage Status","description":"Admin endpoint to view the current state of volatile storage\nfor monitoring and debugging purposes.","operationId":"get_volatile_storage_status_admin_weather_reports_volatile_storage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/admin/weather/reports/monitoring/control":{"post":{"summary":"Control Background Monitoring","description":"Admin endpoint to control the background monitoring system.\nActions: 'start', 'stop', 'restart', 'status'","operationId":"control_background_monitoring_admin_weather_reports_monitoring_control_post","parameters":[{"required":true,"schema":{"title":"Action","type":"string"},"name":"action","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/weather/report/{report_id}/data":{"get":{"summary":"Get Weather Report Data","description":"Get the weather data for a weather report","operationId":"get_weather_report_data_v1_weather_report__report_id__data_get","parameters":[{"required":true,"schema":{"title":"Report Id","type":"integer"},"name":"report_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/weather/reports":{"get":{"summary":"Get User Weather Reports","description":"Get all reports, optionally filtered by user_id","operationId":"get_user_weather_reports_v1_weather_reports_get","parameters":[{"required":false,"schema":{"title":"Userid","type":"string"},"name":"userId","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/test-payout":{"get":{"summary":"Test Payout Endpoint","description":"Simple test endpoint","operationId":"test_payout_endpoint_test_payout_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"BasePayoutStructure":{"title":"BasePayoutStructure","required":["percentPayout","thresholdValue"],"type":"object","properties":{"percentPayout":{"title":"Percentpayout","maximum":100.0,"minimum":0.0,"type":"number"},"thresholdValue":{"title":"Thresholdvalue","type":"number"}},"additionalProperties":false},"CoordinatePoint":{"title":"CoordinatePoint","required":["latitude","longitude"],"type":"object","properties":{"latitude":{"title":"Latitude","maximum":90.0,"minimum":-90.0,"type":"number"},"longitude":{"title":"Longitude","maximum":180.0,"minimum":-180.0,"type":"number"}}},"EarthquakeRequest":{"title":"EarthquakeRequest","required":["startDate","coverType","payoutStructure","coordinates"],"type":"object","properties":{"startDate":{"title":"Startdate","type":"string"},"endDate":{"title":"Enddate","type":"string"},"coverType":{"title":"Covertype","enum":["aggregate","occurrence"],"type":"string"},"policyLimit":{"title":"Policylimit","type":"integer"},"deductible":{"title":"Deductible","type":"integer"},"payoutStructure":{"title":"Payoutstructure","type":"array","items":{"$ref":"#/components/schemas/BasePayoutStructure"},"description":"List of payout structures"},"thresholdType":{"title":"Thresholdtype","enum":["atleast","atmost"],"type":"string","default":"atleast"},"distanceUnit":{"title":"Distanceunit","enum":["miles","km"],"type":"string","default":"km"},"coordinates":{"title":"Coordinates","type":"array","items":{"$ref":"#/components/schemas/CoordinatePoint"},"description":"List of coordinate points as dictionaries"},"coordinatesFormat":{"title":"Coordinatesformat","enum":["standard","geojson"],"type":"string","default":"standard"},"radius":{"title":"Radius","minimum":0.0,"type":"integer","description":"Radius around latitude/longitude point to examine"},"maximumDepth":{"title":"Maximumdepth","exclusiveMinimum":0.0,"type":"integer","description":"Maximum depth to consider","default":0},"event_type":{"title":"Event Type","type":"string","default":"earthquake"}},"additionalProperties":false},"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"Location":{"title":"Location","required":["label","coordinates"],"type":"object","properties":{"id":{"title":"Id","type":"integer"},"label":{"title":"Label","type":"string"},"address":{"title":"Address","type":"string"},"coordinates":{"$ref":"#/components/schemas/CoordinatePoint"}},"additionalProperties":false},"LocationGroupCreate":{"title":"LocationGroupCreate","required":["userId","label","locations"],"type":"object","properties":{"userId":{"title":"Userid","type":"string"},"label":{"title":"Label","type":"string"},"locations":{"title":"Locations","type":"array","items":{"$ref":"#/components/schemas/Location"}}},"additionalProperties":false},"PayoutLevel":{"title":"PayoutLevel","required":["threshold","percentage"],"type":"object","properties":{"threshold":{"title":"Threshold","type":"number"},"percentage":{"title":"Percentage","type":"number"}},"additionalProperties":false},"PayoutStructureCreate":{"title":"PayoutStructureCreate","required":["name","metric","userId","payoutLevels"],"type":"object","properties":{"name":{"title":"Name","type":"string"},"metric":{"title":"Metric","type":"string"},"userId":{"title":"Userid","type":"string"},"policyLimit":{"title":"Policylimit","type":"integer"},"deductible":{"title":"Deductible","type":"integer"},"isAggregate":{"title":"Isaggregate","type":"boolean","default":false},"isPerGroup":{"title":"Ispergroup","type":"boolean","default":false},"isAboveThreshold":{"title":"Isabovethreshold","type":"boolean","default":true},"payoutLevels":{"title":"Payoutlevels","type":"array","items":{"$ref":"#/components/schemas/PayoutLevel"}}},"additionalProperties":false},"PayoutThreshold":{"title":"PayoutThreshold","type":"object","properties":{"thresholdValue":{"title":"Thresholdvalue","type":"number","default":0},"percentPayout":{"title":"Percentpayout","type":"number","default":0}},"additionalProperties":false},"SetReportPolicyId":{"title":"SetReportPolicyId","required":["policyId"],"type":"object","properties":{"policyId":{"title":"Policyid","type":"integer"}},"additionalProperties":false},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}}},"WeatherMetric":{"title":"WeatherMetric","enum":["temperatureHigh","temperatureLow","precipitation","rainfall","snowfall","windSpeed","gustSpeed","radiation","evaporation","uvIndex"],"type":"string","description":"An enumeration."},"WeatherReportRequest":{"title":"WeatherReportRequest","required":["userId","locationGroupId","metric"],"type":"object","properties":{"userId":{"title":"Userid","type":"string"},"locationGroupId":{"title":"Locationgroupid","type":"integer"},"metric":{"allOf":[{"$ref":"#/components/schemas/WeatherMetric"}],"description":"Weather metric to analyze"},"shapeType":{"title":"Shapetype","type":"string","description":"Type of shape for processing: 'points' or 'grid'","default":"points"},"shape":{"title":"Shape","type":"array","items":{},"description":"Shape data for area definition"},"startDate":{"title":"Startdate","type":"string","description":"Start date for analysis","default":"2020-01-01"},"endDate":{"title":"Enddate","type":"string","description":"End date for analysis","default":"2020-12-31"},"thresholdType":{"title":"Thresholdtype","type":"string","description":"Threshold type for payouts","default":"atleast"},"coverType":{"title":"Covertype","type":"string","description":"Cover type for insurance","default":"occurrence"},"policyLimit":{"title":"Policylimit","type":"integer","description":"Policy limit for insurance","default":1000000},"deductible":{"title":"Deductible","type":"integer","description":"Deductible amount for insurance","default":0},"payoutStructure":{"title":"Payoutstructure","type":"array","items":{"$ref":"#/components/schemas/PayoutThreshold"},"description":"Payout structure for insurance"}},"additionalProperties":false},"WeatherRequest":{"title":"WeatherRequest","required":["startDate","coverType","payoutStructure","coordinates","metric"],"type":"object","properties":{"startDate":{"title":"Startdate","type":"string"},"endDate":{"title":"Enddate","type":"string"},"coverType":{"title":"Covertype","enum":["aggregate","occurrence"],"type":"string"},"policyLimit":{"title":"Policylimit","type":"integer"},"deductible":{"title":"Deductible","type":"integer"},"payoutStructure":{"title":"Payoutstructure","type":"array","items":{"$ref":"#/components/schemas/BasePayoutStructure"},"description":"List of payout structures"},"thresholdType":{"title":"Thresholdtype","enum":["atleast","atmost"],"type":"string","default":"atleast"},"distanceUnit":{"title":"Distanceunit","enum":["miles","km"],"type":"string","default":"km"},"coordinates":{"title":"Coordinates","type":"array","items":{"$ref":"#/components/schemas/CoordinatePoint"},"description":"List of coordinate points as dictionaries"},"coordinatesFormat":{"title":"Coordinatesformat","enum":["standard","geojson"],"type":"string","default":"standard"},"radius":{"title":"Radius","minimum":0.0,"type":"integer","description":"Radius around latitude/longitude point to examine"},"maximumDepth":{"title":"Maximumdepth","minimum":0.0,"type":"integer","description":"Depth of the location to examine","default":0},"metric":{"$ref":"#/components/schemas/WeatherMetric"},"event_type":{"title":"Event Type","type":"string","default":"weather"}},"additionalProperties":false}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"Authorization"}}}}