{"openapi":"3.1.0","info":{"title":"SecureFlow API","version":"0.1.7"},"paths":{"/api/v1/scenarios":{"get":{"tags":["scenarios"],"summary":"List Scenarios","operationId":"list_scenarios_api_v1_scenarios_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioListResponse"}}}}}},"post":{"tags":["scenarios"],"summary":"Create Scenario","operationId":"create_scenario_api_v1_scenarios_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioWriteBody"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scenarios/{scenario_id}":{"get":{"tags":["scenarios"],"summary":"Get Scenario","operationId":"get_scenario_api_v1_scenarios__scenario_id__get","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["scenarios"],"summary":"Replace Scenario","operationId":"replace_scenario_api_v1_scenarios__scenario_id__put","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioWriteBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["scenarios"],"summary":"Delete Scenario","operationId":"delete_scenario_api_v1_scenarios__scenario_id__delete","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/system/status":{"get":{"tags":["system"],"summary":"System Status","description":"Aggregated runtime overview for the operator dashboard.","operationId":"system_status_api_v1_system_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemStatusResponse"}}}}}}},"/api/v1/edge/devices":{"get":{"tags":["edge"],"summary":"List Edge Devices","operationId":"list_edge_devices_api_v1_edge_devices_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":2000,"minimum":1},{"type":"null"}],"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"enum":["device_id","vendor","profile_token_default","first_xaddr"],"type":"string"},{"type":"null"}],"title":"Sort"}},{"name":"order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Order"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"Case-insensitive filter. Whitespace separates tokens; each token must appear as a substring in the merged searchable fields (device id, vendor, notes, profile, secret_ref, xaddrs, ONVIF profiles). Logical AND across tokens.","title":"Q"},"description":"Case-insensitive filter. Whitespace separates tokens; each token must appear as a substring in the merged searchable fields (device id, vendor, notes, profile, secret_ref, xaddrs, ONVIF profiles). Logical AND across tokens."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EdgeDeviceListResponse"}}}},"304":{"description":"Not Modified — `If-None-Match` matched current list representation"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/edge/devices/{device_id}":{"get":{"tags":["edge"],"summary":"Get Edge Device","operationId":"get_edge_device_api_v1_edge_devices__device_id__get","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EdgeDeviceItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Root","description":"Public root for Ingress health checks and human probes (avoids 404 on bare host).","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Root  Get"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/readyz":{"get":{"summary":"Readyz","description":"Readiness: optional MQTT handshake to L5 broker (see docs/api/l4-runtime-env.md).","operationId":"readyz_readyz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"EdgeDeviceItem":{"properties":{"device_id":{"type":"string","minLength":1,"title":"Device Id"},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor"},"profile_token_default":{"type":"string","minLength":1,"title":"Profile Token Default"},"xaddrs":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Xaddrs"},"onvif_profiles_supported":{"items":{"type":"string"},"type":"array","title":"Onvif Profiles Supported"},"secret_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret Ref"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["device_id","profile_token_default","xaddrs"],"title":"EdgeDeviceItem","description":"Public projection of a row from device inventory v1 (no secrets)."},"EdgeDeviceListResponse":{"properties":{"inventory_schema_version":{"type":"integer","title":"Inventory Schema Version","default":1},"configured":{"type":"boolean","title":"Configured"},"inventory_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Dir"},"devices":{"items":{"$ref":"#/components/schemas/EdgeDeviceItem"},"type":"array","title":"Devices"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"},"offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Offset"}},"type":"object","required":["configured","devices"],"title":"EdgeDeviceListResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MetricsSnapshot":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"http_requests_total":{"type":"number","title":"Http Requests Total","default":0},"http_avg_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Http Avg Latency Ms"}},"type":"object","required":["enabled"],"title":"MetricsSnapshot"},"MqttStatus":{"properties":{"reachable":{"type":"boolean","title":"Reachable"},"broker":{"type":"string","title":"Broker"},"port":{"type":"integer","title":"Port"},"skipped":{"type":"boolean","title":"Skipped","default":false}},"type":"object","required":["reachable","broker","port"],"title":"MqttStatus"},"ScenarioDetailResponse":{"properties":{"scenario_id":{"type":"string","title":"Scenario Id"},"source_file":{"type":"string","title":"Source File"},"document":{"additionalProperties":true,"type":"object","title":"Document"},"validation":{"$ref":"#/components/schemas/ScenarioValidation"}},"type":"object","required":["scenario_id","source_file","document","validation"],"title":"ScenarioDetailResponse"},"ScenarioListItem":{"properties":{"scenario_id":{"type":"string","title":"Scenario Id"},"source_file":{"type":"string","title":"Source File"},"validation":{"$ref":"#/components/schemas/ScenarioValidation"}},"type":"object","required":["scenario_id","source_file","validation"],"title":"ScenarioListItem"},"ScenarioListResponse":{"properties":{"scenarios":{"items":{"$ref":"#/components/schemas/ScenarioListItem"},"type":"array","title":"Scenarios"},"scenario_dir":{"type":"string","title":"Scenario Dir"}},"type":"object","required":["scenario_dir"],"title":"ScenarioListResponse"},"ScenarioOverview":{"properties":{"total":{"type":"integer","title":"Total","default":0},"valid":{"type":"integer","title":"Valid","default":0},"invalid":{"type":"integer","title":"Invalid","default":0},"directory":{"type":"string","title":"Directory","default":""}},"type":"object","title":"ScenarioOverview"},"ScenarioValidation":{"properties":{"ok":{"type":"boolean","title":"Ok"},"issues":{"items":{"type":"string"},"type":"array","title":"Issues"}},"type":"object","required":["ok"],"title":"ScenarioValidation"},"ScenarioWriteBody":{"properties":{"document":{"additionalProperties":true,"type":"object","title":"Document"}},"type":"object","required":["document"],"title":"ScenarioWriteBody","description":"JSON body matching on-disk YAML shape (scenario, trigger, actions, …)."},"SystemStatusResponse":{"properties":{"service":{"type":"string","title":"Service","default":"secureflow-api"},"version":{"type":"string","title":"Version"},"uptime_seconds":{"type":"number","title":"Uptime Seconds"},"timestamp":{"type":"number","title":"Timestamp"},"mqtt":{"$ref":"#/components/schemas/MqttStatus"},"scenarios":{"$ref":"#/components/schemas/ScenarioOverview"},"metrics":{"$ref":"#/components/schemas/MetricsSnapshot"},"environment":{"additionalProperties":{"type":"string"},"type":"object","title":"Environment"}},"type":"object","required":["version","uptime_seconds","timestamp","mqtt","scenarios","metrics"],"title":"SystemStatusResponse"},"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"}}}}