{ "openapi": "3.1.0", "info": { "title": "ANSVIS Server API", "version": "1.0.0", "description": "Standards-compliant REST API for ANSVIS. This is the v1 contract that the ANSCORE Layer 3 (Qt/QML desktop UI) codes against. The ANSVIS backend provides this surface via an adapter layer in front of its existing implementation; the legacy endpoints (no /api/v1 prefix) remain available during a single deprecation cycle.\n\n## Conventions\n- Base path: `/api/v1/`\n- Resource paths are plural kebab-case (`/cameras`, `/ai-tasks`, `/deployment-groups`).\n- Field names are `snake_case`. Units are encoded in the field name (`time_interval_seconds`, not `time_interval` with a `(s)` suffix).\n- IDs go in the path, never as a query-string key.\n- Methods: GET=read, POST=create, PUT=replace, PATCH=partial update, DELETE=remove. State-change verbs use `POST /resource/{id}/{action}` (start/stop) — pragmatic exception to pure REST.\n- Errors follow RFC 7807 (`application/problem+json`).\n- List responses use `{items, page, page_size, total, next_cursor}`.\n- Timestamps are RFC 3339 UTC strings.\n- Authentication: `Authorization: Bearer ` header. Never in URL.\n- File uploads ≤10 MB use `multipart/form-data`; larger uploads use the initiate/complete pattern with a presigned PUT URL.\n- Live event streams use Server-Sent Events (`text/event-stream`).\n- Live video uses a separate transport (HLS in v1, WebRTC later) — the UI calls `GET /cameras/{id}/liveview` to obtain a stream descriptor.\n\n## Migration aid\nEach endpoint's description ends with `Replaces:` showing the legacy ANSVIS endpoint(s) it supersedes.", "contact": { "name": "ANSCENTER" }, "license": { "name": "Proprietary" } }, "servers": [ { "url": "https://{host}/api/v1", "variables": { "host": { "default": "localhost" } }, "description": "Production / on-prem" }, { "url": "http://localhost:4010", "description": "Local Prism mock (run `prism mock contracts/openapi.v1.json`)" } ], "tags": [ { "name": "auth", "description": "Authentication & session" }, { "name": "users", "description": "System users (operators of the UI)" }, { "name": "cameras", "description": "Camera devices and streams" }, { "name": "models", "description": "AI model registry" }, { "name": "edges", "description": "Edge devices (ANSOpenEdge etc.)" }, { "name": "deployment-groups", "description": "Groups that bind cameras + models + rules + triggers to targets" }, { "name": "ai-tasks", "description": "Configured AI tasks (vehicle counting, intrusion, etc.)" }, { "name": "events", "description": "Detected events emitted by AI tasks" }, { "name": "fr", "description": "Face Recognition: persons, faces, groups, configuration" }, { "name": "fr-recording", "description": "Face recording / capture tasks" }, { "name": "alpr", "description": "Automatic License Plate Recognition registrations" }, { "name": "notifications", "description": "Recipient lists for outbound notifications" }, { "name": "triggers", "description": "Trigger catalog and test dispatch" }, { "name": "system", "description": "Server status, health, version, logs, updates" }, { "name": "jobs", "description": "Asynchronous job tracking (scans, uploads, deploys)" }, { "name": "composite", "description": "Convenience endpoints that wrap multiple primitives" } ], "security": [{ "BearerAuth": [] }], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "opaque" } }, "parameters": { "Page": { "name": "page", "in": "query", "schema": { "type": "integer", "minimum": 1, "default": 1 } }, "PageSize": { "name": "page_size", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 50 } }, "Sort": { "name": "sort", "in": "query", "schema": { "type": "string" }, "description": "Comma-separated fields; prefix `-` for descending. Example: `-created_at,name`" }, "PathId": { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } }, "schemas": { "Problem": { "type": "object", "description": "RFC 7807 problem details. Returned with the matching HTTP status code on every error.", "required": ["type", "title", "status"], "properties": { "type": { "type": "string", "format": "uri", "examples": ["https://anscenter.com/errors/validation"] }, "title": { "type": "string", "examples": ["Validation failed"] }, "status": { "type": "integer", "examples": [422] }, "detail": { "type": "string" }, "instance": { "type": "string" }, "errors": { "type": "array", "items": { "type": "object", "properties": { "field": { "type": "string" }, "message": { "type": "string" } } } } } }, "PaginationMeta": { "type": "object", "required": ["page", "page_size", "total"], "properties": { "page": { "type": "integer", "minimum": 1 }, "page_size": { "type": "integer", "minimum": 1 }, "total": { "type": "integer", "minimum": 0 }, "next_cursor": { "type": "string", "nullable": true } } }, "JobAck": { "type": "object", "required": ["job_id", "status"], "properties": { "job_id": { "type": "string" }, "status": { "type": "string", "enum": ["queued", "running", "succeeded", "failed", "cancelled"] }, "links": { "type": "object", "properties": { "self": { "type": "string" } } } } }, "Job": { "type": "object", "required": ["job_id", "status", "created_at"], "properties": { "job_id": { "type": "string" }, "kind": { "type": "string", "examples": ["camera_scan", "model_upload", "config_deploy"] }, "status": { "type": "string", "enum": ["queued", "running", "succeeded", "failed", "cancelled"] }, "progress": { "type": "number", "minimum": 0, "maximum": 1 }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "result": { "type": "object", "additionalProperties": true, "nullable": true }, "error": { "$ref": "#/components/schemas/Problem", "nullable": true } } }, "LoginRequest": { "type": "object", "required": ["username", "password"], "properties": { "username": { "type": "string" }, "password": { "type": "string", "format": "password" } } }, "LoginResponse": { "type": "object", "required": ["access_token", "expires_at", "user"], "properties": { "access_token": { "type": "string" }, "refresh_token": { "type": "string", "nullable": true }, "token_type": { "type": "string", "enum": ["Bearer"], "default": "Bearer" }, "expires_at": { "type": "string", "format": "date-time" }, "user": { "$ref": "#/components/schemas/User" } } }, "RefreshRequest": { "type": "object", "required": ["refresh_token"], "properties": { "refresh_token": { "type": "string" } } }, "User": { "type": "object", "required": ["id", "username", "access_level"], "properties": { "id": { "type": "integer", "format": "int64" }, "username": { "type": "string" }, "email": { "type": "string", "format": "email", "nullable": true }, "phone_number": { "type": "string", "nullable": true }, "access_level": { "type": "string", "enum": ["admin", "operator", "viewer"] }, "group_name": { "type": "string", "nullable": true }, "extra_settings": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" } } }, "UserCreate": { "type": "object", "required": ["username", "password", "access_level"], "properties": { "username": { "type": "string" }, "password": { "type": "string", "format": "password" }, "email": { "type": "string", "format": "email" }, "phone_number": { "type": "string" }, "access_level": { "type": "string", "enum": ["admin", "operator", "viewer"] }, "group_name": { "type": "string" } } }, "UserUpdate": { "type": "object", "properties": { "password": { "type": "string", "format": "password" }, "email": { "type": "string", "format": "email" }, "phone_number": { "type": "string" }, "access_level": { "type": "string", "enum": ["admin", "operator", "viewer"] }, "group_name": { "type": "string" } } }, "UserList": { "allOf": [ { "$ref": "#/components/schemas/PaginationMeta" }, { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/User" } } }} ] }, "Credentials": { "type": "object", "properties": { "username": { "type": "string" }, "password": { "type": "string", "format": "password" } } }, "CapturingSettings": { "type": "object", "required": ["mode"], "properties": { "mode": { "type": "string", "enum": ["timer", "trigger"], "default": "timer" }, "time_interval_seconds": { "type": "number", "minimum": 0.01, "default": 0.1 }, "trigger_name": { "type": "string", "default": "" } } }, "Crop": { "type": "object", "properties": { "left": { "type": "integer", "default": 0 }, "top": { "type": "integer", "default": 0 }, "right": { "type": "integer", "default": 0 }, "bottom": { "type": "integer", "default": 0 } } }, "ImageSize": { "type": "object", "properties": { "width": { "type": "integer", "minimum": 0 }, "height": { "type": "integer", "minimum": 0 } } }, "Camera": { "type": "object", "required": ["id", "name", "driver", "address"], "properties": { "id": { "type": "integer", "format": "int64", "readOnly": true }, "name": { "type": "string" }, "driver": { "type": "string", "enum": ["rtsp", "rtmp", "srt", "mjpeg", "onvif", "webcam", "simulated_video", "simulated_image"] }, "address": { "type": "string", "description": "URL or local path depending on driver" }, "credentials": { "$ref": "#/components/schemas/Credentials" }, "capturing": { "$ref": "#/components/schemas/CapturingSettings" }, "rotation_degrees": { "type": "integer", "enum": [0, 90, 180, 270], "default": 0 }, "crop": { "$ref": "#/components/schemas/Crop" }, "image_size": { "$ref": "#/components/schemas/ImageSize" }, "active": { "type": "boolean", "default": true }, "logging_enabled": { "type": "boolean", "default": false }, "edge_id": { "type": "integer", "nullable": true }, "deployment_group_ids": { "type": "array", "items": { "type": "integer" }, "default": [] }, "created_at": { "type": "string", "format": "date-time", "readOnly": true }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true } } }, "CameraCreate": { "type": "object", "required": ["name", "driver", "address"], "properties": { "name": { "type": "string" }, "driver": { "type": "string", "enum": ["rtsp", "rtmp", "srt", "mjpeg", "onvif", "webcam", "simulated_video", "simulated_image"] }, "address": { "type": "string" }, "credentials": { "$ref": "#/components/schemas/Credentials" }, "capturing": { "$ref": "#/components/schemas/CapturingSettings" }, "rotation_degrees":{ "type": "integer", "enum": [0, 90, 180, 270] }, "crop": { "$ref": "#/components/schemas/Crop" }, "image_size": { "$ref": "#/components/schemas/ImageSize" }, "active": { "type": "boolean", "default": true }, "logging_enabled": { "type": "boolean", "default": false }, "edge_id": { "type": "integer", "nullable": true }, "deployment_group_ids": { "type": "array", "items": { "type": "integer" } } } }, "CameraUpdate": { "$ref": "#/components/schemas/CameraCreate" }, "CameraList": { "allOf": [ { "$ref": "#/components/schemas/PaginationMeta" }, { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Camera" } } }} ] }, "CameraScanRequest": { "type": "object", "properties": { "ip_range": { "type": "string", "examples": ["192.168.1.0/24"] }, "credentials": { "$ref": "#/components/schemas/Credentials" }, "timeout_seconds": { "type": "integer", "default": 10 } } }, "CameraProbeRequest": { "type": "object", "required": ["ip"], "properties": { "ip": { "type": "string" }, "port": { "type": "integer", "default": 80 }, "username": { "type": "string" }, "password": { "type": "string", "format": "password" } } }, "CameraProfile": { "type": "object", "properties": { "name": { "type": "string" }, "stream_uri": { "type": "string" }, "encoding": { "type": "string" }, "resolution": { "$ref": "#/components/schemas/ImageSize" }, "frame_rate": { "type": "number" } } }, "LiveviewDescriptor": { "type": "object", "required": ["url", "transport", "expires_at"], "properties": { "url": { "type": "string", "format": "uri" }, "transport": { "type": "string", "enum": ["rtsp", "hls", "webrtc"] }, "auth_token": { "type": "string", "nullable": true }, "expires_at": { "type": "string", "format": "date-time" }, "overlay_stream": { "type": "string", "nullable": true, "description": "Optional SSE endpoint for bbox overlays synced to PTS" } } }, "Model": { "type": "object", "required": ["id", "model_name", "model_type"], "properties": { "id": { "type": "integer", "format": "int64", "readOnly": true }, "model_name": { "type": "string" }, "model_type": { "type": "string", "enum": ["object_detection", "classification", "segmentation", "pose", "face_detection", "face_recognition", "ocr", "alpr", "anomaly", "custom"] }, "classifications": { "type": "array", "items": { "type": "string" } }, "import_date": { "type": "string", "format": "date-time" }, "import_source": { "type": "string" }, "model_crc": { "type": "string" }, "model_file_path": { "type": "string" }, "version": { "type": "integer", "default": 1 }, "size_bytes": { "type": "integer", "format": "int64", "readOnly": true } } }, "ModelUpdate": { "type": "object", "properties": { "model_name": { "type": "string" }, "classifications": { "type": "array", "items": { "type": "string" } }, "version": { "type": "integer" } } }, "ModelList": { "allOf": [ { "$ref": "#/components/schemas/PaginationMeta" }, { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Model" } } }} ] }, "InitiateUploadRequest": { "type": "object", "required": ["filename", "size_bytes"], "properties": { "filename": { "type": "string" }, "size_bytes": { "type": "integer", "format": "int64" }, "checksum": { "type": "string", "description": "Hex-encoded SHA-256" } } }, "InitiateUploadResponse": { "type": "object", "required": ["upload_id", "presigned_url", "expires_at"], "properties": { "upload_id": { "type": "string" }, "presigned_url": { "type": "string", "format": "uri" }, "method": { "type": "string", "enum": ["PUT", "POST"], "default": "PUT" }, "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "expires_at": { "type": "string", "format": "date-time" } } }, "CompleteUploadRequest": { "type": "object", "required": ["upload_id"], "properties": { "upload_id": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/Model" } } }, "OnboardCamera": { "type": "object", "properties": { "device_id": { "type": "integer", "format": "int64" }, "camera_id": { "type": "integer", "format": "int64" }, "camera_type": { "type": "string" }, "camera_name": { "type": "string" }, "device_dir": { "type": "string" }, "width": { "type": "integer" }, "height": { "type": "integer" } } }, "EdgeModelConfig": { "type": "object", "properties": { "model_id": { "type": "integer", "format": "int64" }, "model_name": { "type": "string" }, "config_exists": { "type": "boolean" }, "token_validated": { "type": "boolean" }, "device_registered":{ "type": "boolean" }, "model_optimized": { "type": "boolean" }, "model_category": { "type": "string" }, "model_type": { "type": "string" }, "model_version": { "type": "string" }, "encryption": { "type": "boolean" }, "input_shape": { "type": "array", "items": { "type": "integer" } }, "number_of_classes":{ "type": "integer" }, "conf_threshold": { "type": "number" }, "edge_device": { "type": "string" }, "labels": { "type": "array", "items": { "type": "string" } }, "model_conversion_type": { "type": "string" } } }, "Edge": { "type": "object", "required": ["id", "ip", "port", "edge_type"], "properties": { "id": { "type": "integer", "format": "int64", "readOnly": true }, "ip": { "type": "string" }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "serial_number": { "type": "string" }, "name": { "type": "string" }, "firmware_version": { "type": "string" }, "edge_type": { "type": "string", "examples": ["ANSOpenEdge"] }, "deployment_date": { "type": "string", "format": "date-time" }, "onboard_cameras": { "type": "array", "items": { "$ref": "#/components/schemas/OnboardCamera" } }, "onboard_video_files": { "type": "array", "items": { "type": "string" } }, "onboard_digital_triggers": { "type": "array", "items": { "type": "string" } }, "onboard_http_triggers": { "type": "array", "items": { "type": "string" } }, "model_configs": { "type": "array", "items": { "$ref": "#/components/schemas/EdgeModelConfig" } }, "active": { "type": "boolean", "default": true } } }, "EdgeCreate": { "$ref": "#/components/schemas/Edge" }, "EdgeUpdate": { "type": "object", "properties": { "ip": { "type": "string" }, "port": { "type": "integer" }, "name": { "type": "string" }, "firmware_version": { "type": "string" }, "active": { "type": "boolean" } } }, "EdgeList": { "allOf": [ { "$ref": "#/components/schemas/PaginationMeta" }, { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Edge" } } }} ] }, "EdgeHealth": { "type": "object", "properties": { "reachable": { "type": "boolean" }, "uptime_seconds": { "type": "integer" }, "cpu_percent": { "type": "number" }, "gpu_percent": { "type": "number" }, "memory_percent": { "type": "number" }, "disk_percent": { "type": "number" }, "temperature_c": { "type": "number" }, "checked_at": { "type": "string", "format": "date-time" } } }, "EdgeStatus": { "type": "object", "properties": { "state": { "type": "string", "enum": ["online", "offline", "degraded", "updating"] }, "active_tasks": { "type": "integer" }, "active_cameras": { "type": "integer" }, "events_last_hour": { "type": "integer" }, "last_seen_at": { "type": "string", "format": "date-time" } } }, "ROI": { "type": "object", "description": "Polygon ROI as ordered (x,y) points.", "required": ["points"], "properties": { "name": { "type": "string" }, "points": { "type": "array", "items": { "type": "object", "required": ["x","y"], "properties": { "x": { "type": "integer" }, "y": { "type": "integer" } } }} } }, "FilterOptions": { "type": "object", "properties": { "iou_threshold": { "type": "number", "minimum": 0, "maximum": 1 }, "camera_roi": { "$ref": "#/components/schemas/ROI" }, "camera_roi_enabled": { "type": "boolean" }, "image_compress": { "type": "boolean" }, "image_compress_type": { "type": "string" } } }, "ObjectRef": { "type": "object", "required": ["model_id", "class"], "properties": { "model_id": { "type": "integer", "format": "int64" }, "class": { "type": "integer" } } }, "RuleConfig": { "type": "object", "description": "Replaces the legacy stringified `RuleConfig` field. Fully typed.", "properties": { "presence_type": { "type": "string", "enum": ["object_appearing", "object_disappearing", "object_static"] }, "duration_limit_enabled": { "type": "boolean" }, "duration_comparison": { "type": "string", "enum": ["<", "<=", "==", ">=", ">"] }, "duration_seconds": { "type": "number" }, "duration_max_seconds": { "type": "number" }, "min_count": { "type": "integer", "default": 1 }, "max_records": { "type": "integer", "default": 1 }, "trigger_option": { "type": "string" }, "include_all_images": { "type": "boolean" } } }, "TriggerActionConfig": { "type": "object", "description": "Per-trigger-type configuration. Replaces the legacy stringified `TriggerConfig` field. Use the discriminator `type` to select the right payload subset.", "required": ["type"], "properties": { "type": { "type": "string", "enum": ["http", "mqtt", "email", "sms", "push", "rabbitmq", "pulsar", "digital_io"] }, "http": { "type": "object", "properties": { "url": { "type": "string", "format": "uri" }, "method": { "type": "string", "enum": ["GET","POST","PUT","PATCH"], "default": "POST" }, "append_image": { "type": "boolean", "default": false }, "style": { "type": "string", "enum": ["standard", "form", "raw"], "default": "standard" }, "extra_json": { "type": "object", "additionalProperties": true }, "simple_text": { "type": "string" }, "login": { "type": "object", "properties": { "required": { "type": "boolean", "default": false }, "login_url": { "type": "string", "format": "uri" }, "login_data": { "type": "object", "additionalProperties": true }, "token_type_name": { "type": "string" }, "token_name": { "type": "string" } } } } }, "mqtt": { "type": "object", "properties": { "broker_url": { "type": "string" }, "topic": { "type": "string" }, "qos": { "type": "integer", "enum": [0,1,2], "default": 1 }, "username": { "type": "string" }, "password": { "type": "string", "format": "password" } } }, "email": { "type": "object", "properties": { "smtp_host": { "type": "string" }, "smtp_port": { "type": "integer" }, "from": { "type": "string", "format": "email" }, "to": { "type": "array", "items": { "type": "string", "format": "email" } }, "subject": { "type": "string" }, "body": { "type": "string" } } }, "rabbitmq": { "type": "object", "properties": { "url": { "type": "string" }, "exchange": { "type": "string" }, "routing_key": { "type": "string" }, "durable": { "type": "boolean", "default": true } } }, "pulsar": { "type": "object", "properties": { "service_url": { "type": "string" }, "topic": { "type": "string" }, "token": { "type": "string" } } } } }, "TriggerAction": { "type": "object", "required": ["name", "type", "config"], "properties": { "id": { "type": "integer", "format": "int64", "readOnly": true }, "name": { "type": "string" }, "type": { "type": "string", "enum": ["http", "mqtt", "email", "sms", "push", "rabbitmq", "pulsar", "digital_io"] }, "config": { "$ref": "#/components/schemas/TriggerActionConfig" } } }, "Rule": { "type": "object", "required": ["join_condition", "rule_type", "objects"], "properties": { "join_condition": { "type": "string", "enum": ["AND", "OR"] }, "rule_type": { "type": "string", "enum": ["presence", "inclusive", "exclusive", "count", "loitering", "crossing", "abandoned"] }, "objects": { "type": "array", "items": { "$ref": "#/components/schemas/ObjectRef" } }, "rois": { "type": "array", "items": { "$ref": "#/components/schemas/ROI" } }, "config": { "$ref": "#/components/schemas/RuleConfig" }, "pipeline_option":{ "type": "string", "enum": ["no_pipeline", "pipeline_after"] }, "pipeline_filters": { "type": "object", "properties": { "texts": { "type": "array", "items": { "type": "string" } }, "and": { "type": "boolean" }, "option": { "type": "string" } } }, "license_plate_group_filter": { "type": "object", "properties": { "groups": { "type": "array", "items": { "type": "string" } }, "option": { "type": "string", "enum": ["all", "any", "none"] } } }, "monitoring_time_seconds": { "type": "number", "default": 0 } } }, "EventTimeSchedule": { "type": "object", "properties": { "days": { "type": "object", "properties": { "mon": { "type": "boolean", "default": true }, "tue": { "type": "boolean", "default": true }, "wed": { "type": "boolean", "default": true }, "thu": { "type": "boolean", "default": true }, "fri": { "type": "boolean", "default": true }, "sat": { "type": "boolean", "default": true }, "sun": { "type": "boolean", "default": true } } }, "start_time_seconds": { "type": "integer", "minimum": 0, "maximum": 86400 }, "end_time_seconds": { "type": "integer", "minimum": 0, "maximum": 86400 } } }, "DGEvent": { "type": "object", "required": ["event_name", "camera_id", "rules"], "properties": { "event_name": { "type": "string" }, "camera_id": { "type": "integer", "format": "int64" }, "onboard_camera_id": { "type": "integer" }, "rules": { "type": "array", "items": { "$ref": "#/components/schemas/Rule" } }, "deactivation_seconds": { "type": "number", "default": 0 }, "trigger_actions": { "type": "array", "items": { "$ref": "#/components/schemas/TriggerAction" } }, "vision_post_processes":{ "type": "array", "items": { "type": "object", "additionalProperties": true } }, "time_schedule": { "$ref": "#/components/schemas/EventTimeSchedule" }, "post_processing": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "save_images": { "type": "boolean", "default": true }, "image_series": { "type": "object", "properties": { "enabled": { "type": "boolean", "default": false }, "images_before": { "type": "integer", "default": 0 }, "images_after": { "type": "integer", "default": 0 } } } } }, "TrackerSettings": { "type": "object", "properties": { "tracker": { "type": "string", "enum": ["none", "simple", "ans_tracker", "bytetrack", "deepsort"] }, "time_to_remember_seconds": { "type": "number", "default": 0 }, "class_groups": { "type": "array", "items": { "type": "object", "properties": { "classes": { "type": "array", "items": { "$ref": "#/components/schemas/ObjectRef" } } } } } } }, "DGModelConfig": { "type": "object", "required": ["id", "model_type"], "properties": { "id": { "type": "integer", "format": "int64" }, "model_type": { "type": "string" }, "config": { "type": "object", "description": "Replaces the legacy stringified `ModelConfigJson`.", "properties": { "filter_categories": { "type": "array", "items": { "type": "integer" } }, "minimum_score": { "type": "number", "minimum": 0, "maximum": 1 }, "tracking": { "type": "boolean" } } }, "share_module": { "type": "boolean", "default": false }, "custom_settings":{ "type": "object", "additionalProperties": true } } }, "DeploymentGroup": { "type": "object", "required": ["id", "name", "camera_ids", "model_configs"], "properties": { "id": { "type": "integer", "format": "int64", "readOnly": true }, "name": { "type": "string" }, "camera_ids": { "type": "array", "items": { "type": "integer" } }, "onboard_camera_indexes": { "type": "array", "items": { "type": "integer" } }, "model_configs": { "type": "array", "items": { "$ref": "#/components/schemas/DGModelConfig" } }, "device_id": { "type": "integer", "description": "0 for server PC" }, "active": { "type": "boolean", "default": true }, "simulate": { "type": "boolean", "default": false }, "ai_task": { "type": "boolean", "default": false }, "tracking": { "type": "boolean", "default": false }, "filter_options": { "$ref": "#/components/schemas/FilterOptions" }, "face_recognition":{ "type": "boolean", "default": false }, "events": { "type": "array", "items": { "$ref": "#/components/schemas/DGEvent" } }, "image_data_interval_seconds": { "type": "number", "default": 0.5 }, "vision_settings": { "type": "object", "properties": { "pre_processing": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "main_processing": { "type": "array", "items": { "type": "object", "additionalProperties": true } } } }, "image_process_configs": { "type": "array", "items": { "type": "object", "properties": { "camera_id": { "type": "integer" }, "configs": { "type": "array", "items": { "type": "object", "additionalProperties": true } } } } }, "tracker_settings": { "$ref": "#/components/schemas/TrackerSettings" }, "buffer_size": { "type": "integer", "default": 0 }, "periodic_triggers":{ "type": "array", "items": { "type": "object", "additionalProperties": true } }, "execution_time_seconds": { "type": "number" }, "min_object_width": { "type": "integer" }, "min_object_height": { "type": "integer" }, "class_cleanup": { "type": "object", "properties": { "class_checker_active": { "type": "boolean", "default": false }, "duplicate_object_remover_active": { "type": "boolean", "default": false }, "remove_threshold_iou_percent": { "type": "number" }, "debug_attributes": { "type": "boolean", "default": false } } }, "input_trigger_config": { "type": "object", "properties": { "config_type": { "type": "string", "enum": ["periodic", "external"] }, "monitor_duration_seconds":{ "type": "number" }, "execution_rate_seconds": { "type": "number" }, "run_in_background": { "type": "boolean", "default": false }, "enabled": { "type": "boolean", "default": false } } } } }, "DeploymentGroupList": { "allOf": [ { "$ref": "#/components/schemas/PaginationMeta" }, { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/DeploymentGroup" } } }} ] }, "DeploymentGroupStatus": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "state": { "type": "string", "enum": ["stopped", "starting", "running", "stopping", "errored"] }, "active_since": { "type": "string", "format": "date-time", "nullable": true }, "fps": { "type": "number" }, "events_last_hour": { "type": "integer" }, "last_event_at": { "type": "string", "format": "date-time", "nullable": true }, "error_message": { "type": "string", "nullable": true } } }, "AITaskType": { "type": "object", "properties": { "name": { "type": "string" }, "category": { "type": "string" }, "description": { "type": "string" }, "default_parameters": { "type": "array", "items": { "$ref": "#/components/schemas/ParameterConfig" } } } }, "ParameterConfig": { "type": "object", "properties": { "name": { "type": "string" }, "data_type": { "type": "string", "enum": ["integer","number","string","boolean","list_single","list_multiple"] }, "decimals": { "type": "integer" }, "min_value": { "type": "number" }, "max_value": { "type": "number" }, "default_value": { "type": "string" }, "list_items": { "type": "array", "items": { "type": "string" } } } }, "ROIValue": { "type": "object", "properties": { "roi_match": { "type": "string", "enum": ["centre_point", "bottom_centre", "full_overlap"] }, "points": { "type": "array", "items": { "type": "object", "required": ["x","y"], "properties": { "x": { "type": "integer" }, "y": { "type": "integer" } } }}, "option": { "type": "string", "examples": ["both_directions"] }, "name": { "type": "string" } } }, "TriggerSchedule": { "type": "object", "properties": { "days": { "type": "object", "properties": { "mon": { "type": "boolean" }, "tue": { "type": "boolean" }, "wed": { "type": "boolean" }, "thu": { "type": "boolean" }, "fri": { "type": "boolean" }, "sat": { "type": "boolean" }, "sun": { "type": "boolean" } } }, "start_time_seconds": { "type": "integer", "minimum": 0, "maximum": 86400 }, "end_time_seconds": { "type": "integer", "minimum": 0, "maximum": 86400 } } }, "AITask": { "type": "object", "required": ["id", "name", "task_type", "camera_id"], "properties": { "id": { "type": "integer", "format": "int64", "readOnly": true }, "name": { "type": "string" }, "task_type": { "type": "string", "examples": ["Vehicle Counting"] }, "camera_id": { "type": "integer", "format": "int64" }, "roi_values": { "type": "array", "items": { "$ref": "#/components/schemas/ROIValue" } }, "parameter_configs": { "type": "array", "items": { "$ref": "#/components/schemas/ParameterConfig" } }, "parameter_values": { "type": "array", "items": { "type": "string" } }, "trigger_values": { "type": "array", "items": { "type": "string" } }, "trigger_schedule": { "$ref": "#/components/schemas/TriggerSchedule" }, "auto_start": { "type": "boolean", "default": true } } }, "AITaskCreate": { "type": "object", "required": ["name", "task_type", "camera_id"], "properties": { "name": { "type": "string" }, "task_type": { "type": "string" }, "camera_id": { "type": "integer", "format": "int64" }, "roi_values": { "type": "array", "items": { "$ref": "#/components/schemas/ROIValue" } }, "parameter_values": { "type": "array", "items": { "type": "string" } }, "trigger_values": { "type": "array", "items": { "type": "string" } }, "trigger_schedule": { "$ref": "#/components/schemas/TriggerSchedule" }, "auto_start": { "type": "boolean" } } }, "AITaskList": { "allOf": [ { "$ref": "#/components/schemas/PaginationMeta" }, { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/AITask" } } }} ] }, "AITaskStatus": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "state": { "type": "string", "enum": ["stopped", "starting", "running", "stopping", "errored"] }, "fps": { "type": "number" }, "started_at": { "type": "string", "format": "date-time", "nullable": true }, "last_event_at": { "type": "string", "format": "date-time", "nullable": true }, "error_message": { "type": "string", "nullable": true } } }, "EventRecord": { "type": "object", "required": ["id", "task_id", "camera_id", "timestamp"], "properties": { "id": { "type": "string", "examples": ["20240621_191241-3"] }, "task_id": { "type": "integer", "format": "int64" }, "camera_id": { "type": "integer", "format": "int64" }, "task_type": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "object": { "type": "string", "examples": ["car"] }, "score": { "type": "number", "minimum": 0, "maximum": 1 }, "bbox": { "type": "object", "properties": { "x": { "type": "integer" }, "y": { "type": "integer" }, "w": { "type": "integer" }, "h": { "type": "integer" } } }, "track_id": { "type": "integer", "nullable": true }, "metadata": { "type": "object", "additionalProperties": true }, "image_url": { "type": "string", "format": "uri", "nullable": true }, "clip_url": { "type": "string", "format": "uri", "nullable": true } } }, "EventList": { "allOf": [ { "$ref": "#/components/schemas/PaginationMeta" }, { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/EventRecord" } } }} ] }, "EventSummary": { "type": "object", "properties": { "task_id": { "type": "integer" }, "camera_id": { "type": "integer" }, "group_by": { "type": "string", "enum": ["objects", "hour", "day", "rule"] }, "interval": { "type": "string", "enum": ["minutes", "hours", "days"] }, "buckets": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "from": { "type": "string", "format": "date-time" }, "to": { "type": "string", "format": "date-time" }, "count": { "type": "integer" }, "breakdown": { "type": "object", "additionalProperties": { "type": "integer" } } } } } } }, "FRPerson": { "type": "object", "required": ["id", "name"], "properties": { "id": { "type": "integer", "format": "int64", "readOnly": true }, "name": { "type": "string" }, "code": { "type": "string" }, "group_ids": { "type": "array", "items": { "type": "integer" } }, "group_names":{ "type": "array", "items": { "type": "string" } }, "face_count": { "type": "integer", "readOnly": true }, "created_at": { "type": "string", "format": "date-time", "readOnly": true } } }, "FRPersonCreate": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string" }, "code": { "type": "string" }, "group_ids": { "type": "array", "items": { "type": "integer" } }, "group_names":{ "type": "array", "items": { "type": "string" } } } }, "FRPersonList": { "allOf": [ { "$ref": "#/components/schemas/PaginationMeta" }, { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/FRPerson" } } }} ] }, "FRPersonGroup": { "type": "object", "required": ["id", "name"], "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "description": { "type": "string" }, "person_ids": { "type": "array", "items": { "type": "integer" } } } }, "FRFace": { "type": "object", "required": ["id", "person_id"], "properties": { "id": { "type": "integer", "format": "int64" }, "person_id": { "type": "integer", "format": "int64" }, "image_url": { "type": "string", "format": "uri" }, "quality": { "type": "number" }, "captured_at":{ "type": "string", "format": "date-time" } } }, "FRFaceList": { "allOf": [ { "$ref": "#/components/schemas/PaginationMeta" }, { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/FRFace" } } }} ] }, "FRConfig": { "type": "object", "properties": { "known_person_threshold": { "type": "number", "minimum": 0, "maximum": 1 }, "age_gender": { "type": "boolean" }, "emotions": { "type": "boolean" }, "head_pose": { "type": "boolean" }, "min_face_size_px": { "type": "integer" } } }, "FRRecordingTaskCreate": { "type": "object", "required": ["camera_id"], "properties": { "camera_id": { "type": "integer", "format": "int64" }, "min_face_score": { "type": "number", "minimum": 0, "maximum": 1, "default": 0.5 }, "max_faces_per_id": { "type": "integer", "default": 0 }, "start_time": { "type": "string", "format": "date-time" }, "stop_time": { "type": "string", "format": "date-time" }, "max_faces_to_record": { "type": "integer", "default": 10 }, "min_face_size_px": { "type": "integer", "default": 50 } } }, "FRRecordingTask": { "allOf": [ { "$ref": "#/components/schemas/FRRecordingTaskCreate" }, { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "readOnly": true }, "state": { "type": "string", "enum": ["created", "running", "stopped", "completed", "errored"] }, "faces_recorded": { "type": "integer", "readOnly": true }, "created_at": { "type": "string", "format": "date-time", "readOnly": true } }} ] }, "FRRecordingFace": { "type": "object", "properties": { "face_id": { "type": "integer" }, "task_id": { "type": "integer" }, "image_url": { "type": "string", "format": "uri" }, "score": { "type": "number" }, "captured_at": { "type": "string", "format": "date-time" }, "assigned_person_id": { "type": "integer", "nullable": true }, "assigned_person_name":{ "type": "string", "nullable": true } } }, "FRRecordingFaceAssign": { "type": "object", "required": ["face_ids"], "properties": { "face_ids": { "type": "array", "items": { "type": "integer" } }, "person_id": { "type": "integer", "nullable": true }, "person_name":{ "type": "string", "nullable": true } } }, "ALPRPlate": { "type": "object", "required": ["plate"], "properties": { "plate": { "type": "string" }, "groups": { "type": "array", "items": { "type": "string" } }, "created_at": { "type": "string", "format": "date-time", "readOnly": true } } }, "ALPRPlateList": { "allOf": [ { "$ref": "#/components/schemas/PaginationMeta" }, { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/ALPRPlate" } } }} ] }, "ALPRPlateRegisterRequest": { "type": "object", "required": ["plates"], "properties": { "plates": { "type": "array", "items": { "type": "string" } }, "groups": { "type": "array", "items": { "type": "string" } } } }, "ALPRPlateGroup": { "type": "object", "required": ["id", "name"], "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "description": { "type": "string" } } }, "NotificationRecipient": { "type": "object", "required": ["id", "name"], "properties": { "id": { "type": "integer", "format": "int64", "readOnly": true }, "name": { "type": "string" }, "phone_number": { "type": "string" }, "email": { "type": "string", "format": "email" }, "group": { "type": "string" } } }, "NotificationRecipientCreate": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string" }, "phone_number": { "type": "string" }, "email": { "type": "string", "format": "email" }, "group": { "type": "string" } } }, "NotificationRecipientList": { "allOf": [ { "$ref": "#/components/schemas/PaginationMeta" }, { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/NotificationRecipient" } } }} ] }, "TriggerTestRequest": { "type": "object", "required": ["type", "config"], "properties": { "type": { "type": "string", "enum": ["http", "mqtt", "email", "sms", "push", "rabbitmq", "pulsar"] }, "config": { "$ref": "#/components/schemas/TriggerActionConfig" }, "payload": { "type": "object", "additionalProperties": true } } }, "TriggerTestResponse": { "type": "object", "properties": { "success": { "type": "boolean" }, "status_code": { "type": "integer", "nullable": true }, "latency_ms": { "type": "integer" }, "response_body":{ "type": "string", "nullable": true }, "error": { "$ref": "#/components/schemas/Problem", "nullable": true } } }, "SystemStatus": { "type": "object", "properties": { "ok": { "type": "boolean" }, "service": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "message": { "type": "string" } } }, "SystemHealth": { "type": "object", "properties": { "ok": { "type": "boolean" }, "uptime_seconds": { "type": "integer" }, "cpu_percent": { "type": "number" }, "memory_percent": { "type": "number" }, "gpu_percent": { "type": "number" }, "disk_percent": { "type": "number" }, "active_cameras": { "type": "integer" }, "active_ai_tasks": { "type": "integer" }, "events_last_hour": { "type": "integer" } } }, "SystemInfo": { "type": "object", "properties": { "hostname": { "type": "string" }, "os": { "type": "string" }, "arch": { "type": "string" }, "cpu": { "type": "string" }, "gpu": { "type": "string" }, "memory_gb": { "type": "number" }, "disk_gb": { "type": "number" } } }, "SystemVersion": { "type": "object", "properties": { "version": { "type": "string" }, "build_date": { "type": "string", "format": "date-time" }, "git_commit": { "type": "string" }, "api_version": { "type": "string", "default": "v1" } } }, "SystemLogEntry": { "type": "object", "properties": { "timestamp": { "type": "string", "format": "date-time" }, "level": { "type": "string", "enum": ["debug", "info", "warn", "error", "fatal"] }, "logger": { "type": "string" }, "message": { "type": "string" }, "context": { "type": "object", "additionalProperties": true } } }, "SystemLogList": { "allOf": [ { "$ref": "#/components/schemas/PaginationMeta" }, { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/SystemLogEntry" } } }} ] }, "SystemUpdateStatus": { "type": "object", "properties": { "available": { "type": "boolean" }, "current_version":{ "type": "string" }, "latest_version":{ "type": "string" }, "state": { "type": "string", "enum": ["idle", "downloading", "installing", "succeeded", "failed"] }, "progress": { "type": "number", "minimum": 0, "maximum": 1 } } }, "CameraWithTasksRequest": { "type": "object", "required": ["camera"], "properties": { "camera": { "$ref": "#/components/schemas/CameraCreate" }, "deployment_groups": { "type": "array", "items": { "$ref": "#/components/schemas/DeploymentGroup" } } } }, "CameraWithTasksResponse": { "type": "object", "properties": { "camera": { "$ref": "#/components/schemas/Camera" }, "deployment_groups": { "type": "array", "items": { "$ref": "#/components/schemas/DeploymentGroup" } } } } }, "responses": { "BadRequest": { "description": "Bad request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }, "Unauthorized": { "description": "Missing/invalid token", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }, "Forbidden": { "description": "Forbidden", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }, "NotFound": { "description": "Resource not found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }, "Conflict": { "description": "Conflict", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }, "Validation": { "description": "Validation failed", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }, "ServerError": { "description": "Server error", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }, "NoContent": { "description": "Deleted / no content" } } }, "paths": { "/auth/login": { "post": { "tags": ["auth"], "summary": "Log in", "security": [], "description": "Replaces: `POST /user/Login`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginResponse" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "422": { "$ref": "#/components/responses/Validation" } } } }, "/auth/logout": { "post": { "tags": ["auth"], "summary": "Invalidate the current token", "responses": { "204": { "$ref": "#/components/responses/NoContent" }, "401": { "$ref": "#/components/responses/Unauthorized" } } } }, "/auth/refresh": { "post": { "tags": ["auth"], "summary": "Exchange refresh token for new access token", "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RefreshRequest" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginResponse" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } } }, "/users": { "get": { "tags": ["users"], "summary": "List users", "description": "Replaces: `GET /user/GetUsers`.", "parameters": [{ "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }, { "$ref": "#/components/parameters/Sort" }], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserList" } } } } } }, "post": { "tags": ["users"], "summary": "Create user", "description": "Replaces (create half of): `POST /user/EditUser`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserCreate" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "409": { "$ref": "#/components/responses/Conflict" }, "422": { "$ref": "#/components/responses/Validation" } } } }, "/users/{id}": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["users"], "summary": "Get user", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "patch": { "tags": ["users"], "summary": "Update user", "description": "Replaces (update half of): `POST /user/EditUser`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserUpdate" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "404": { "$ref": "#/components/responses/NotFound" }, "422": { "$ref": "#/components/responses/Validation" } } }, "delete": { "tags": ["users"], "summary": "Delete user", "description": "Replaces: `POST /user/DeleteUser`.", "responses": { "204": { "$ref": "#/components/responses/NoContent" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/cameras": { "get": { "tags": ["cameras"], "summary": "List cameras", "description": "Replaces: `GET /Camera` (list mode).", "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }, { "$ref": "#/components/parameters/Sort" }, { "name": "driver", "in": "query", "schema": { "type": "string" } }, { "name": "active", "in": "query", "schema": { "type": "boolean" } }, { "name": "edge_id", "in": "query", "schema": { "type": "integer" } }, { "name": "deployment_group_id", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CameraList" } } } } } }, "post": { "tags": ["cameras"], "summary": "Create camera", "description": "Replaces (create half of): `POST /Camera`. Note that `Parameters(json)` is no longer a stringified blob — credentials are nested.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CameraCreate" }, "examples": { "rtsp": { "value": { "name": "Front gate", "driver": "rtsp", "address": "rtsp://192.168.1.87:554/h264Preview_01_main", "credentials": { "username": "root", "password": "admin123" }, "capturing": { "mode": "timer", "time_interval_seconds": 0.1 }, "active": true }}, "simulated_video": { "value": { "name": "Sim", "driver": "simulated_video", "address": "video_still.mp4", "capturing": { "mode": "timer", "time_interval_seconds": 0.05 } }} } }}}, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Camera" } } }, "headers": { "Location": { "schema": { "type": "string" } } } }, "422": { "$ref": "#/components/responses/Validation" } } } }, "/cameras/{id}": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["cameras"], "summary": "Get camera", "description": "Replaces: `GET /Camera?{id}`.", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Camera" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "put": { "tags": ["cameras"], "summary": "Replace camera", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CameraUpdate" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Camera" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "patch": { "tags": ["cameras"], "summary": "Patch camera", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CameraUpdate" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Camera" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "tags": ["cameras"], "summary": "Delete camera", "description": "Replaces: `DELETE /Camera?{id}` and `POST /delete/Camera?{id}`.", "responses": { "204": { "$ref": "#/components/responses/NoContent" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/cameras/{id}/snapshot": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["cameras"], "summary": "Get a still snapshot from a camera", "description": "Replaces: `GET /GetCameraImage?id={id}` and `POST /GetCameraImage?id={id}`. Returns the image bytes directly; pass `?format=url` to receive a short-lived presigned URL instead.", "parameters": [ { "name": "width", "in": "query", "schema": { "type": "integer" } }, { "name": "format", "in": "query", "schema": { "type": "string", "enum": ["jpeg", "url"], "default": "jpeg" } } ], "responses": { "200": { "description": "Image bytes (or `{url}` when format=url)", "content": { "image/jpeg": { "schema": { "type": "string", "format": "binary" } }, "application/json": { "schema": { "type": "object", "properties": { "url": { "type": "string" }, "expires_at": { "type": "string", "format": "date-time" } } } } }}, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/cameras/{id}/liveview": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["cameras"], "summary": "Get a liveview stream descriptor", "description": "New endpoint. Returns the URL + transport + short-lived auth token that the UI uses to connect to the live stream (HLS in v1, WebRTC later).", "parameters": [ { "name": "transport", "in": "query", "schema": { "type": "string", "enum": ["auto", "hls", "rtsp", "webrtc"], "default": "auto" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LiveviewDescriptor" } } } } } } }, "/cameras/scan": { "post": { "tags": ["cameras"], "summary": "Discover cameras on a network (ONVIF)", "description": "Replaces: `GET /ScanCameras`. Async — returns a job acknowledgement; poll `GET /jobs/{id}` for results.", "requestBody": { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CameraScanRequest" } } } }, "responses": { "202": { "description": "Accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JobAck" } } } } } } }, "/cameras/probe": { "post": { "tags": ["cameras"], "summary": "Probe a camera for its ONVIF profiles", "description": "Replaces: `POST /GetCameraProfiles`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CameraProbeRequest" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/CameraProfile" } } } } } } } }, "/models": { "get": { "tags": ["models"], "summary": "List models", "description": "Replaces: `GET /Model`.", "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }, { "name": "model_type", "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelList" } } } } } }, "post": { "tags": ["models"], "summary": "Upload + register a model (multipart)", "description": "Replaces: `POST /Model?{id}` (multipart). For files >100 MB use `/models:initiate-upload` instead.", "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": ["file", "metadata"], "properties": { "file": { "type": "string", "format": "binary" }, "metadata": { "$ref": "#/components/schemas/Model" } } } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Model" } } } }, "422": { "$ref": "#/components/responses/Validation" } } } }, "/models/{id}": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["models"], "summary": "Get model", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Model" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "patch": { "tags": ["models"], "summary": "Update model metadata (not the binary)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelUpdate" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Model" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "tags": ["models"], "summary": "Delete model", "description": "Replaces: `DELETE /Model?{id}` and `POST /delete/Model?{id}`.", "responses": { "204": { "$ref": "#/components/responses/NoContent" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/models:initiate-upload": { "post": { "tags": ["models"], "summary": "Begin a large-model upload (presigned URL)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InitiateUploadRequest" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InitiateUploadResponse" } } } } } } }, "/models:complete-upload": { "post": { "tags": ["models"], "summary": "Finalize a large-model upload", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompleteUploadRequest" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Model" } } } } } } }, "/edges": { "get": { "tags": ["edges"], "summary": "List edge devices", "description": "Replaces: `GET /Edge`.", "parameters": [{ "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EdgeList" } } } } } }, "post": { "tags": ["edges"], "summary": "Register an edge device", "description": "Replaces (create half of): `POST /Edge`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EdgeCreate" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Edge" } } } } } } }, "/edges/{id}": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["edges"], "summary": "Get edge", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Edge" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "patch": { "tags": ["edges"], "summary": "Update edge", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EdgeUpdate" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Edge" } } } } } }, "delete": { "tags": ["edges"], "summary": "Delete edge", "description": "Replaces: `DELETE /Edge?{id}` and `POST /delete/Edge?{id}`.", "responses": { "204": { "$ref": "#/components/responses/NoContent" } } } }, "/edges/{id}/health": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["edges"], "summary": "Get edge health metrics", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EdgeHealth" } } } } } } }, "/edges/{id}/status": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["edges"], "summary": "Get edge operational status", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EdgeStatus" } } } } } } }, "/deployment-groups": { "get": { "tags": ["deployment-groups"], "summary": "List deployment groups", "description": "Replaces: `GET /DeploymentGroup`.", "parameters": [{ "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }, { "name": "active", "in": "query", "schema": { "type": "boolean" } }], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeploymentGroupList" } } } } } }, "post": { "tags": ["deployment-groups"], "summary": "Create deployment group", "description": "Replaces (create half of): `POST /DeploymentGroup`. All previously stringified JSON fields (`RuleConfig`, `TriggerConfig`, `ModelConfigJson`, `Config`) are now typed nested objects.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeploymentGroup" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeploymentGroup" } } } } } } }, "/deployment-groups/{id}": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["deployment-groups"], "summary": "Get deployment group", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeploymentGroup" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "put": { "tags": ["deployment-groups"], "summary": "Replace deployment group", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeploymentGroup" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeploymentGroup" } } } } } }, "delete": { "tags": ["deployment-groups"], "summary": "Delete deployment group", "description": "Replaces: `DELETE /DeploymentGroup?{id}` and `POST /delete/DeploymentGroup?{id}`.", "responses": { "204": { "$ref": "#/components/responses/NoContent" } } } }, "/deployment-groups/{id}/status": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["deployment-groups"], "summary": "Get runtime status", "description": "Replaces: `GET /DeploymentGroupStatus?{id}`.", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeploymentGroupStatus" } } } } } } }, "/deployment-groups/{id}/start": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "post": { "tags": ["deployment-groups"], "summary": "Start deployment group", "description": "Replaces: `GET /DeploymentGroupControl?{id}&state=start`.", "responses": { "202": { "description": "Accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeploymentGroupStatus" } } } } } } }, "/deployment-groups/{id}/stop": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "post": { "tags": ["deployment-groups"], "summary": "Stop deployment group", "description": "Replaces: `GET /DeploymentGroupControl?{id}&state=stop`.", "responses": { "202": { "description": "Accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeploymentGroupStatus" } } } } } } }, "/ai-tasks": { "get": { "tags": ["ai-tasks"], "summary": "List AI tasks", "description": "Replaces: `GET /AI-Task`.", "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }, { "name": "camera_id", "in": "query", "schema": { "type": "integer" } }, { "name": "task_type", "in": "query", "schema": { "type": "string" } }, { "name": "active", "in": "query", "schema": { "type": "boolean" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AITaskList" } } } } } }, "post": { "tags": ["ai-tasks"], "summary": "Create AI task", "description": "Replaces (create half of): `POST /AI-Task`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AITaskCreate" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AITask" } } } } } } }, "/ai-tasks/{id}": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["ai-tasks"], "summary": "Get AI task", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AITask" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "put": { "tags": ["ai-tasks"], "summary": "Replace AI task", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AITaskCreate" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AITask" } } } } } }, "patch": { "tags": ["ai-tasks"], "summary": "Partially update AI task", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AITaskCreate" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AITask" } } } } } }, "delete": { "tags": ["ai-tasks"], "summary": "Delete AI task", "description": "Replaces: `DELETE /AI-Task?{id}` and `POST /delete/AI-Task?{id}`.", "responses": { "204": { "$ref": "#/components/responses/NoContent" } } } }, "/ai-tasks/{id}/status": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["ai-tasks"], "summary": "Get task status", "description": "Replaces: `GET /GetAITaskStatus` (single-task case).", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AITaskStatus" } } } } } } }, "/ai-tasks/{id}/start": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "post": { "tags": ["ai-tasks"], "summary": "Start task", "description": "Replaces: `GET /ControlAITask?ID={id}&State=true`.", "responses": { "202": { "description": "Accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AITaskStatus" } } } } } } }, "/ai-tasks/{id}/stop": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "post": { "tags": ["ai-tasks"], "summary": "Stop task", "description": "Replaces: `GET /ControlAITask?ID={id}&State=false`.", "responses": { "202": { "description": "Accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AITaskStatus" } } } } } } }, "/ai-tasks/{id}/liveview": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["ai-tasks"], "summary": "Get a liveview descriptor for the annotated stream", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LiveviewDescriptor" } } } } } } }, "/ai-tasks/catalog": { "get": { "tags": ["ai-tasks"], "summary": "List supported AI task types", "description": "Replaces: `GET /GetSupportedAiTasks`.", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/AITaskType" } } } } } } } }, "/events": { "get": { "tags": ["events"], "summary": "List events", "description": "Replaces: `POST /event/Get` (with body filter). All filters are now query params and the method is idempotent GET.", "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }, { "name": "task_id", "in": "query", "schema": { "type": "integer" } }, { "name": "camera_id", "in": "query", "schema": { "type": "integer" } }, { "name": "task_type", "in": "query", "schema": { "type": "string" } }, { "name": "object", "in": "query", "schema": { "type": "string" } }, { "name": "from", "in": "query", "schema": { "type": "string", "format": "date-time" } }, { "name": "to", "in": "query", "schema": { "type": "string", "format": "date-time" } }, { "name": "include_images", "in": "query", "schema": { "type": "boolean", "default": false } }, { "name": "image_width", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventList" } } } } } } }, "/events/summary": { "get": { "tags": ["events"], "summary": "Event rollup / analytics", "description": "Replaces: `POST /event/GetSummary`.", "parameters": [ { "name": "task_id", "in": "query", "schema": { "type": "integer" } }, { "name": "camera_id", "in": "query", "schema": { "type": "integer" } }, { "name": "task_type", "in": "query", "schema": { "type": "string" } }, { "name": "from", "in": "query", "schema": { "type": "string", "format": "date-time" } }, { "name": "to", "in": "query", "schema": { "type": "string", "format": "date-time" } }, { "name": "days", "in": "query", "schema": { "type": "integer", "description": "Convenience: last N days" } }, { "name": "group_by", "in": "query", "schema": { "type": "string", "enum": ["objects","hour","day","rule"] } }, { "name": "interval", "in": "query", "schema": { "type": "string", "enum": ["minutes","hours","days"], "default": "hours" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventSummary" } } } } } } }, "/events/stream": { "get": { "tags": ["events"], "summary": "Live event tail (Server-Sent Events)", "description": "New endpoint. Returns `text/event-stream`. Each event is a JSON `EventRecord`. Pass filter query params to scope the stream.", "parameters": [ { "name": "task_id", "in": "query", "schema": { "type": "integer" } }, { "name": "camera_id", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Stream", "content": { "text/event-stream": { "schema": { "type": "string" } } } } } } }, "/events/{id}": { "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], "get": { "tags": ["events"], "summary": "Get a single event", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventRecord" } } } } } } }, "/events/{id}/image": { "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], "get": { "tags": ["events"], "summary": "Get the evidence image", "description": "Replaces: `GET /event/GetImage?ID={id}&ImageWidth=…`.", "parameters": [{ "name": "width", "in": "query", "schema": { "type": "integer" } }], "responses": { "200": { "description": "Image bytes", "content": { "image/jpeg": { "schema": { "type": "string", "format": "binary" } } } } } } }, "/events/{id}/clip": { "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], "get": { "tags": ["events"], "summary": "Get a presigned URL for the evidence video clip", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "url": { "type": "string" }, "expires_at": { "type": "string", "format": "date-time" } } } } } } } } }, "/fr/persons": { "get": { "tags": ["fr"], "summary": "List FR persons", "description": "Replaces: `GET /FR/User`. Renamed `User` to `Person` to disambiguate from system users.", "parameters": [{ "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRPersonList" } } } } } }, "post":{ "tags": ["fr"], "summary": "Create FR person", "description": "Replaces (create half of): `POST /FR/User`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRPersonCreate" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRPerson" } } } } } } }, "/fr/persons/{id}": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["fr"], "summary": "Get FR person", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRPerson" } } } } } }, "patch": { "tags": ["fr"], "summary": "Update FR person", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRPersonCreate" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRPerson" } } } } } }, "delete":{ "tags": ["fr"], "summary": "Delete FR person", "description": "Replaces: `POST /FR/DeleteUser?{id}`.", "responses": { "204": { "$ref": "#/components/responses/NoContent" } } } }, "/fr/persons/{id}/faces": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["fr"], "summary": "List faces for a person", "description": "Replaces: `GET /FR/GetFaces` (filtered by person).", "parameters": [{ "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRFaceList" } } } } } }, "post":{ "tags": ["fr"], "summary": "Add a face to a person (multipart upload, no base64)", "description": "Replaces: `POST /FR/AddFace` (which used base64 inside JSON). Now uses `multipart/form-data`.", "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": ["image"], "properties": { "image": { "type": "string", "format": "binary" }, "quality_min": { "type": "number" } } } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRFace" } } } } } } }, "/fr/faces/{face_id}": { "parameters": [{ "name": "face_id", "in": "path", "required": true, "schema": { "type": "integer" } }], "delete": { "tags": ["fr"], "summary": "Delete a face", "description": "Replaces: `POST /FR/DeleteFace`.", "responses": { "204": { "$ref": "#/components/responses/NoContent" } } } }, "/fr/person-groups": { "get": { "tags": ["fr"], "summary": "List FR person groups", "description": "Replaces: `GET /FR/UserGroup`.", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/FRPersonGroup" } } } } } } }, "post":{ "tags": ["fr"], "summary": "Create person group", "description": "Replaces (create half of): `POST /FR/UserGroup`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRPersonGroup" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRPersonGroup" } } } } } } }, "/fr/person-groups/{id}": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "patch": { "tags": ["fr"], "summary": "Update person group", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRPersonGroup" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRPersonGroup" } } } } } }, "delete": { "tags": ["fr"], "summary": "Delete person group", "description": "Replaces: `POST /FR/DeleteUserGroup?{id}`.", "responses": { "204": { "$ref": "#/components/responses/NoContent" } } } }, "/fr/config": { "get": { "tags": ["fr"], "summary": "Get FR detection configuration", "description": "Replaces: `GET /FR/FaceDetectionConfiguration`.", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRConfig" } } } } } }, "patch": { "tags": ["fr"], "summary": "Update FR detection configuration", "description": "Replaces: `POST /FR/FaceDetectionConfiguration`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRConfig" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRConfig" } } } } } } }, "/fr/recording-tasks": { "get": { "tags": ["fr-recording"], "summary": "List face-recording tasks", "description": "Replaces: `GET /facerecording/ListTasks`.", "parameters": [{ "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/FRRecordingTask" } } } } } } }, "post": { "tags": ["fr-recording"], "summary": "Create face-recording task", "description": "Replaces: `POST /facerecording/CreateTask`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRRecordingTaskCreate" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRRecordingTask" } } } } } } }, "/fr/recording-tasks/{id}": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "delete": { "tags": ["fr-recording"], "summary": "Delete face-recording task", "description": "Replaces: `GET /facerecording/DeleteTask?{id}`.", "responses": { "204": { "$ref": "#/components/responses/NoContent" } } } }, "/fr/recording-tasks/{id}/start": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "post": { "tags": ["fr-recording"], "summary": "Start task", "description": "Replaces: `GET /facerecording/StartTask`.", "responses": { "202": { "description": "Accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRRecordingTask" } } } } } } }, "/fr/recording-tasks/{id}/stop": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "post": { "tags": ["fr-recording"], "summary": "Stop task", "description": "Replaces: `GET /facerecording/StopTask`.", "responses": { "202": { "description": "Accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRRecordingTask" } } } } } } }, "/fr/recording-tasks/{id}/faces": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "get": { "tags": ["fr-recording"], "summary": "Read recorded faces", "description": "Replaces: `POST /facerecording/ReadFaces`.", "parameters": [ { "name": "offset", "in": "query", "schema": { "type": "integer", "default": 0 } }, { "name": "limit", "in": "query", "schema": { "type": "integer", "default": 10 } }, { "name": "image_size", "in": "query", "schema": { "type": "integer", "default": 50 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/FRRecordingFace" } } } } } } }, "patch": { "tags": ["fr-recording"], "summary": "Assign recorded faces to a person (bulk)", "description": "Replaces: `POST /facerecording/UpdateFace`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FRRecordingFaceAssign" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/FRRecordingFace" } } } } } } } }, "/alpr/plates": { "get": { "tags": ["alpr"], "summary": "List registered plates", "description": "Replaces: `GET /ALPR/GetRegisteredLicensePlates`.", "parameters": [{ "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }, { "name": "group", "in": "query", "schema": { "type": "string" } }], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ALPRPlateList" } } } } } }, "post":{ "tags": ["alpr"], "summary": "Register plates (bulk)", "description": "Replaces: `POST /ALPR/RegisterLicensePlate`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ALPRPlateRegisterRequest" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ALPRPlate" } } } } } } } }, "/alpr/plates/{plate}": { "parameters": [{ "name": "plate", "in": "path", "required": true, "schema": { "type": "string" } }], "delete": { "tags": ["alpr"], "summary": "Deregister a single plate", "description": "Replaces (single case of): `POST /ALPR/DeregisterLicensePlate`.", "responses": { "204": { "$ref": "#/components/responses/NoContent" } } } }, "/alpr/plates:bulk-delete": { "post": { "tags": ["alpr"], "summary": "Deregister plates (bulk)", "description": "Replaces: `POST /ALPR/DeregisterLicensePlate` (bulk body).", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "array", "items": { "type": "string" } } } } }, "responses": { "204": { "$ref": "#/components/responses/NoContent" } } } }, "/alpr/plate-groups": { "get": { "tags": ["alpr"], "summary": "List plate groups", "description": "Replaces: `GET /ALPR/GetLicensePlateGroups`.", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ALPRPlateGroup" } } } } } } }, "post": { "tags": ["alpr"], "summary": "Create plate group", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ALPRPlateGroup" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ALPRPlateGroup" } } } } } } }, "/alpr/plate-groups/{id}": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "patch": { "tags": ["alpr"], "summary": "Update plate group", "description": "Replaces: `POST /ALPR/EditLicensePlateGroup`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ALPRPlateGroup" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ALPRPlateGroup" } } } } } }, "delete": { "tags": ["alpr"], "summary": "Delete plate group", "description": "Replaces: `POST /ALPR/DeleteLicensePlateGroup`.", "responses": { "204": { "$ref": "#/components/responses/NoContent" } } } }, "/notifications/recipients": { "get": { "tags": ["notifications"], "summary": "List recipients", "description": "Replaces: `GET /notification/Recipient`.", "parameters": [{ "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationRecipientList" } } } } } }, "post": { "tags": ["notifications"], "summary": "Create recipient", "description": "Replaces (create half of): `POST /notification/Recipient`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationRecipientCreate" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationRecipient" } } } } } } }, "/notifications/recipients/{id}": { "parameters": [{ "$ref": "#/components/parameters/PathId" }], "patch": { "tags": ["notifications"], "summary": "Update recipient", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationRecipientCreate" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationRecipient" } } } } } }, "delete": { "tags": ["notifications"], "summary": "Delete recipient", "description": "Replaces: `POST /notification/DeleteRecipient?{id}`.", "responses": { "204": { "$ref": "#/components/responses/NoContent" } } } }, "/notifications/recipient-groups": { "get": { "tags": ["notifications"], "summary": "List recipient groups", "description": "Replaces: `GET /notification/RecipientGroups`.", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "description": { "type": "string" } } } } } } } } } }, "/triggers/types": { "get": { "tags": ["triggers"], "summary": "List supported trigger types and their config schemas", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "config_schema": { "type": "object", "additionalProperties": true } } } } } } } } } }, "/triggers/test": { "post": { "tags": ["triggers"], "summary": "Dispatch a test trigger", "description": "Replaces: `POST /Trigger`. Useful for validating a trigger configuration without firing a real AI event.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerTestRequest" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerTestResponse" } } } } } } }, "/system/status": { "get": { "tags": ["system"], "summary": "Quick liveness probe", "description": "Replaces: `GET /ViewStatus`, `GET /GetStatus`.", "security": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SystemStatus" } } } } } } }, "/system/health": { "get": { "tags": ["system"], "summary": "Server health snapshot (resources, counts)", "description": "Replaces: `GET /GetServerHealth`, `GET /GetServerHealthAndLogs`.", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SystemHealth" } } } } } } }, "/system/info": { "get": { "tags": ["system"], "summary": "Server / host info", "description": "Replaces: `GET /GetServerInfo`.", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SystemInfo" } } } } } } }, "/system/logs": { "get": { "tags": ["system"], "summary": "Paginated server logs", "description": "Replaces: `GET /GetServerLog`.", "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/PageSize" }, { "name": "from", "in": "query", "schema": { "type": "string", "format": "date-time" } }, { "name": "to", "in": "query", "schema": { "type": "string", "format": "date-time" } }, { "name": "level", "in": "query", "schema": { "type": "string", "enum": ["debug","info","warn","error","fatal"] } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SystemLogList" } } } } } } }, "/system/version": { "get": { "tags": ["system"], "summary": "Server version", "description": "Replaces: `GET /SW/GetSoftwareVersion`.", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SystemVersion" } } } } } } }, "/system/update": { "get": { "tags": ["system"], "summary": "Get update status", "description": "Replaces: `GET /SW/GetSoftwareUpdateStatus`.", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SystemUpdateStatus" } } } } } }, "post": { "tags": ["system"], "summary": "Trigger a software update", "description": "Replaces: `POST /SW/UpdateSoftwareVersion`.", "responses": { "202": { "description": "Accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JobAck" } } } } } } }, "/jobs/{id}": { "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], "get": { "tags": ["jobs"], "summary": "Get an async job's status / result", "description": "Used to poll scans, model uploads, deploys, and updates.", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Job" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/composite/camera-with-tasks": { "post": { "tags": ["composite"], "summary": "Create a camera and one or more deployment groups in one call", "description": "Replaces: `POST /CreateCameraAndTasks`. Convenience endpoint — primary CRUD on `/cameras` and `/deployment-groups` should still be preferred.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CameraWithTasksRequest" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CameraWithTasksResponse" } } } } } } } } }