{"openapi":"3.1.0","info":{"title":"DeepAPI","version":"1.0"},"paths":{"/v1.0/alert_rule_eval_explain":{"post":{"summary":"Alert Rule Eval Explain","description":"Return a ChatGPT explanation for an alert rule evaluation","operationId":"alert_rule_eval_explain","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRuleEvalExplainResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/alert_accuracy_flag":{"get":{"summary":"Get Alert Accuracy Flag","description":"Fetch alert accuracy flag details from the database.\n\nRequest params:\n    alert_id - database id of the sensor to retrieve (first priority)","operationId":"get_alert_accuracy_flag","security":[{"HTTPBearer":[]}],"parameters":[{"name":"alert_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Alert Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAlertAccuracyFlagResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Alert Accuracy Flag","description":"Update alert accuracy flag information in ElasticSearch","operationId":"update_alert_accuracy_flag","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAlertAccuracyFlagRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAlertAccuracyFlagResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/alert_suppress_flag":{"put":{"summary":"Update Alert Suppress Flag","description":"Suppress an alert's detections, or lift the rules listing it","operationId":"update_alert_suppress_flag","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAlertSuppressFlagRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAlertSuppressFlagResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/detection_suppressions":{"post":{"summary":"Create Detection Suppressions","description":"Suppress the detections of alerts, or of a frame that has no alert.","operationId":"create_detection_suppressions","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDetectionSuppressionsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectionSuppressionsWriteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Detection Suppressions","description":"The sensor's active, unexpired rules.","operationId":"list_detection_suppressions","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sensor_id","in":"query","required":true,"schema":{"type":"integer","minimum":1,"title":"Sensor Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectionSuppressionListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/detection_suppressions/lift":{"post":{"summary":"Lift Detection Suppressions","description":"Lift every rule on a frame, the named rules of one sensor, or the rules listing the alerts.","operationId":"lift_detection_suppressions","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiftDetectionSuppressionsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectionSuppressionsWriteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/detection_suppressions/reapply":{"post":{"summary":"Reapply Detection Suppressions","description":"Renew or reactivate the rules on a frame.","operationId":"reapply_detection_suppressions","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReapplyDetectionSuppressionsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectionSuppressionsWriteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/auto_suppress_on_train_click":{"post":{"summary":"Auto Suppress On Train Click","description":"Best-effort auto-suppression check for a train-clicked alert.\n\nTracks train clicks per sensor+class and, if two visually similar single-detection alerts are\ntrain-clicked within the configured window, turns on alert suppression for that sensor. The\nheavy lifting (feature-flag gating, single-detection check, embedding comparison, redis tracker)\nlives in check_and_auto_suppress_on_train_click.","operationId":"auto_suppress_on_train_click","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoSuppressOnTrainClickRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoSuppressOnTrainClickResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/analytics":{"post":{"summary":"Analytics","description":"Perform DeepAlert analytics and alert rule evaluation processing for a supplied video clip\nor sequence of images and return the results.\n\nThe request must include a valid token in the Authorization header and exactly one of sensor_id,\nsensor_id_str or tag, either in the body or as a query parameter. The request may also include some\nrequest alert config parameters to use.\n\nParams:\n\n    file - the media content to process. This can be a video file or a sequence of image files (required).\n        A single video or image may instead be sent as the raw request body with a video/* or image/*\n        content type, in which case the other parameters must be query parameters.\n\n    sensor_id - integer DeepAlert database sensor_id to use in the request OR\n\n    sensor_id_str - string DeepAlert database sensor_id_str to use in the request OR\n\n    tag - string DeepAlert database sensor tag to use in the request\n\n    alert_configs - stringified list of \"validator\" format alert config dictionaries to use in the\n        processing of the request (optional) (see example below).\n\n    applicable_alert_type - string alert type to apply to the request with the default of\n        \"analytics\" from [\"analytics\", \"scheduled\", \"snapshot\", \"detector\"]. If submitting alert_configs,\n        applicable_alert_type is ignored in the request and derived instead from the alert_configs.\n\n    alert_configs_priority - stringified list of rule priority types to apply to the request with the default of\n        '[\"request\", \"existing\"]'. This is the order of precedence in locating rules for\n        the analytics processing where:\n            \"request\" -> look in the alert_configs supplied with the request\n            \"existing\" -> look for existing sensor-defined DB rules and applicable site rules\n\n    event_timestamp - float UTC timestamp for the event e.g. 1719401529.2690928 (will use current\n        UTC timestamp if not supplied)\n\n    description - string description of the event, currently used for Ajax and Frontel detector trigger alerts.\n\n    auto_create - if true and no sensor with the supplied tag exists, create one on site_id with that tag\n        (requires tag, site_id and the manage_sensor permission). The site must have exactly one enabled hub.\n\n    site_id - integer DeepAlert database site id to auto-create the sensor on (only used with auto_create)\n\n    auto_create and site_id may also be supplied as query parameters.\n\nIf alert_configs are supplied they should be in the form of a stringified JSON object in the body of the\nrequest with the key \"alert_configs\" and a list of alert config dictionaries in the DeepAlert \"validator\" format\nas the value. If more than one alert_type is supplied with the request, an error will be retured. A python dict\nrepresentation of this for a specified sensor with id=123 where alert_configs are supplied for an \"AlertZones\"\nrule_subtype, for example:\n\n    {\n        \"sensor_id\": 123,\n        \"alert_configs\": '[\n            {\n                \"alert_type\": \"analytics\",\n                \"alert_config_type: \"AlertZones\",\n                \"alert_config_name\": \"people and vehicles full-image rule\",\n                \"valid_days_and_times\": None,\n                \"rule_configs\": {\n                    \"AlertZones\": {\n                        \"zone_configs\": [\n                            {\n                                \"zone:\": \"full_image\",\n                                \"object_motion\": \"include_all\",\n                                \"class_label\": \"human1.people\",\n                                \"confidence_threshold\": 35.0\n                            },\n                            {\n                                \"zone:\": \"full_image\",\n                                \"object_motion\": \"moving_only\",\n                                \"class_label\": \"human1.vehicles\",\n                                \"confidence_threshold\": 35.0\n                            },\n                        ]\n                    },\n                },\n            },\n        ]'\n    }\n\nReturns:\n    A json structure with the analytics results. For example, where no alert triggered:\n\n    {\n        \"success\": true,\n        \"msg\": \"Processed 1 advanced rules for TSLHQICXS-a with no alerts\",\n        \"event_alerted\": false,\n        \"alert_config_results\": [\n            {\n            \"alert_config_name\": \"Default DeepAPI Analytics Request Rule\",\n            \"alert_config_type\": \"AlertZones\",\n            \"alert_type\": \"analytics\",\n            \"alerted\": false\n            }\n        ]\n    }\n\n    For alert-triggered case where, for example, the 2nd image in the sequence was treated as\n    the trigger image (alert_image_index = 1):\n\n    {\n        \"success\": true,\n        \"msg\": \"Processed 1 advanced rules for TSLHQICXS-a with alerts\",\n        \"event_alerted\": true,\n        \"alert_config_results\": [\n            {\n            \"alert_config_name\": \"default processing rule\",\n            \"alert_config_type\": \"AlertZones\",\n            \"alert_type\": \"analytics\",\n            \"alerted\": true,\n            \"alert_image_index\": 1,\n            \"alerted_image_stats\": {\n                \"n_detections\": 1,\n                \"total_score\": 0.8164,\n                \"max_score\": 0.8164,\n                \"max_short_class_label\": \"people\",\n                \"triggered_short_classes\": [\"people\"]\n            },\n            \"alert_message\": \"Jasper Test (JH Cam 1): people detected at 11h14:14 on 24 Feb 2024\",\n            \"alert_short_message\": \"people detected at 11h14:14 on 24 Feb 2024\",\n            \"alert_timezone\": \"Europe/London\",\n            \"alert_priority_reason\": \"A person can be seen holding a weapon\",\n            \"normalised_bboxes\": [{\"object_class\": \"people\", \"probabilty\": 0.8164, \"x0\": 12, \"y0\": 20, \"x1\": 110, \"y1\": 80}]\n            \"alert_image_url\": \"<image presigned URL>\",\n            \"video_url\": \"<image presigned URL>\"\n            }\n        ]\n    }\n\n    The \"results\" are a list of dictionaries with the analytics results, one for each rule processed.\n    Note the \"video_image_path\" key in the case of an alerted rule will only be there if an alerting\n    video was created.","operationId":"analytics","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sensor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sensor Id"}},{"name":"sensor_id_str","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sensor Id Str"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}},{"name":"auto_create","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Auto Create"}},{"name":"site_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Site Id"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_analytics_v1_0_analytics_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/resource_list":{"get":{"summary":"Get Org Resources","description":"Return a list of org accessible end points","operationId":"get_org_resources","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApiResource"},"type":"array","title":"Response Get Org Resources V1 0 Resource List Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/auth_check":{"get":{"summary":"Perform Auth Check","description":"Simple Auth Check","operationId":"perform_auth_check","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthCheckResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/current_token":{"get":{"summary":"Get Current Token","description":"Return id, org_id, site_id and description of the bearer token used to authenticate.","operationId":"get_current_token","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentTokenResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/billing_usage":{"get":{"summary":"Get Billing Usage","description":"Get billing usage data for an organization including site sensors and invoice items.\n\nThis endpoint extracts and returns usage data for billing from the usage table for an org/customer\nas contained in the site_sensors report and the relevant rows for the org/customer from the\ninvoice_items report, but excluding the \"inactive\" and \"net\" columns.\n\nParams:\n    export_date - Optional date for the export (YYYY-MM-DD format). If not provided, uses current UTC date.\n    org_id - Optional organization ID. If not provided, uses the entry_org_id from the auth token.\n\nReturns:\n    A JSON response containing site sensors data and invoice items data for the specified organization and date.","operationId":"get_billing_usage","security":[{"HTTPBearer":[]}],"parameters":[{"name":"export_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Export Date"}},{"name":"org_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBillingUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/edge_enhanced_smtp":{"post":{"summary":"Generate Edge Enhanced Smtp Details","operationId":"generate_edge_enhanced_smtp_details","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EdgeEnhancedRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EdgeEnhancedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/sensor_health":{"post":{"summary":"Add Sensor Health Record","description":"Add a new sensor health record to elastic","operationId":"add_sensor_health_record","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSensorHealthRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSensorHealthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/hub_health":{"get":{"summary":"Get Hub Health Record","description":"Get the latest hub health record from Elasticsearch","operationId":"get_hub_health_record","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hub_id","in":"query","required":false,"schema":{"type":"integer","description":"Database ID of the hub (checked first)","title":"Hub Id"},"description":"Database ID of the hub (checked first)"},{"name":"hub_id_str","in":"query","required":false,"schema":{"type":"string","description":"Hub ID string e.g. DH1AAAB (checked second)","title":"Hub Id Str"},"description":"Hub ID string e.g. DH1AAAB (checked second)"},{"name":"tag","in":"query","required":false,"schema":{"type":"string","description":"Globally unique tag of the hub (checked third)","title":"Tag"},"description":"Globally unique tag of the hub (checked third)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetHubHealthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/site_health":{"post":{"summary":"Add Site Health Record","description":"Add a full site health record (overall site indicator plus per-sensor breakdown)\nto elastic and timescale. No per-provider logic.","operationId":"add_site_health_record","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSiteHealthRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSiteHealthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/manage_org":{"post":{"summary":"Create Org","description":"Add a new child org to the database at the specified enabled org tree position\n\nChecks that the user can access the org tree position and, if so, adds the child\norg at that position\n\nRequest params:\n    org_name - string name of the new org (required)\n    parent_org_id - integer database id parent org to which to attach the new org (required)\n    logo_path - string path to the logo for the org (default None)","operationId":"create_org","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrgTreeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrgTreeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Org","description":"Update details for an org (name only for now). Due to potential far-reaching implications\nof enabling / disabling an org, we handle those operations in a separate class.\n\nRequest params (if not specified or null/None -> no change):\n    org_id - database id of the org to update (required)\n    org_name - string org name\n    tag - string org tag","operationId":"update_org","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrgTreeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrgTreeReponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Org","description":"Delete an org from the database. This is only permitted if the user is permitted to access\nthe org and there are no related sub orgs, hubs, sites and other related database entities.\n\nRequest params:\n    org_id - database id of the site to delete","operationId":"delete_org","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"integer","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteOrgTreeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/manage_org/billing_rates":{"get":{"summary":"Get Org Billing Rates","description":"List the billing rates assigned to an org the token can access.\n\nRequest params:\n    org_id - integer database id of the org","operationId":"get_org_billing_rates","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"integer","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrgBillingRatesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/org_tree":{"post":{"summary":"Get Org Tree","description":"Retrieve a json representation of the org_tree for a specified top org or for the org\ncorresponding to the org token if top org not specified and all its children.\n\nOutput is of the form:\n{\n    \"name\": \"my org\",\n    \"id\": 42,\n    \"tag\": null,\n    \"enabled\": true,\n    \"created\": \"\",\n    \"last_updated\": \"\",\n    \"children\": [\n        {\n            \"name\": \"child group 1\",\n            \"id\": 45,\n            \"tag\": null,\n            \"enabled\": true,\n            \"created\": \"\",\n            \"last_updated\": \"\",\n            \"children\": [...],\n            \"sites\": [...]\n        },\n        {...}\n    },\n    \"sites\": [\n        {\n            \"name\": \"123\",\n            \"id\": 667,\n            \"tag\": null,\n            \"enabled\": true,\n            \"product\": \"DeepAlert Edgeplus,\n            \"created\": \"\",\n            \"last_updated\": \"\",\n            \"sensors\": [...],\n        },\n        {...}\n    ]\n}\n\nNote that the output org tree should always have an intact structure even if disabled orgs\nare not requested since if a parent org is disabled, the system should ensure that all its\nchild orgs are also disabled.\n\nParams:\n    top_org_id  - database ID of the top org in the org tree to include in the results.\n    incl_sites  - boolean to include sites in the output (default False)\n    incl_sensors - boolean to include sensors in the output (default False) - only valid\n        if incl_sites is True\n    enabled_orgs_only - boolean to only include enabled orgs in the output (default True)\n    enabled_sites_only - boolean to only include enabled sites in the output (default True)\n    enabled_sensors_only - boolean to only include enabled sensors in the output (default True)\n\nReturns:\n    A json representation of the org tree in the form of a dictionary as per the\n    construct_output_org_tree method docstring.","operationId":"get_org_tree","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrgRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgTreeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/org_tree_totals":{"get":{"summary":"Get Org Tree Totals","description":"For a specified top org, list the total numbers of sub-orgs, sites and hubs all the way down\nthe org tree\n\nExpects Content-Type: application/json\n\nRequest filter params:\n    enabled - json boolean as true/false to only include only enabled/disabled orgs/sites/hubs)\n        in the results or null to included both states (default True)\n    top_org_id - database ID of the top org in the org tree to include in the results.\n        If a top_org_id is specified which is not visible to logged in user, then an error\n        message is returned. (default None -> the user's entry org)","operationId":"get_org_tree_totals","security":[{"HTTPBearer":[]}],"parameters":[{"name":"enabled","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Enabled"}},{"name":"top_org_id","in":"query","required":false,"schema":{"type":"integer","title":"Top Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgTreeTotalsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/enable_disable_org":{"put":{"summary":"Enable Disable Org","description":"Enable/disable an org\n\nPotentially far reaching operation.\n\nDisabling an org will disable also all sub-orgs and associated sites, flagging them all by setting\ntheir disabled_date field to a single timestamp to allow for simpler re-enablement of those disabled\nat that event.\n\nEnabling an org is not allowed where a parent org is disabled. User may not disable the org they are\nin and cannot access higher up orgs to affect those. The root org may not be disabled.\n\nUsers belonging to orgs that are disabled are forced to logout.\n\nRequest params (if not specified or null/None -> no change):\n    org_id - database id of the org to update (required)\n    enabled - boolean for whether org and sub-orgs are to be disabled (False) or enabled (True)\n        taking note of org_disabled_epoch_secs flags set during disabling\n    force_enable - boolean enable even if no org_disabled_epoch_secs flags exist for org\n        sub-orgs or associated sites (also requires enabled = true/True)","operationId":"enable_disable_org","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnableDisableOrgRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnableDisableOrgResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/manage_sensor":{"get":{"summary":"Get Sensor","description":"Fetch sensor details from the database.\n\nRequest params:\n    sensor_id - database id of the sensor to retrieve (first priority) OR\n    sensor_id_str - database sensor ID string of the sensor to retrieve (second priority) OR\n    tag - globally unique sensor tag of the sensor to retrieve (lowest priority)","operationId":"get_sensor","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sensor_id","in":"query","required":false,"schema":{"type":"integer","title":"Sensor Id"}},{"name":"sensor_id_str","in":"query","required":false,"schema":{"type":"string","title":"Sensor Id Str"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","title":"Tag"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSensorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Sensor","description":"Add a new sensor to the database for the specified site.\n\nIf the hub is not specified, checks that there is exactly one possible\nhub assigned to the site and will attach the sensor to that.\n\nThe sensor_id_str is allocated by incrementing on the last used sensor_id_str\non the hub.","operationId":"create_sensor","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSensorRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSensorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Sensor","description":"Update details for a sensor. This includes being able to disable it.\n\nWe do not allow moving a sensor between hubs (too complicated since would need to update its\nsensor_id_str and associated history in elastic, S3 etc). Rather delete/disable and recreate on\nnew hub in this case. We also do not allow updating of the sensor_id_str for similar reasons.","operationId":"update_sensor","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSensorRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSensorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Patch Sensor Config","description":"Shallow-merge the supplied config keys and/or advanced alert zones into the sensor's existing\nvalues. Everything else (hub checks, activity logging, camera_bridge handling) behaves exactly as for PUT.","operationId":"patch_sensor_config","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchSensorConfigRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSensorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Sensor","description":"Delete a sensor from the database.\n\nDue due potential implications with orphaned data etc, the use of this method requires extra\nconsideration and care. In most cases, the sensor should rather be disabled.\n\nRequest params:\n    sensor_id - database id of the sensor to delete (first priority) OR\n    sensor_id_str - database sensor ID string of the sensor to delete (second priority) OR\n    tag - globally unique sensor tag of the sensor to delete (lowest priority)","operationId":"delete_sensor","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sensor_id","in":"query","required":false,"schema":{"type":"integer","title":"Sensor Id"}},{"name":"sensor_id_str","in":"query","required":false,"schema":{"type":"string","title":"Sensor Id Str"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","title":"Tag"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteSensorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/sensors":{"get":{"summary":"List Sensors","description":"List the sensors on a site visible to the token. Disabled sensors are included with\nenabled=false so callers can tell \"disabled\" from \"missing\".\n\nRequest params:\n    site_id - database id of the site whose sensors to list\n    include_config - also return each sensor's config dict (default false)","operationId":"list_sensors","security":[{"HTTPBearer":[]}],"parameters":[{"name":"site_id","in":"query","required":true,"schema":{"type":"integer","title":"Site Id"}},{"name":"include_config","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Config"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSensorsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/hub_snapshot":{"get":{"summary":"Get Hub Snapshot","description":"Get a snapshot image from a sensor\n\nRequest params:\n    sensor_id - database id of the sensor from which to get snapshot","operationId":"get_hub_snapshot","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sensor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Database ID of the sensor","title":"Sensor Id"},"description":"Database ID of the sensor"},{"name":"sensor_id_str","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Database sensor ID string of the sensor","title":"Sensor Id Str"},"description":"Database sensor ID string of the sensor"},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Globally unique tag of the sensor","title":"Tag"},"description":"Globally unique tag of the sensor"},{"name":"num_frames","in":"query","required":false,"schema":{"type":"integer","maximum":5,"minimum":0,"description":"Number of frames to fetch - restrict to keep response time low","default":1,"title":"Num Frames"},"description":"Number of frames to fetch - restrict to keep response time low"},{"name":"frame_interval_secs","in":"query","required":false,"schema":{"type":"number","maximum":5,"minimum":2,"description":"Target interval in secs between frames - hub snaphots not too fast currently","default":2.0,"title":"Frame Interval Secs"},"description":"Target interval in secs between frames - hub snaphots not too fast currently"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetHubSnapshotResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/manage_site":{"get":{"summary":"Get Site","description":"Fetch site details (and optionally the associated sensor details) from the database.","operationId":"get_site","security":[{"HTTPBearer":[]}],"parameters":[{"name":"site_id","in":"query","required":false,"schema":{"type":"integer","title":"Site Id"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","title":"Tag"}},{"name":"include_sensors","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Sensors"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSiteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Site","description":"Add a new site along (optionally) with hub and sensors to the database at\nthe specified org tree position.\n\nChecks that the org token can access the specified org tree position and, if so,\nadds the site at that position. The specified org must be enabled.\n\nSensors are also added as specified by a list of sensor human names. These sensors are\nreal cameras at the actual client site but are configured to send camera-triggered\nimages/clips to the DeepAlert system via REST call or other channel like SMTP upload\nwhere the trigger could be e.g. camera edge analytics motion-triggers or scheduled images.\n\nRequest params:\n    site_name - unique site name for the specified org of the new site (required)\n    org_id - org to which to attach the new site. If not supplied, will use the entry_org_id\n        corresponding to the org token of the request, noting that sites cannot be attached\n        to the very top level org in the org tree (optional)\n    org_billing_rate_id - database ID of the org billing rate record associated with\n        the new site addition. If not supplied, will look up the org tree starting\n        from the specified org for the first single org billing rate found. If multiple\n        found, will return an error. (optional)\n    billing_rate_id - database ID of the billing rate (product) to pick from the org billing\n        rates found up the org tree, for when there is more than one. Ignored if\n        org_billing_rate_id is supplied. (optional)\n    enabled - boolean for whether site should be enabled (default True)\n    sensor_human_names - pipe-delimited string of camera names to create in the DB for\n        the site e.g. \"Camera A|Camera B\" (optional). Note include_hub must be True to\n        add sensors.\n    timezone_str - string for timezone of alerting (default \"Europe/London\")\n    hub_type - string type for the hub from \"logical\" or \"real\" (default \"logical\"). A \"logical\"\n        hub is there for database structural convenience and is not a physical device running code.\n    latitude - string for the latitude of the site (optional)\n    longitude - string for the longitude of the site (optional)\n    address - string for the address of the site (optional)\n    tag - string globally unique tag for the site (optional)\n    note - string for a note about the site (optional)\n    include_hub - boolean for whether to include a hub in the site (default True)\n    meta - dict stored in the site meta jsonb column (optional)","operationId":"create_site","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSiteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSiteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Site","description":"Update details for a site. This includes being able to disable it.\n\nWith a view towards being fit for purpose and to ease maintainability, not every site parameter\ncan be updated here and some are updated in e.g. management_rest_server code itself.\n\nDisable does not also disable the associated sensors at this point since one may want to\nre-enable the sensors later without too much fuss and all system checks for what is enabled\nshould include a check on site enabled status.\n\nRequest params (if not specified or null/None -> no change):\n    site_id - database id of the site to update (required)\n    site_name - string site name\n    enabled - boolean for whether site is enabled\n    latitude - string site latitude (empty string to remove)\n    longitude - string site longitude (empty string to remove)\n    address - string site address (empty string to remove)\n    tag - gobally unique string tag for the site (empty string to remove)\n    note - string note (empty string to remove)","operationId":"update_site","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSiteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSiteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Site","description":"Delete an unpopulated site from the database. This is only permitted if the user is permitted\nto access the site and there are no attached sensors and no hubs carrying that site_id.\n\nNote that the more powerful DeletePopulatedSite class can be used to delete sites where there\nare attached entities (requires a little more care in terms of history etc).\n\nRequest params:\n    site_id - database id of the site to delete","operationId":"delete_site","security":[{"HTTPBearer":[]}],"parameters":[{"name":"site_id","in":"query","required":true,"schema":{"type":"integer","title":"Site Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteSiteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/move_site":{"put":{"summary":"Move Site","description":"Move site to new org tree position\n\nWe do this here in a separate call rather than as part of a general update to site parameters\nsince if done at the same time as a name change for the site, things get messy quite quickly\naround the uniqueness checks of site name and org tree position.\n\nRequest params:\n    site_id - database id of the site (required)\n    org_id - integer database id of the org to which to move the site (required)","operationId":"move_site","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveSiteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveSiteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/delete_populated_site":{"delete":{"summary":"Delete Populated Site","description":"Delete a populated site, leaving only the site-unlinked hub in the DB (to prevent re-use of the hub_id_str).\nRefuses with a 409 while an integration (see LINKED_INTEGRATION_MODELS) is still linked to the site.","operationId":"delete_populated_site","security":[{"HTTPBearer":[]}],"parameters":[{"name":"site_id","in":"query","required":true,"schema":{"type":"integer","title":"Site Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteSiteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/sites":{"get":{"summary":"List Sites","description":"List the enabled sites visible to the token's org, with their meta so callers\ncan filter on it themselves.\n\nUsed by integrations (e.g. the Nx Witness plugin) to populate a per-camera\nsite selection dropdown.\n\nRequest params:\n    org_id - only list sites anywhere below this org in the org tree (optional). For a\n        site-scoped token this must cover its own site - it can only narrow, never widen.","operationId":"list_sites","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":false,"schema":{"type":"integer","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSitesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/arm_site":{"get":{"summary":"Get Arm Site","description":"Fetch the current arm mode for a site.","operationId":"get_arm_site","security":[{"HTTPBearer":[]}],"parameters":[{"name":"site_id","in":"query","required":false,"schema":{"type":"integer","title":"Site Id"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","title":"Tag"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArmSiteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Arm Site","description":"Arm, disarm, or set a site to scheduled arming.","operationId":"update_arm_site","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArmSiteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArmSiteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/mute_sensor":{"get":{"summary":"Get Mute Sensor","description":"Fetch the current mute status for a sensor.","operationId":"get_mute_sensor","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sensor_id","in":"query","required":false,"schema":{"type":"integer","title":"Sensor Id"}},{"name":"sensor_id_str","in":"query","required":false,"schema":{"type":"string","title":"Sensor Id Str"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","title":"Tag"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MuteSensorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Mute Sensor","description":"Mute or unmute a sensor. Set mute_until to a future datetime to mute,\nor null to unmute.","operationId":"update_mute_sensor","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MuteSensorRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MuteSensorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/alert_status":{"get":{"summary":"Get Alert Status","description":"Fetch alert review status details from the database.\n\nRequest params:\n    alert_id - database id of the sensor to retrieve (first priority)","operationId":"get_alert_status","security":[{"HTTPBearer":[]}],"parameters":[{"name":"alert_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Alert Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAlertStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Alert Status","description":"Update an alert's review status\n\nWe don't also log user activity in the user activity index since that would be overkill.\n\nParams:\n    alert_id - stringified alert id\n    status - string new status for the alert. Options here would be\n        \"viewed\" -> the alert is being viewed by a user. This adds a log entry for each call and\n            populates the first_viewed... alert fields if not already populated. Note that this\n            status does not actually alter the alert review_status field unlike for the other statuses.\n        \"done\" -> the alert is being marked as \"done\" by a user (alert review_status transition\n            from \"unreviewed\" -> \"done\")\n        \"escalated\" -> the alert is being marked as \"escalated\" by a user (alert review_status\n            transition from \"unreviewed\" -> \"escalated\")\n        \"resolved\" -> the alert is being marked as \"reslved\" by a user (alert review_status\n            transition from \"escalated\" -> \"resolved\")\n    note - new note to be added to the alert","operationId":"update_alert_status","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAlertStatusRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAlertStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/sensor_rule_configs":{"get":{"summary":"Get Sensor Rule Configs","description":"Get alert rule configurations for a sensor.\n\nReturns sensor-specific rules if configured, otherwise automatically fetches inherited site/org rules.\nHandles partial failures gracefully by returning successful sensors and listing failed ones separately.\n\nParams:\n    sensor_id_str - Sensor ID string (e.g., 'DH1AAAB-a'),\n    exclude_disabled - If True (default), exclude disabled sensors/sites/hubs from results","operationId":"get_sensor_rule_configs","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sensor_id_str","in":"query","required":true,"schema":{"type":"string","description":"Sensor ID string","title":"Sensor Id Str"},"description":"Sensor ID string"},{"name":"exclude_disabled","in":"query","required":false,"schema":{"type":"boolean","description":"Exclude disabled sensors/sites/hubs","default":true,"title":"Exclude Disabled"},"description":"Exclude disabled sensors/sites/hubs"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSensorRuleConfigsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Sensor Rule Config","description":"Add a sensor defined alert rule config. One of sensor_id, sensor_id_str or tag is required.","operationId":"create_sensor_rule_config","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSensorRuleConfigRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SensorRuleConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Sensor Rule Config","description":"Replace an existing sensor defined alert rule config. One of sensor_id, sensor_id_str or tag is required.","operationId":"update_sensor_rule_config","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSensorRuleConfigRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SensorRuleConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Sensor Rule Config","description":"Delete a sensor defined alert rule config.","operationId":"delete_sensor_rule_config","security":[{"HTTPBearer":[]}],"parameters":[{"name":"alert_config_id","in":"query","required":true,"schema":{"type":"integer","description":"id of the alert config to delete","title":"Alert Config Id"},"description":"id of the alert config to delete"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SensorRuleConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/top_alerting_sensors":{"get":{"summary":"Get Top Alerting Sensors","description":"Get top N sensors by alert count across all sites.\n\nReturns sensors that triggered the most alerts (events that matched alert rules).\nNote: Sensors with events but no triggered alerts will not appear in results.\n\nSensors are ordered by alert count (descending). When multiple sensors have\nthe same alert count, they are sorted by sensor_id_str (ascending) for\ndeterministic, reproducible results.\n\nDatetime format: YYYY-MM-DDTHH:MM:SSZ (year-month-day T hour:minute:second Z).\n\nParams:\n    start_datetime: Optional start datetime in ISO 8601 UTC (e.g. \"2025-01-01T00:00:00Z\" - defaults to 24 hours before the end time),\n    end_datetime: Optional end datetime in ISO 8601 UTC (e.g. \"2025-01-01T00:00:00Z\" - defaults to now),\n    org_id: Optional Organization ID to filter by (If not provided, uses entry_org_id from token),\n    include_children: Optional; include child organizations (uses org_tree),\n    top_sensors: Number of top sensors to return (default: 20, max: 100)","operationId":"get_top_alerting_sensors","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_datetime","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start datetime","title":"Start Datetime"},"description":"Start datetime"},{"name":"end_datetime","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End datetime","title":"End Datetime"},"description":"End datetime"},{"name":"org_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Organization ID to filter by","title":"Org Id"},"description":"Organization ID to filter by"},{"name":"include_children","in":"query","required":false,"schema":{"type":"boolean","description":"Include child organizations","default":false,"title":"Include Children"},"description":"Include child organizations"},{"name":"top_sensors","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of top sensors to return","default":20,"title":"Top Sensors"},"description":"Number of top sensors to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTopAlertingSensorsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/alert_images_download":{"get":{"summary":"Get Alert Images Download","description":"Get alert images for a sensor for LLM scene analysis.\n\nReturns images spread across the time range to capture diverse alert behavior.\n\nDatetime format: YYYY-MM-DDTHH:MM:SSZ (year-month-day T hour:minute:second Z).\n\nParams:\n    sensor_id_str - Sensor ID string (e.g., 'DH1AAAB-a'),\n    start_datetime - Optional start datetime in ISO 8601 UTC (e.g. \"2025-01-01T00:00:00Z\" - defaults to 24 hours before the end time),\n    end_datetime - Optional end datetime in ISO 8601 UTC (e.g. \"2025-01-01T00:00:00Z\" - defaults to now),\n    count - Number of images to return (default: 5, max: 20)","operationId":"get_alert_images_download","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sensor_id_str","in":"query","required":true,"schema":{"type":"string","description":"Sensor ID string","title":"Sensor Id Str"},"description":"Sensor ID string"},{"name":"start_datetime","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start datetime","title":"Start Datetime"},"description":"Start datetime"},{"name":"end_datetime","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End datetime","title":"End Datetime"},"description":"End datetime"},{"name":"count","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":1,"description":"Number of images to return (1-20)","default":5,"title":"Count"},"description":"Number of images to return (1-20)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAlertImagesDownloadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/inference_image_download":{"get":{"summary":"Get Inference Image Download","description":"Get the most recent inference image for a sensor.\n\nParams:\n    sensor_id_str - Sensor ID string (e.g., 'DH1AAAB-a')","operationId":"get_inference_image_download","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sensor_id_str","in":"query","required":true,"schema":{"type":"string","description":"Sensor ID string (e.g., 'DH1AAAB-a')","title":"Sensor Id Str"},"description":"Sensor ID string (e.g., 'DH1AAAB-a')"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetInferenceImageDownloadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/usage_export":{"get":{"summary":"Get Usage Export","description":"Export raw usage records with flexible filtering, restricted by org hierarchy.\n\nParams:\n    start_date - Start of date range inclusive (YYYY-MM-DD). Defaults to yesterday.\n    end_date - End of date range exclusive (YYYY-MM-DD). Defaults to today.\n    org_id - Filter to a specific org (must be within token's tree). If omitted, returns all accessible orgs.\n    usage_type - Filter by usage_type (e.g. \"active_connection\", \"event_triggered\")\n    product_code - Filter by product_code\n    feature_name - Filter by feature_name\n    parent_org_name - Filter by parent_org_name (e.g. \"Clients SA\", \"POCS UK\")\n    include_meta - Whether to include the meta JSONB field (can be large). Defaults to False.\n    limit - Max number of records to return (default 10000, max 10000).\n    offset - Number of records to skip for pagination (default 0).","operationId":"get_usage_export","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"org_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Org Id"}},{"name":"usage_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Type"}},{"name":"product_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Code"}},{"name":"feature_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feature Name"}},{"name":"parent_org_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Org Name"}},{"name":"include_meta","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Meta"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"description":"Max records to return (1-10000)","default":10000,"title":"Limit"},"description":"Max records to return (1-10000)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of records to skip","default":0,"title":"Offset"},"description":"Number of records to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUsageExportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1.0/reports":{"post":{"summary":"Generate Report","operationId":"generate_report","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateReportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1.0/report_stats":{"get":{"summary":"Get Report Stats","description":"Get stats for the reports configured for an org: how many reports, how many distinct\nreport types, and the report counts per type and schedule (time of day and, for weekly\nreports, day of week — monthly reports always run on the 1st).","operationId":"get_report_stats","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"integer","description":"Organization ID","title":"Org Id"},"description":"Organization ID"},{"name":"top_org_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only count reports configured on this org. Set false to include the whole org tree below it","default":true,"title":"Top Org Only"},"description":"Only count reports configured on this org. Set false to include the whole org tree below it"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetReportStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AlertConfigData":{"properties":{"alert_config_id":{"title":"Alert Config Id","description":"Alert configuration ID, null for inherited site rules","type":["integer","null"]},"alert_config_name":{"title":"Alert Config Name","description":"Alert configuration name","type":["string","null"]},"alert_type":{"type":"string","title":"Alert Type","description":"Alert type"},"alert_config_type":{"type":"string","title":"Alert Config Type","description":"Alert configuration type"},"rule_configs":{"additionalProperties":true,"type":"object","title":"Rule Configs","description":"Rule configuration parameters"},"valid_days_and_times":{"title":"Valid Days And Times","description":"Valid days and times schedule","type":["string","null"]},"enabled":{"type":"boolean","title":"Enabled","description":"Whether the configuration is enabled"}},"type":"object","required":["alert_config_id","alert_config_name","alert_type","alert_config_type","rule_configs","valid_days_and_times","enabled"],"title":"AlertConfigData","description":"Model for individual alert configuration"},"AlertImageData":{"properties":{"image_b64":{"type":"string","title":"Image B64","description":"Base64 encoded image data"},"width":{"type":"integer","title":"Width","description":"Image width in pixels"},"height":{"type":"integer","title":"Height","description":"Image height in pixels"},"alert_timestamp":{"title":"Alert Timestamp","description":"UTC timestamp when alert was created","type":["string","null"]}},"type":"object","required":["image_b64","width","height"],"title":"AlertImageData","description":"Model for a single alert image"},"AlertImagesDownloadData":{"properties":{"sensor_id_str":{"type":"string","title":"Sensor Id Str","description":"Sensor ID string"},"images":{"items":{"$ref":"#/components/schemas/AlertImageData"},"type":"array","title":"Images","description":"List of alert images"}},"type":"object","required":["sensor_id_str","images"],"title":"AlertImagesDownloadData","description":"Model for alert images download response data"},"AlertRuleEvalExplainResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"}},"type":"object","required":["success","msg"],"title":"AlertRuleEvalExplainResponse"},"AlertedImageStats":{"properties":{"n_detections":{"title":"N Detections","type":["integer","null"]},"total_score":{"title":"Total Score","type":["number","null"]},"max_score":{"title":"Max Score","type":["number","null"]},"max_short_class_label":{"title":"Max Short Class Label","type":["string","null"]}},"type":"object","title":"AlertedImageStats"},"AnalyticsResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"event_alerted":{"title":"Event Alerted","type":["boolean","null"]},"alert_config_results":{"title":"Alert Config Results","items":{"$ref":"#/components/schemas/AnalyticsResult"},"type":"array"},"sampled_frame_timestamps":{"title":"Sampled Frame Timestamps","items":{"type":"number"},"type":"array"}},"type":"object","required":["success","msg","alert_config_results","sampled_frame_timestamps"],"title":"AnalyticsResponse"},"AnalyticsResult":{"properties":{"alert_config_name":{"title":"Alert Config Name","type":["string","null"]},"alert_config_type":{"type":"string","title":"Alert Config Type"},"alert_type":{"title":"Alert Type","type":["string","null"]},"alerted":{"type":"boolean","title":"Alerted"},"alert_image_index":{"title":"Alert Image Index","type":["integer","null"]},"alerted_image_stats":{"$ref":"#/components/schemas/AlertedImageStats"},"alert_message":{"title":"Alert Message","type":["string","null"]},"alert_short_class_label":{"title":"Alert Short Class Label","type":["string","null"]},"alert_timezone":{"title":"Alert Timezone","type":["string","null"]},"alert_image_url":{"title":"Alert Image Url","type":["string","null"]},"video_url":{"title":"Video Url","type":["string","null"]},"normalised_bboxes":{"title":"Normalised Bboxes","items":{"$ref":"#/components/schemas/BBox"},"type":"array"},"alert_priority_reason":{"title":"Alert Priority Reason","type":["string","null"]}},"type":"object","required":["alert_config_type","alerted"],"title":"AnalyticsResult"},"ApiResource":{"properties":{"name":{"type":"string","title":"Name","description":"The name of the end point"},"description":{"type":"string","title":"Description","description":"The description of the end point"},"ver_end_point":{"type":"string","title":"Ver End Point","description":"The versioned path of the end point"}},"type":"object","required":["name","description","ver_end_point"],"title":"ApiResource"},"ArmSiteRequest":{"properties":{"site_id":{"title":"Site Id","description":"database id of the site to arm/disarm","type":["integer","null"]},"tag":{"title":"Tag","description":"globally unique tag of the site to arm/disarm","type":["string","null"]},"arm_mode":{"type":"string","title":"Arm Mode","description":"arm mode for the site from \"scheduled\", \"armed\", \"disarmed\""}},"type":"object","required":["arm_mode"],"title":"ArmSiteRequest"},"ArmSiteResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"site_id":{"type":"integer","title":"Site Id"},"site_name":{"type":"string","title":"Site Name"},"arm_mode":{"type":"string","title":"Arm Mode"}},"type":"object","required":["success","msg","site_id","site_name","arm_mode"],"title":"ArmSiteResponse"},"AuthCheckResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"org_id":{"type":"integer","title":"Org Id"},"org_level":{"type":"integer","title":"Org Level"}},"type":"object","required":["success","msg","org_id","org_level"],"title":"AuthCheckResponse"},"AutoSuppressOnTrainClickRequest":{"properties":{"alert_id":{"type":"string","minLength":1,"title":"Alert Id","description":"alert id of the alert that was train-clicked"},"review_user_id":{"type":"integer","title":"Review User Id","description":"id of the reviewer"},"review_username":{"type":"string","minLength":1,"title":"Review Username","description":"name of the reviewer"}},"type":"object","required":["alert_id","review_user_id","review_username"],"title":"AutoSuppressOnTrainClickRequest"},"AutoSuppressOnTrainClickResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"alert_id":{"type":"string","title":"Alert Id"},"suppression_triggered":{"type":"boolean","title":"Suppression Triggered"}},"type":"object","required":["success","msg","alert_id","suppression_triggered"],"title":"AutoSuppressOnTrainClickResponse"},"BBox":{"properties":{"object_class":{"type":"string","title":"Object Class"},"probability":{"type":"number","title":"Probability"},"x0":{"type":"number","title":"X0"},"y0":{"type":"number","title":"Y0"},"x1":{"type":"number","title":"X1"},"y1":{"type":"number","title":"Y1"}},"type":"object","required":["object_class","probability","x0","y0","x1","y1"],"title":"BBox"},"BillingUsageData":{"properties":{"export_date":{"type":"string","title":"Export Date","description":"Export date in ISO format"},"org_id":{"type":"integer","title":"Org Id","description":"Organization ID"},"org_name":{"type":"string","title":"Org Name","description":"Organization name"},"site_sensors":{"items":{"$ref":"#/components/schemas/SiteSensorData"},"type":"array","title":"Site Sensors","description":"Site sensor data"},"invoice_items":{"items":{"$ref":"#/components/schemas/InvoiceItemData"},"type":"array","title":"Invoice Items","description":"Invoice item data"}},"type":"object","required":["export_date","org_id","org_name","site_sensors","invoice_items"],"title":"BillingUsageData","description":"Model for billing usage response data"},"Body_analytics_v1_0_analytics_post":{"properties":{"file":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"File"},"sensor_id":{"type":"integer","title":"Sensor Id"},"sensor_id_str":{"type":"string","title":"Sensor Id Str"},"tag":{"type":"string","title":"Tag"},"alert_configs":{"type":"string","title":"Alert Configs"},"applicable_alert_type":{"type":"string","title":"Applicable Alert Type","default":"analytics"},"alert_configs_priority":{"type":"string","title":"Alert Configs Priority","default":"[\"request\", \"existing\"]"},"event_timestamp":{"type":"number","title":"Event Timestamp"},"description":{"type":"string","title":"Description"},"auto_create":{"type":"boolean","title":"Auto Create","default":false},"site_id":{"title":"Site Id","type":["integer","null"]}},"type":"object","title":"Body_analytics_v1_0_analytics_post"},"CreateDetectionSuppressionsRequest":{"properties":{"alert_ids":{"title":"Alert Ids","description":"alerts whose detections to suppress","items":{"type":"string"},"type":"array","minItems":1},"source_event_id":{"title":"Source Event Id","description":"event of the frame, when there is no alert","type":["string","null"]},"source_image_index":{"title":"Source Image Index","description":"image index within the event","type":"integer","minimum":0.0},"source_inference_id":{"title":"Source Inference Id","description":"inference whose clean frame the boxes sit on","type":["string","null"]},"detections":{"title":"Detections","description":"with alert_ids (exactly one): only these detections; otherwise the boxes to suppress","items":{"$ref":"#/components/schemas/SuppressionDetection"},"type":"array","minItems":1},"origin":{"type":"string","enum":["review_page","alert_auto","semiauto","api"],"title":"Origin","description":"which system is creating the suppression"},"reason":{"title":"Reason","description":"optional reason/comment","type":["string","null"]},"review_user_id":{"title":"Review User Id","description":"id of the reviewer, used when the token has none","type":["integer","null"]},"review_username":{"title":"Review Username","description":"reviewer name, used when the token has none","type":["string","null"]}},"type":"object","required":["origin"],"title":"CreateDetectionSuppressionsRequest","description":"Suppress the detections of alerts, or of a frame that has no alert.\n\nGive `alert_ids`, or all of `source_event_id`, `source_image_index`, `source_inference_id` and `detections`."},"CreateOrgTreeRequest":{"properties":{"org_name":{"type":"string","title":"Org Name","description":"string name of the new org"},"parent_org_id":{"type":"integer","title":"Parent Org Id","description":"integer database id parent org to which to attach the new org"},"tag":{"title":"Tag","description":"globally unique org tag","type":["string","null"]},"logo_path":{"title":"Logo Path","description":" string path to the logo for the org (default None)","type":["string","null"]}},"type":"object","required":["org_name","parent_org_id"],"title":"CreateOrgTreeRequest"},"CreateOrgTreeResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"org_id":{"type":"integer","title":"Org Id","description":"Id of the created org"},"org_tree":{"items":{"type":"integer"},"type":"array","title":"Org Tree","description":"Array of org ids forming the org tree. Only ids for populated org items are returned."}},"type":"object","required":["success","msg","org_id","org_tree"],"title":"CreateOrgTreeResponse"},"CreateSensorHealthRequest":{"properties":{"sensor_id":{"type":"integer","title":"Sensor Id","description":"database id of the sensor for the health status (checked first)"},"sensor_id_str":{"type":"string","title":"Sensor Id Str","description":"database sensor ID string of the sensor for the health status (checked second) e.g. DH1AAAB-a"},"tag":{"type":"string","title":"Tag","description":"database globally unique tag of the sensor for the health status (checked third)"},"health_status":{"type":"string","enum":["ok","error","warning","unknown"],"title":"Health Status","description":"health status for the sensor"}},"type":"object","required":["health_status"],"title":"CreateSensorHealthRequest"},"CreateSensorHealthResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"}},"type":"object","required":["success","msg"],"title":"CreateSensorHealthResponse"},"CreateSensorRequest":{"properties":{"site_id":{"type":"integer","title":"Site Id","description":"integer site id with which sensor is associated"},"hub_id":{"title":"Hub Id","description":"integer hub id with which sensor is associated","type":["integer","null"]},"sensor_suffix_letters":{"title":"Sensor Suffix Letters","description":"lowercase camera identifier part of sensor_id_str e.g. 'ac' in sensor_id_str 'DH1AAAB-ac'. If not specified, will auto-assign","type":["string","null"]},"tag":{"title":"Tag","description":"globally unique sensor tag","type":["string","null"]},"enabled":{"type":"boolean","title":"Enabled","description":"boolean for whether sensor is enabled (default=True)","default":true},"human_name":{"type":"string","title":"Human Name","description":"human descriptive name for the sensor","default":""},"config":{"title":"Config","description":"json sensor config for deepcam-x.json","type":["string","null"]},"meta":{"title":"Meta","description":"json meta for sensor","type":["string","null"]},"environment":{"type":"string","title":"Environment","description":"string indicating the environment within which the sensor is set up eg: parking area, residential, office, etc","default":"None"},"ptz":{"title":"Ptz","description":"boolean indicator of whether a new sensor is a PTZ camera","type":["boolean","null"]},"sensor_type":{"type":"string","title":"Sensor Type","description":"string indicating the type of sensor, defaulting to type of camera. May be items like door contact, window contact, siren, etc","default":"camera"}},"type":"object","required":["site_id"],"title":"CreateSensorRequest"},"CreateSensorResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"sensor_id":{"title":"Sensor Id","description":"integer sensor id","type":["integer","null"]},"sensor_id_str":{"title":"Sensor Id Str","description":"string id assigned to","type":["string","null"]},"human_name":{"title":"Human Name","description":"human descriptive name for the sensor","type":["string","null"]}},"type":"object","required":["success","msg"],"title":"CreateSensorResponse"},"CreateSensorRuleConfigRequest":{"properties":{"sensor_id":{"title":"Sensor Id","description":"database id of the sensor the rule applies to","type":["integer","null"]},"sensor_id_str":{"title":"Sensor Id Str","description":"sensor ID string e.g. DH1AAAB-a","type":["string","null"]},"tag":{"title":"Tag","description":"globally unique tag of the sensor","type":["string","null"]},"alert_config":{"additionalProperties":true,"type":"object","title":"Alert Config","description":"alert config in validator format: alert_type, alert_config_type, name, rule_configs, and valid_days_and_times / exact_times / cadence_secs as applicable"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"additional metadata to store with the rule"}},"type":"object","required":["alert_config"],"title":"CreateSensorRuleConfigRequest"},"CreateSiteHealthRequest":{"properties":{"site_id":{"title":"Site Id","description":"database id of the site for the health status (checked first)","type":["integer","null"]},"tag":{"title":"Tag","description":"database globally unique tag of the site for the health status (checked second)","type":["string","null"]},"health_status":{"type":"string","enum":["ok","error","warning","unknown"],"title":"Health Status","description":"overall health status for the site"},"sensors":{"items":{"$ref":"#/components/schemas/SiteSensorHealthStatus"},"type":"array","title":"Sensors","description":"per-sensor health statuses for the site's sensors","default":[]}},"type":"object","required":["health_status"],"title":"CreateSiteHealthRequest"},"CreateSiteHealthResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"}},"type":"object","required":["success","msg"],"title":"CreateSiteHealthResponse"},"CreateSiteRequest":{"properties":{"site_name":{"type":"string","title":"Site Name","description":"unique site name for the specified org of the new site"},"org_id":{"title":"Org Id","description":"org to which to attach the new site. If not supplied, will use the entry_org_id corresponding to the org token of the request, noting that sites cannot be attached to the very top level org in the org tree","type":["integer","null"]},"org_billing_rate_id":{"title":"Org Billing Rate Id","description":"database ID of the org billing rate record associated with the new site addition. If not supplied, will look up the org tree starting from the specified org for the first single org billing rate found. If multiple found, will return an error.","type":["integer","null"]},"billing_rate_id":{"title":"Billing Rate Id","description":"database ID of the billing rate (product) for the new site, matched against the org billing rates found up the org tree. Ignored if org_billing_rate_id is supplied.","type":["integer","null"]},"enabled":{"type":"boolean","title":"Enabled","description":"boolean for whether site should be enabled","default":true},"sensor_human_names":{"title":"Sensor Human Names","description":"pipe-delimited string of camera names to create in the DB for the site e.g. \"Camera A|Camera B\"","type":["string","null"]},"timezone_str":{"type":"string","title":"Timezone Str","description":"string for timezone of alerting","default":"Europe/London"},"hub_type":{"$ref":"#/components/schemas/HubType","description":"string type for the hub from \"logical\" or \"real\". A \"logical\" hub is there for database structural convenience and is not a physical device running code","default":"logical"},"latitude":{"title":"Latitude","description":"latitude of the site","type":["string","null"]},"longitude":{"title":"Longitude","description":"longitude of the site","type":["string","null"]},"address":{"title":"Address","description":"address of the site","type":["string","null"]},"tag":{"title":"Tag","description":"globally unique string tag for the site","type":["string","null"]},"note":{"title":"Note","description":"note about the site","type":["string","null"]},"animated_clips":{"type":"boolean","title":"Animated Clips","description":"whether to generate animated clips for alerts for this site","default":true},"include_hub":{"type":"boolean","title":"Include Hub","description":"whether to include a hub in the site","default":true},"meta":{"title":"Meta","description":"site meta jsonb column","additionalProperties":true,"type":"object"}},"type":"object","required":["site_name"],"title":"CreateSiteRequest"},"CreateSiteResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"site_id":{"type":"integer","title":"Site Id"},"org_id":{"type":"integer","title":"Org Id"},"org_billing_rate_id":{"type":"integer","title":"Org Billing Rate Id"},"billing_rate_id":{"type":"integer","title":"Billing Rate Id"},"product":{"type":"string","title":"Product"},"hub_id":{"title":"Hub Id","type":["integer","null"]},"hub_id_str":{"title":"Hub Id Str","type":["string","null"]},"sensors":{"title":"Sensors","items":{"$ref":"#/components/schemas/NewSiteSensor"},"type":"array"},"alert_end_point_id":{"title":"Alert End Point Id","type":["integer","null"]}},"type":"object","required":["success","msg","site_id","org_id","org_billing_rate_id","billing_rate_id","product"],"title":"CreateSiteResponse"},"CurrentTokenResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"id":{"type":"integer","title":"Id","description":"Token ID"},"org_id":{"type":"integer","title":"Org Id","description":"Organization ID the token belongs to"},"site_id":{"title":"Site Id","description":"Site ID the token is pinned to, if scoped to a single site","type":["integer","null"]},"description":{"title":"Description","description":"Token description","type":["string","null"]}},"type":"object","required":["success","msg","id","org_id","description"],"title":"CurrentTokenResponse"},"DeleteOrgTreeResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"}},"type":"object","required":["success","msg"],"title":"DeleteOrgTreeResponse"},"DeleteSensorResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"}},"type":"object","required":["success","msg"],"title":"DeleteSensorResponse"},"DeleteSiteResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"}},"type":"object","required":["success","msg"],"title":"DeleteSiteResponse"},"DetectionSuppressionEntry":{"properties":{"id":{"type":"string","title":"Id"},"sensor_id":{"type":"integer","title":"Sensor Id"},"source_event_id":{"type":"string","title":"Source Event Id"},"source_image_index":{"type":"integer","title":"Source Image Index"},"source_inference_id":{"type":"string","title":"Source Inference Id"},"source_alert_id":{"title":"Source Alert Id","type":["string","null"]},"source_rule_eval_id":{"title":"Source Rule Eval Id","type":["string","null"]},"alert_ids":{"items":{"type":"string"},"type":"array","title":"Alert Ids","description":"every alert this rule suppresses"},"inference_class":{"type":"string","title":"Inference Class"},"x0":{"type":"integer","title":"X0"},"y0":{"type":"integer","title":"Y0"},"x1":{"type":"integer","title":"X1"},"y1":{"type":"integer","title":"Y1"},"frame_width":{"type":"integer","title":"Frame Width"},"frame_height":{"type":"integer","title":"Frame Height"},"probability":{"title":"Probability","type":["number","null"]},"embedding":{"title":"Embedding","items":{"type":"number"},"type":"array"},"embedding_model":{"title":"Embedding Model","type":["string","null"]},"hash":{"title":"Hash","type":["string","null"]},"origin":{"type":"string","title":"Origin"},"status":{"type":"string","title":"Status"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"last_action_at":{"type":"string","format":"date-time","title":"Last Action At"},"created_by_user_id":{"title":"Created By User Id","type":["integer","null"]},"created_by_username":{"title":"Created By Username","type":["string","null"]},"reason":{"title":"Reason","type":["string","null"]}},"type":"object","required":["id","sensor_id","source_event_id","source_image_index","source_inference_id","inference_class","x0","y0","x1","y1","frame_width","frame_height","origin","status","expires_at","last_action_at"],"title":"DetectionSuppressionEntry","description":"One stored rule, with the embedding so a caller can make the matcher's appearance comparison.\n\nA plain BaseModel: DeepAlertBaseModel carries the response envelope's success/msg fields."},"DetectionSuppressionListResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"suppressions":{"items":{"$ref":"#/components/schemas/DetectionSuppressionEntry"},"type":"array","title":"Suppressions"}},"type":"object","required":["success","msg","suppressions"],"title":"DetectionSuppressionListResponse"},"DetectionSuppressionsWriteResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"batch_id":{"title":"Batch Id","description":"groups the log entries of this call","type":["string","null"]},"suppression_ids":{"items":{"type":"string"},"type":"array","title":"Suppression Ids","description":"rules created, lifted or reapplied, depending on the endpoint"},"skipped":{"type":"integer","title":"Skipped","description":"boxes not stored because an equivalent active rule exists","default":0}},"type":"object","required":["success","msg"],"title":"DetectionSuppressionsWriteResponse"},"EdgeEnhancedRequest":{"properties":{"site_id":{"type":"integer","title":"Site Id","description":"database id of the site to update"},"generate_password":{"type":"boolean","title":"Generate Password","description":"boolean for whether the site SMTP password should be generated and returned"}},"type":"object","required":["site_id"],"title":"EdgeEnhancedRequest"},"EdgeEnhancedResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"edge_enhanced_smtp_server":{"type":"string","title":"Edge Enhanced Smtp Server","description":"SMTP server that the cameras should be configured with"},"edge_enhanced_smtp_server_port":{"type":"integer","title":"Edge Enhanced Smtp Server Port","description":"port of SMTP server that the cameras should be configured with"},"smtp_password":{"type":"string","title":"Smtp Password","description":"SMTP server password that the cameras should be configured with"},"smtp_username":{"type":"string","title":"Smtp Username","description":"SMTP server username that the cameras should be configured with"}},"type":"object","required":["success","msg"],"title":"EdgeEnhancedResponse"},"EnableDisableOrgRequest":{"properties":{"org_id":{"type":"integer","title":"Org Id"},"enabled":{"type":"boolean","title":"Enabled"},"force_enable":{"type":"boolean","title":"Force Enable","default":false}},"type":"object","required":["org_id","enabled"],"title":"EnableDisableOrgRequest"},"EnableDisableOrgResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"}},"type":"object","required":["success","msg"],"title":"EnableDisableOrgResponse"},"GenerateReportRequest":{"properties":{"include_csv":{"type":"boolean","title":"Include Csv"},"include_escalated_events":{"type":"boolean","title":"Include Escalated Events"},"include_sensor_breakdown":{"type":"boolean","title":"Include Sensor Breakdown","default":false},"report_type":{"type":"string","title":"Report Type"},"product_name":{"title":"Product Name","type":["string","null"]},"site_ids":{"title":"Site Ids","items":{"type":"integer"},"type":"array"},"timezone_str":{"type":"string","title":"Timezone Str"},"org_id":{"type":"integer","title":"Org Id"},"datetime_start":{"type":"string","format":"date-time","title":"Datetime Start"},"datetime_end":{"type":"string","format":"date-time","title":"Datetime End"}},"type":"object","required":["include_csv","include_escalated_events","report_type","timezone_str","org_id","datetime_start","datetime_end"],"title":"GenerateReportRequest"},"GenerateReportResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Success message, or how many reports were queued"},"s3_url":{"title":"S3 Url","description":"S3 URL of the generated report, or None when reports are queued","type":["string","null"]},"request_ids":{"items":{"type":"string"},"type":"array","title":"Request Ids","description":"Status document IDs of the generated/queued reports, one per site for individual site reports"},"status":{"$ref":"#/components/schemas/ReportStatus","description":"generated, running when reports were queued, or skipped when there was nothing enabled to report on"}},"type":"object","required":["success","msg","s3_url","status"],"title":"GenerateReportResponse"},"GetAlertAccuracyFlagResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"improve_accuracy_flag":{"type":"boolean","title":"Improve Accuracy Flag"}},"type":"object","required":["success","msg","improve_accuracy_flag"],"title":"GetAlertAccuracyFlagResponse"},"GetAlertImagesDownloadResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"data":{"description":"Alert images data if successful","$ref":"#/components/schemas/AlertImagesDownloadData"}},"type":"object","required":["success","msg"],"title":"GetAlertImagesDownloadResponse","description":"Response model for getting alert images download"},"GetAlertStatusResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"review_status":{"type":"string","title":"Review Status"}},"type":"object","required":["success","msg","review_status"],"title":"GetAlertStatusResponse"},"GetBillingUsageResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"data":{"description":"Billing usage data if successful","$ref":"#/components/schemas/BillingUsageData"}},"type":"object","required":["success","msg"],"title":"GetBillingUsageResponse","description":"Response model for getting billing usage data"},"GetHubHealthResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"created":{"title":"Created","description":"Timestamp of the health record","type":"string","format":"date-time"},"site_id":{"title":"Site Id","description":"Site ID associated with the hub","type":["integer","null"]},"site_name":{"title":"Site Name","description":"Site name associated with the hub","type":["string","null"]},"hub_id_str":{"title":"Hub Id Str","description":"Hub ID string","type":["string","null"]},"overall_indicator":{"title":"Overall Indicator","description":"Overall health indicator","type":"string","enum":["ok","error","warning","unknown"]},"hub_status":{"title":"Hub Status","description":"Hub health status","type":["string","null"]},"hub_cpu_percent":{"title":"Hub Cpu Percent","description":"CPU usage percentage","type":["number","null"]},"hub_disk_percent":{"title":"Hub Disk Percent","description":"Disk usage percentage","type":["number","null"]},"hub_mem_percent":{"title":"Hub Mem Percent","description":"Memory usage percentage","type":["number","null"]},"hub_cpu_ok":{"title":"Hub Cpu Ok","description":"CPU usage within acceptable range","type":["boolean","null"]},"hub_disk_ok":{"title":"Hub Disk Ok","description":"Disk usage within acceptable range","type":["boolean","null"]},"hub_mem_ok":{"title":"Hub Mem Ok","description":"Memory usage within acceptable range","type":["boolean","null"]},"hub_uptime_secs":{"title":"Hub Uptime Secs","description":"Hub uptime in seconds","type":["integer","null"]},"hub_load_ave_1min":{"title":"Hub Load Ave 1Min","description":"1-minute load average","type":["number","null"]},"hub_cloud_delay_secs":{"title":"Hub Cloud Delay Secs","description":"Cloud communication delay in seconds","type":["number","null"]},"hub_cloud_delay_status":{"title":"Hub Cloud Delay Status","description":"Cloud delay status","type":["string","null"]},"hub_vpn_ok":{"title":"Hub Vpn Ok","description":"VPN connection status","type":["boolean","null"]},"hub_msg_ok":{"title":"Hub Msg Ok","description":"Message system status","type":["boolean","null"]}},"type":"object","required":["success","msg"],"title":"GetHubHealthResponse"},"GetHubSnapshotResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"native_height":{"type":"integer","title":"Native Height"},"native_width":{"type":"integer","title":"Native Width"},"standard_images_with_timestamps":{"items":{"$ref":"#/components/schemas/StandardImageWithTimestamp"},"type":"array","title":"Standard Images With Timestamps"}},"type":"object","required":["success","msg","native_height","native_width","standard_images_with_timestamps"],"title":"GetHubSnapshotResponse","description":"get hub snapshot response model"},"GetInferenceImageDownloadResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"data":{"description":"Inference image data if successful","$ref":"#/components/schemas/InferenceImageData"}},"type":"object","required":["success","msg"],"title":"GetInferenceImageDownloadResponse","description":"Response model for getting inference image download"},"GetOrgBillingRatesResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"org_billing_rates":{"items":{"$ref":"#/components/schemas/OrgBillingRate"},"type":"array","title":"Org Billing Rates"}},"type":"object","required":["success","msg","org_billing_rates"],"title":"GetOrgBillingRatesResponse"},"GetOrgRequest":{"properties":{"top_org_id":{"title":"Top Org Id","type":["integer","null"]},"incl_sites":{"type":"boolean","title":"Incl Sites","default":false},"incl_sensors":{"type":"boolean","title":"Incl Sensors","default":false},"enabled_orgs_only":{"type":"boolean","title":"Enabled Orgs Only","default":true},"enabled_sites_only":{"type":"boolean","title":"Enabled Sites Only","default":true},"enabled_sensors_only":{"type":"boolean","title":"Enabled Sensors Only","default":true}},"type":"object","title":"GetOrgRequest"},"GetReportStatsResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"data":{"$ref":"#/components/schemas/ReportStatsData"}},"type":"object","required":["success","msg","data"],"title":"GetReportStatsResponse"},"GetSensorResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"enabled":{"type":"boolean","title":"Enabled"},"sensor_id":{"type":"integer","title":"Sensor Id"},"sensor_id_str":{"type":"string","title":"Sensor Id Str"},"tag":{"title":"Tag","type":["string","null"]},"site_id":{"type":"integer","title":"Site Id"},"site_name":{"type":"string","title":"Site Name"},"hub_id":{"type":"integer","title":"Hub Id"},"human_name":{"type":"string","title":"Human Name"},"meta":{"title":"Meta"},"max_resolution":{"title":"Max Resolution","type":["string","null"]},"config":{"title":"Config"},"disabled_date":{"title":"Disabled Date","type":["string","null"]},"created":{"type":"string","title":"Created"},"last_updated":{"title":"Last Updated","type":["string","null"]},"environment":{"title":"Environment","type":["string","null"]},"ptz":{"title":"Ptz","type":["boolean","null"]},"arm_mode":{"title":"Arm Mode","type":["string","null"]},"mute_until":{"title":"Mute Until","type":["string","null"]}},"type":"object","required":["success","msg","enabled","sensor_id","sensor_id_str","tag","site_id","site_name","hub_id","human_name","meta","max_resolution","config","disabled_date","created","last_updated","environment","ptz","arm_mode","mute_until"],"title":"GetSensorResponse"},"GetSensorRuleConfigsResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"data":{"description":"Sensor rule configurations data if successful","$ref":"#/components/schemas/SensorRuleConfigsData"}},"type":"object","required":["success","msg"],"title":"GetSensorRuleConfigsResponse","description":"Response model for getting sensor rule configurations"},"GetSiteResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"site_id":{"type":"integer","title":"Site Id"},"site_name":{"type":"string","title":"Site Name"},"enabled":{"type":"boolean","title":"Enabled"},"created":{"type":"string","title":"Created"},"last_updated":{"type":"string","title":"Last Updated"},"disabled_date":{"type":"string","title":"Disabled Date"},"product":{"type":"string","title":"Product"},"sensors":{"title":"Sensors","items":{"$ref":"#/components/schemas/SiteSensor"},"type":"array"}},"type":"object","required":["success","msg","site_id","site_name","enabled","created","last_updated","disabled_date","product"],"title":"GetSiteResponse"},"GetTopAlertingSensorsResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"data":{"description":"Top alerting sensors data if successful","$ref":"#/components/schemas/TopAlertingSensorsData"}},"type":"object","required":["success","msg"],"title":"GetTopAlertingSensorsResponse","description":"Response model for getting top alerting sensors"},"GetUsageExportResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"data":{"description":"Usage export data if successful","$ref":"#/components/schemas/UsageExportData"}},"type":"object","required":["success","msg"],"title":"GetUsageExportResponse","description":"Response model for getting usage export data"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HubType":{"type":"string","enum":["logical","real"],"title":"HubType"},"InferenceImageData":{"properties":{"sensor_id_str":{"type":"string","title":"Sensor Id Str","description":"Sensor ID string"},"image_b64":{"type":"string","title":"Image B64","description":"Base64 encoded image data"},"width":{"type":"integer","title":"Width","description":"Image width in pixels"},"height":{"type":"integer","title":"Height","description":"Image height in pixels"},"inference_timestamp":{"title":"Inference Timestamp","description":"UTC timestamp when inference was created","type":["string","null"]}},"type":"object","required":["sensor_id_str","image_b64","width","height"],"title":"InferenceImageData","description":"Model for inference image response data"},"InvoiceItemData":{"properties":{"region_name":{"type":"string","title":"Region Name","description":"Region name"},"customer_id":{"type":"integer","title":"Customer Id","description":"Customer/Organization ID"},"customer":{"type":"string","title":"Customer","description":"Customer/Organization name"},"product":{"title":"Product","description":"Product name","type":["string","null"]},"product_code":{"type":"string","title":"Product Code","description":"Product code"},"quantity":{"title":"Quantity","description":"Usage quantity","type":["integer","null"]}},"type":"object","required":["region_name","customer_id","customer","product","product_code","quantity"],"title":"InvoiceItemData","description":"Model for invoice item information"},"LiftDetectionSuppressionsRequest":{"properties":{"source_event_id":{"title":"Source Event Id","type":["string","null"]},"source_image_index":{"title":"Source Image Index","type":"integer","minimum":0.0},"suppression_ids":{"title":"Suppression Ids","items":{"type":"string"},"type":"array","minItems":1},"sensor_id":{"title":"Sensor Id","description":"scopes suppression_ids; access is checked against it","type":["integer","null"]},"alert_ids":{"title":"Alert Ids","items":{"type":"string"},"type":"array","minItems":1},"origin":{"type":"string","enum":["review_page","alert_auto","semiauto","api"],"title":"Origin","default":"api"},"reason":{"title":"Reason","type":["string","null"]},"review_user_id":{"title":"Review User Id","type":["integer","null"]},"review_username":{"title":"Review Username","type":["string","null"]}},"type":"object","title":"LiftDetectionSuppressionsRequest","description":"Lift rules by frame (`source_event_id` + `source_image_index`), by `suppression_ids` + `sensor_id`, or by `alert_ids`."},"ListSensorsResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"sensors":{"items":{"$ref":"#/components/schemas/SensorListItem"},"type":"array","title":"Sensors"}},"type":"object","required":["success","msg","sensors"],"title":"ListSensorsResponse"},"ListSitesResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"sites":{"items":{"$ref":"#/components/schemas/SiteListItem"},"type":"array","title":"Sites"}},"type":"object","required":["success","msg","sites"],"title":"ListSitesResponse"},"MoveSiteRequest":{"properties":{"site_id":{"type":"integer","title":"Site Id"},"org_id":{"type":"integer","title":"Org Id"}},"type":"object","required":["site_id","org_id"],"title":"MoveSiteRequest"},"MoveSiteResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"org_id_old":{"title":"Org Id Old","type":["integer","null"]},"org_id_new":{"title":"Org Id New","type":["integer","null"]}},"type":"object","required":["success","msg"],"title":"MoveSiteResponse"},"MuteSensorRequest":{"properties":{"sensor_id":{"title":"Sensor Id","description":"database id of the sensor to mute/unmute","type":["integer","null"]},"sensor_id_str":{"title":"Sensor Id Str","description":"sensor ID string e.g. DH1AAAB-a","type":["string","null"]},"tag":{"title":"Tag","description":"globally unique tag of the sensor to mute/unmute","type":["string","null"]},"mute_until":{"title":"Mute Until","description":"ISO 8601 datetime until which the sensor is muted, null to unmute","type":"string","format":"date-time"}},"type":"object","title":"MuteSensorRequest"},"MuteSensorResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"sensor_id":{"type":"integer","title":"Sensor Id"},"sensor_id_str":{"type":"string","title":"Sensor Id Str"},"mute_until":{"title":"Mute Until","type":["string","null"]}},"type":"object","required":["success","msg","sensor_id","sensor_id_str","mute_until"],"title":"MuteSensorResponse"},"NewSiteSensor":{"properties":{"sensor_id":{"title":"Sensor Id","description":"integer sensor id","type":["integer","null"]},"sensor_id_str":{"title":"Sensor Id Str","description":"string id assigned to","type":["string","null"]},"human_name":{"title":"Human Name","description":"human descriptive name for the sensor","type":["string","null"]}},"type":"object","title":"NewSiteSensor"},"OrgBillingRate":{"properties":{"id":{"type":"integer","title":"Id","description":"org billing rate id"},"billing_rate_id":{"type":"integer","title":"Billing Rate Id","description":"billing rate id"},"billing_rate_product":{"type":"string","title":"Billing Rate Product","description":"billing rate product description"}},"type":"object","required":["id","billing_rate_id","billing_rate_product"],"title":"OrgBillingRate"},"OrgTreeCounts":{"properties":{"org_count":{"type":"integer","title":"Org Count"},"site_count":{"type":"integer","title":"Site Count"},"hub_count":{"type":"integer","title":"Hub Count"}},"type":"object","required":["org_count","site_count","hub_count"],"title":"OrgTreeCounts"},"OrgTreeData":{"properties":{"name":{"type":"string","title":"Name"},"id":{"type":"integer","title":"Id"},"tag":{"title":"Tag","type":["string","null"]},"enabled":{"type":"boolean","title":"Enabled"},"created":{"type":"string","title":"Created"},"last_updated":{"title":"Last Updated","type":["string","null"]},"children":{"items":{"$ref":"#/components/schemas/OrgTreeData"},"type":"array","title":"Children"},"sites":{"title":"Sites","items":{"$ref":"#/components/schemas/OrgTreeSite"},"type":"array"}},"type":"object","required":["name","id","tag","enabled","created","children"],"title":"OrgTreeData"},"OrgTreeResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"data":{"$ref":"#/components/schemas/OrgTreeData"}},"type":"object","required":["success","data"],"title":"OrgTreeResponse"},"OrgTreeSensor":{"properties":{"id":{"type":"integer","title":"Id"},"sensor_id_str":{"type":"string","title":"Sensor Id Str"},"human_name":{"type":"string","title":"Human Name"},"tag":{"title":"Tag","type":["string","null"]},"enabled":{"type":"boolean","title":"Enabled"},"created":{"type":"string","title":"Created"},"last_updated":{"type":"string","title":"Last Updated"}},"type":"object","required":["id","sensor_id_str","human_name","tag","enabled","created","last_updated"],"title":"OrgTreeSensor"},"OrgTreeSite":{"properties":{"name":{"type":"string","title":"Name"},"id":{"type":"integer","title":"Id"},"enabled":{"type":"boolean","title":"Enabled"},"product":{"type":"string","title":"Product"},"tag":{"title":"Tag","type":["string","null"]},"created":{"type":"string","title":"Created"},"last_updated":{"type":"string","title":"Last Updated"},"sensors":{"title":"Sensors","items":{"$ref":"#/components/schemas/OrgTreeSensor"},"type":"array"}},"type":"object","required":["name","id","enabled","product","tag","created","last_updated"],"title":"OrgTreeSite"},"OrgTreeTotalsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"totals":{"additionalProperties":{"$ref":"#/components/schemas/OrgTreeCounts"},"type":"object","title":"Totals"}},"type":"object","required":["success","totals"],"title":"OrgTreeTotalsResponse"},"PatchSensorConfigRequest":{"properties":{"sensor_id":{"title":"Sensor Id","description":"database id of the sensor to update (checked first)","type":["integer","null"]},"sensor_id_str":{"title":"Sensor Id Str","description":"database sensor ID string of the sensor to update (checked second) e.g. DH1AAAB-a","type":["string","null"]},"tag":{"title":"Tag","description":"globally unique tag of the sensor to update (checked third)","type":["string","null"]},"config":{"title":"Config","description":"config keys to merge into the existing sensor config (shallow)","additionalProperties":true,"type":"object"},"advanced_alert_zones":{"title":"Advanced Alert Zones","description":"zone name to stringified coordinate list, merged into the existing advanced alert zones (shallow); the full_image zone is always set from the saved standard image dimensions","additionalProperties":{"type":"string"},"type":"object"}},"type":"object","title":"PatchSensorConfigRequest"},"ReapplyDetectionSuppressionsRequest":{"properties":{"source_event_id":{"type":"string","title":"Source Event Id"},"source_image_index":{"type":"integer","minimum":0.0,"title":"Source Image Index"},"origin":{"type":"string","enum":["review_page","alert_auto","semiauto","api"],"title":"Origin","default":"api"},"reason":{"title":"Reason","type":["string","null"]},"review_user_id":{"title":"Review User Id","type":["integer","null"]},"review_username":{"title":"Review Username","type":["string","null"]}},"type":"object","required":["source_event_id","source_image_index"],"title":"ReapplyDetectionSuppressionsRequest"},"ReportStatsData":{"properties":{"total_reports":{"type":"integer","title":"Total Reports","description":"Total number of reports configured for the org"},"total_report_types":{"type":"integer","title":"Total Report Types","description":"Number of distinct report types configured for the org"},"report_types_by_schedule":{"items":{"$ref":"#/components/schemas/ReportTypeScheduleCount"},"type":"array","title":"Report Types By Schedule","description":"Report counts per type per schedule. Monthly reports always run on the 1st, so they carry no day-of-month field"}},"type":"object","required":["total_reports","total_report_types","report_types_by_schedule"],"title":"ReportStatsData"},"ReportStatus":{"type":"string","enum":["running","generated","sent","failed","skipped","completed"],"title":"ReportStatus"},"ReportTypeScheduleCount":{"properties":{"report_type":{"type":"string","title":"Report Type","description":"Report type, cadence in the suffix e.g. 'site_activity:weekly'"},"timezone_str":{"type":"string","title":"Timezone Str","description":"Timezone the scheduled time is expressed in"},"time":{"title":"Time","description":"Local time of day the report runs e.g. '06:00'. Null for report types that are not scheduled by time of day","type":["string","null"]},"isoweekday":{"title":"Isoweekday","description":"Day of week (1=Monday) for weekly reports, else null","type":["integer","null"]},"count":{"type":"integer","title":"Count","description":"Number of reports configured with this schedule"}},"type":"object","required":["report_type","timezone_str","time","isoweekday","count"],"title":"ReportTypeScheduleCount"},"SensorAlertData":{"properties":{"site_id":{"title":"Site Id","description":"Site ID","type":["integer","null"]},"site_name":{"type":"string","title":"Site Name","description":"Site name"},"site_product_type":{"title":"Site Product Type","description":"Site product type","type":["string","null"]},"sensor_id":{"title":"Sensor Id","description":"Sensor ID","type":["integer","null"]},"sensor_id_str":{"type":"string","title":"Sensor Id Str","description":"Sensor ID string"},"sensor_name":{"type":"string","title":"Sensor Name","description":"Sensor name"},"event_count":{"type":"integer","title":"Event Count","description":"Number of events for this sensor"},"alert_count":{"type":"integer","title":"Alert Count","description":"Number of alerts for this sensor"},"avg_inference_images_per_event":{"title":"Avg Inference Images Per Event","description":"Average number of inference images per event","type":["number","null"]}},"type":"object","required":["site_name","sensor_id_str","sensor_name","event_count","alert_count"],"title":"SensorAlertData","description":"Model for individual sensor alert information"},"SensorListItem":{"properties":{"id":{"type":"integer","title":"Id","description":"database id of the sensor"},"sensor_id_str":{"type":"string","title":"Sensor Id Str","description":"sensor ID string e.g. DH1AAAB-a"},"tag":{"title":"Tag","description":"globally unique sensor tag","type":["string","null"]},"human_name":{"type":"string","title":"Human Name","description":"human descriptive name for the sensor"},"enabled":{"type":"boolean","title":"Enabled"},"hub_id":{"type":"integer","title":"Hub Id"},"sensor_type":{"title":"Sensor Type","type":["string","null"]},"config":{"title":"Config","description":"sensor config, only present when include_config=true","additionalProperties":true,"type":"object"}},"type":"object","required":["id","sensor_id_str","human_name","enabled","hub_id"],"title":"SensorListItem"},"SensorRuleConfigResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"alert_config_id":{"type":"integer","title":"Alert Config Id"},"sensor_id":{"type":"integer","title":"Sensor Id"},"sensor_id_str":{"type":"string","title":"Sensor Id Str"}},"type":"object","required":["success","msg","alert_config_id","sensor_id","sensor_id_str"],"title":"SensorRuleConfigResponse"},"SensorRuleConfigsData":{"properties":{"sensor_id_str":{"type":"string","title":"Sensor Id Str","description":"Sensor ID string"},"sensor_name":{"title":"Sensor Name","description":"Sensor name","type":["string","null"]},"site_name":{"title":"Site Name","description":"Site name","type":["string","null"]},"config_count":{"type":"integer","title":"Config Count","description":"Number of configurations"},"configs":{"items":{"$ref":"#/components/schemas/AlertConfigData"},"type":"array","title":"Configs","description":"List of alert configurations"}},"type":"object","required":["sensor_id_str","config_count","configs"],"title":"SensorRuleConfigsData","description":"Model for sensor rule configurations response data"},"SiteListItem":{"properties":{"id":{"type":"integer","title":"Id","description":"database id of the site"},"name":{"type":"string","title":"Name","description":"site name"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"site meta jsonb column"}},"type":"object","required":["id","name"],"title":"SiteListItem"},"SiteSensor":{"properties":{"sensor_id":{"type":"integer","title":"Sensor Id"},"sensor_id_str":{"type":"string","title":"Sensor Id Str"},"human_name":{"type":"string","title":"Human Name"},"tag":{"title":"Tag","type":["string","null"]},"enabled":{"type":"boolean","title":"Enabled"},"config":{"title":"Config","additionalProperties":true,"type":"object"},"meta":{"title":"Meta","additionalProperties":true,"type":"object"},"created":{"type":"string","title":"Created"},"last_updated":{"type":"string","title":"Last Updated"},"disabled_date":{"type":"string","title":"Disabled Date"}},"type":"object","required":["sensor_id","sensor_id_str","human_name","tag","enabled","created","last_updated","disabled_date"],"title":"SiteSensor"},"SiteSensorData":{"properties":{"count":{"type":"integer","title":"Count","description":"Number of sensors at the site"},"product":{"title":"Product","description":"Product name","type":["string","null"]},"product_code":{"title":"Product Code","description":"Product code","type":["string","null"]},"billing_start_date":{"title":"Billing Start Date","description":"Billing start date in ISO format","type":["string","null"]},"site_id":{"type":"integer","title":"Site Id","description":"Site ID"},"site_name":{"type":"string","title":"Site Name","description":"Site name"}},"type":"object","required":["count","product","product_code","billing_start_date","site_id","site_name"],"title":"SiteSensorData","description":"Model for site sensor information"},"SiteSensorHealthStatus":{"properties":{"sensor_id_str":{"type":"string","minLength":1,"title":"Sensor Id Str","description":"sensor ID string e.g. DH1AAAB-a"},"health_status":{"type":"string","enum":["ok","error","warning","unknown"],"title":"Health Status","description":"health status for the sensor"},"metrics":{"additionalProperties":true,"type":"object","title":"Metrics","description":"per-check sensor metrics stored with the health record, e.g. {\"rtsp_status\": \"error: no route\"}","default":{}}},"type":"object","required":["sensor_id_str","health_status"],"title":"SiteSensorHealthStatus"},"StandardImageWithTimestamp":{"properties":{"utc_timestamp":{"type":"number","title":"Utc Timestamp"},"height":{"type":"integer","title":"Height"},"width":{"type":"integer","title":"Width"},"stringb64":{"type":"string","title":"Stringb64"}},"type":"object","required":["utc_timestamp","height","width","stringb64"],"title":"StandardImageWithTimestamp","description":"model for standard image dict structure with UTC timestamps"},"SuppressionDetection":{"properties":{"inference_class":{"type":"string","minLength":1,"title":"Inference Class","description":"detection class, e.g. 'people'"},"x0":{"type":"integer","title":"X0","description":"left edge of the detection bbox"},"y0":{"type":"integer","title":"Y0","description":"top edge of the detection bbox"},"x1":{"type":"integer","title":"X1","description":"right edge of the detection bbox"},"y1":{"type":"integer","title":"Y1","description":"bottom edge of the detection bbox"}},"type":"object","required":["inference_class","x0","y0","x1","y1"],"title":"SuppressionDetection","description":"One detection of the alert to suppress, identified by its class and bbox.\n\nThe coordinates are the ones the alert itself reported, in the alert image's pixel space —\nthe caller is picking from a list it was given, not drawing a new box."},"TopAlertingSensorsData":{"properties":{"sensors":{"items":{"$ref":"#/components/schemas/SensorAlertData"},"type":"array","title":"Sensors","description":"List of top alerting sensors"}},"type":"object","required":["sensors"],"title":"TopAlertingSensorsData","description":"Model for top alerting sensors response data"},"UpdateAlertAccuracyFlagRequest":{"properties":{"alert_id":{"type":"string","minLength":1,"title":"Alert Id","description":"alert id of the alert to update"},"improve_accuracy_flag":{"type":"boolean","title":"Improve Accuracy Flag","description":"flag to update alert to"},"improve_accuracy_user_id":{"type":"integer","title":"Improve Accuracy User Id","description":"user id"},"improve_accuracy_username":{"type":"string","minLength":1,"title":"Improve Accuracy Username","description":"username"}},"type":"object","required":["alert_id","improve_accuracy_flag","improve_accuracy_user_id","improve_accuracy_username"],"title":"UpdateAlertAccuracyFlagRequest"},"UpdateAlertAccuracyFlagResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"alert_id":{"type":"string","title":"Alert Id"},"improve_accuracy_flag":{"type":"boolean","title":"Improve Accuracy Flag"}},"type":"object","required":["success","msg","alert_id","improve_accuracy_flag"],"title":"UpdateAlertAccuracyFlagResponse"},"UpdateAlertStatusRequest":{"properties":{"alert_id":{"type":"string","minLength":1,"title":"Alert Id","description":"alert id of the alert to update"},"status":{"type":"string","minLength":1,"title":"Status","description":"status to update alert to"},"review_user_id":{"type":"integer","title":"Review User Id","description":"review user id"},"review_username":{"type":"string","minLength":1,"title":"Review Username","description":"review username"}},"type":"object","required":["alert_id","status","review_user_id","review_username"],"title":"UpdateAlertStatusRequest"},"UpdateAlertStatusResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"alert_id":{"type":"string","title":"Alert Id"}},"type":"object","required":["success","msg","alert_id"],"title":"UpdateAlertStatusResponse"},"UpdateAlertSuppressFlagRequest":{"properties":{"alert_id":{"type":"string","minLength":1,"title":"Alert Id","description":"alert id of the alert to update"},"suppress_flag":{"type":"boolean","title":"Suppress Flag","description":"flag to update alert to"},"review_user_id":{"type":"integer","title":"Review User Id","description":"id of the reviewer"},"review_username":{"type":"string","minLength":1,"title":"Review Username","description":"name of the reviewer"},"reason_for_flag":{"title":"Reason For Flag","description":"optional reason/comment for the suppression","type":["string","null"]},"detections":{"title":"Detections","description":"suppress only these detections of the alert. Omit to suppress every detection on it, which remains a valid choice: the operator silenced the alert, not one object in it","items":{"$ref":"#/components/schemas/SuppressionDetection"},"type":"array"},"source":{"type":"string","enum":["management_gui","alerting_gui_auto","semiauto","api"],"title":"Source","description":"which system is creating the suppression — recorded on every row it writes","default":"api"}},"type":"object","required":["alert_id","suppress_flag","review_user_id","review_username"],"title":"UpdateAlertSuppressFlagRequest"},"UpdateAlertSuppressFlagResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"alert_id":{"type":"string","title":"Alert Id"},"suppress_flag":{"type":"boolean","title":"Suppress Flag"},"suppression_ids":{"items":{"type":"string"},"type":"array","title":"Suppression Ids","description":"the alert's active suppression rows after this call, newest first. Ids are UUIDv7 and therefore time-ordered, so the first is the one this call created — which is how a caller learns the id it needs to lift later"}},"type":"object","required":["success","msg","alert_id","suppress_flag"],"title":"UpdateAlertSuppressFlagResponse"},"UpdateOrgTreeReponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"}},"type":"object","required":["success","msg"],"title":"UpdateOrgTreeReponse"},"UpdateOrgTreeRequest":{"properties":{"org_id":{"title":"Org Id","description":"Id of the org to update","type":["integer","null"]},"org_name":{"title":"Org Name","description":"string name of the new org","type":["string","null"]},"tag":{"title":"Tag","description":"Globally unique tag of the org to update (checked after org_id) or the value of the tag to update to for the org identified by org_id. To reset the tag to null in the DB send an empty string as the tag.","type":["string","null"]}},"type":"object","title":"UpdateOrgTreeRequest"},"UpdateSensorRequest":{"properties":{"sensor_id":{"title":"Sensor Id","description":"database id of the sensor to update (checked first)","type":["integer","null"]},"sensor_id_str":{"title":"Sensor Id Str","description":"database sensor ID string of the sensor to update (checked second) e.g. DH1AAAB-a","type":["string","null"]},"tag":{"title":"Tag","description":"Globally unique tag of the sensor to update (checked third) or the value of the tag to update to for the sensor identified by sensor_id or sensor_id_str. To reset the tag to null in the DB send an empty string as the tag.","type":["string","null"]},"enabled":{"title":"Enabled","description":"boolean for whether sensor is enabled","type":["boolean","null"]},"site_id":{"title":"Site Id","description":"integer site id with which sensor is associated","type":["integer","null"]},"human_name":{"title":"Human Name","description":"human descriptive name for the sensor","type":["string","null"]},"config":{"title":"Config","description":"json sensor config","type":["string","null"]},"meta":{"title":"Meta","description":"json sensor meta","type":["string","null"]},"environment":{"title":"Environment","description":"string indicating the environment within which the sensor is set up eg: parking area, residential, office, etc","type":["string","null"]},"billing_start_date":{"title":"Billing Start Date","description":"billing start date in format e.g. '2020-09-25' (timezone UTC)","type":"string","format":"date"},"ptz":{"title":"Ptz","description":"boolean indicator of whether a sensor is a PTZ camera","type":["boolean","null"]},"mute_until":{"title":"Mute Until","description":"ISO 8601 datetime until which the sensor is muted, null to unmute","type":"string","format":"date-time"},"sensor_type":{"title":"Sensor Type","description":"string indicating type of the sensor","type":["string","null"]},"standard_image":{"type":"string","title":"Standard Image","description":"json standard image for the sensor e.g. {\"stringb64\": \"...\", \"width\": 1920, \"height\": 1080}"},"advanced_alert_zones":{"title":"Advanced Alert Zones","description":"json mapping of zone name to stringified coordinate list in standard image pixels, e.g. {\"A\": \"[(23, 456), (120, 456), (234, 443)]\"}. Replaces all existing zones; the full_image zone is always set from the saved standard image dimensions.","type":["string","null"]},"reason":{"type":"string","title":"Reason","description":"reason for the update, included in disable notification email when sensor is being disabled"}},"type":"object","title":"UpdateSensorRequest"},"UpdateSensorResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"sensor_id":{"type":"integer","title":"Sensor Id"}},"type":"object","required":["success","msg","sensor_id"],"title":"UpdateSensorResponse"},"UpdateSensorRuleConfigRequest":{"properties":{"sensor_id":{"title":"Sensor Id","description":"database id of the sensor the rule applies to","type":["integer","null"]},"sensor_id_str":{"title":"Sensor Id Str","description":"sensor ID string e.g. DH1AAAB-a","type":["string","null"]},"tag":{"title":"Tag","description":"globally unique tag of the sensor","type":["string","null"]},"alert_config":{"additionalProperties":true,"type":"object","title":"Alert Config","description":"alert config in validator format: alert_type, alert_config_type, name, rule_configs, and valid_days_and_times / exact_times / cadence_secs as applicable"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"additional metadata to store with the rule"},"alert_config_id":{"type":"integer","title":"Alert Config Id","description":"id of the existing alert config to update"}},"type":"object","required":["alert_config","alert_config_id"],"title":"UpdateSensorRuleConfigRequest"},"UpdateSiteRequest":{"properties":{"site_id":{"title":"Site Id","description":"database id of the site to update","type":["integer","null"]},"site_name":{"title":"Site Name","description":"string site name","type":["string","null"]},"enabled":{"title":"Enabled","description":"boolean for whether site should be enabled","type":["boolean","null"]},"timezone_str":{"title":"Timezone Str","description":"timezone string for this site (e.g. 'Africa/Johannesburg')","type":["string","null"]},"latitude":{"title":"Latitude","description":"latitude of the site (empty string to remove)","type":["string","null"]},"longitude":{"title":"Longitude","description":"longitude of the site (empty string to remove)","type":["string","null"]},"address":{"title":"Address","description":"address of the site (empty string to remove)","type":["string","null"]},"tag":{"title":"Tag","description":"Globally unique tag of the site to update (checked after site_id) or the value of the tag to update to for the site identified by site_id. To reset the tag to null in the DB send an empty string as the tag.","type":["string","null"]},"note":{"title":"Note","description":"note about the site (empty string to remove)","type":["string","null"]},"animated_clips":{"title":"Animated Clips","description":"whether to generate animated clips for alerts for this site","type":["boolean","null"]},"arm_mode":{"title":"Arm Mode","description":"arm mode for the site from \"scheduled\", \"armed\", \"disarmed\"","type":["string","null"]}},"type":"object","title":"UpdateSiteRequest"},"UpdateSiteResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether or not the request was successful"},"msg":{"type":"string","title":"Msg","description":"Operation details"},"site_id":{"type":"integer","title":"Site Id"},"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["success","msg","site_id","enabled"],"title":"UpdateSiteResponse"},"UsageExportData":{"properties":{"start_date":{"type":"string","title":"Start Date","description":"Start date (inclusive) in YYYY-MM-DD format"},"end_date":{"type":"string","title":"End Date","description":"End date (exclusive) in YYYY-MM-DD format"},"total_count":{"type":"integer","title":"Total Count","description":"Total number of records matching the filters"},"record_count":{"type":"integer","title":"Record Count","description":"Number of records returned in this page"},"limit":{"type":"integer","title":"Limit","description":"Max records per page"},"offset":{"type":"integer","title":"Offset","description":"Number of records skipped"},"records":{"items":{"$ref":"#/components/schemas/UsageExportRecord"},"type":"array","title":"Records","description":"Usage records"}},"type":"object","required":["start_date","end_date","total_count","record_count","limit","offset","records"],"title":"UsageExportData","description":"Model for usage export response data"},"UsageExportRecord":{"properties":{"id":{"type":"integer","title":"Id","description":"Usage record ID"},"created":{"type":"string","format":"date-time","title":"Created","description":"Record creation timestamp"},"usage_type":{"type":"string","title":"Usage Type","description":"Type of usage"},"org_id":{"type":"integer","title":"Org Id","description":"Organization ID"},"org_name":{"type":"string","title":"Org Name","description":"Organization name"},"parent_org_name":{"type":"string","title":"Parent Org Name","description":"Parent organization name"},"product_code":{"title":"Product Code","description":"Product code","type":["string","null"]},"product_name":{"title":"Product Name","description":"Product name","type":["string","null"]},"feature_name":{"title":"Feature Name","description":"Feature name","type":["string","null"]},"site_count":{"title":"Site Count","description":"Number of active sites","type":["integer","null"]},"inactive_site_count":{"title":"Inactive Site Count","description":"Number of inactive sites","type":["integer","null"]},"sensor_count":{"title":"Sensor Count","description":"Number of active sensors","type":["integer","null"]},"inactive_sensor_count":{"title":"Inactive Sensor Count","description":"Number of inactive sensors","type":["integer","null"]},"usage_count":{"title":"Usage Count","description":"Usage count","type":["integer","null"]},"meta":{"title":"Meta","description":"Additional metadata (JSONB)","additionalProperties":true,"type":"object"}},"type":"object","required":["id","created","usage_type","org_id","org_name","parent_org_name","product_code","product_name","feature_name","site_count","inactive_site_count","sensor_count","inactive_sensor_count","usage_count"],"title":"UsageExportRecord","description":"Model for a single raw usage record"},"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"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}