{
  "openapi": "3.1.0",
  "info": {
    "title": "Vigiora API",
    "version": "1.129.0",
    "description": "The public, versioned API of a Vigiora server. Every path starts with `/api/v1`. Within v1 changes are additive\nonly: new operations, optional parameters and fields, response fields and error codes. Ignore response fields\nyou do not know.\n\n## Authentication\n\n* **API key** (`apiKey` or `apiKeyHeader`): `Authorization: Bearer vgk_…` or `X-API-Key: vgk_…`. Never in the\n  query string. Create keys with scopes in the web app or with `POST /api/v1/api-keys` (user session).\n* **User session** (`bearerJwt`): the access token from `POST /api/auth/login` in `Authorization: Bearer`. A\n  session has every scope; the user's role and camera permissions still apply.\n\nA call is allowed only if the key's scopes **and** its user's role **and** the user's permission on the camera\nallow it. Each operation lists its scope (`x-vigiora-scopes`, also given as the security requirement's scope\nlist), roles (`x-vigiora-roles`) and per-camera permission (`x-vigiora-camera-permission`: `viewer` <\n`operator` < `manager`).\n\nScopes: `cameras:read`, `cameras:write`, `cameras:control`, `alerts:read`, `alerts:write`, `analytics:read`,\n`analytics:write`, `floorplans:read`, `floorplans:write`, `recordings:read`,\n`recordings:write`, `clips:share`, `guardian:read`, `guardian:write`, `memory:read`, `memory:write`, `account:read`, `account:write`, `settings:read`, `settings:write`,\n`users:read`, `users:write`, `events:read`, `webhooks:read`, `webhooks:write`, `network:read`, `devices:read`,\n`devices:write`, `devices:control`, `admin`. `<x>:write` (and `cameras:control`, `devices:control`) imply the matching\n`:read`; `admin` implies every scope. `clips:share` (public links) is implied by no other scope but `admin`.\n`admin`, `users:*`, `settings:write` and `webhooks:*` can be granted only to admins' keys; `cameras:write`,\n`cameras:control`, `analytics:write`, `floorplans:write` and `devices:*` (Home Assistant devices) not to viewers' keys (their operations need the admin or operator role). `network:read` (LAN\ndiscovery) is admin or operator only too; it reads, but scanning sends traffic on the LAN, so it is part of no\nread-only access (legacy read-only keys, OAuth \"Read only\") and only of OAuth \"Read and control\".\n\nKeys created before scopes existed (\"legacy keys\", `scoped: false`) work here with implicit scopes: read-only\nkeys get `cameras:read alerts:read recordings:read guardian:read memory:read settings:read`; read-write keys also get\n`cameras:write cameras:control alerts:write recordings:write guardian:write`, plus `settings:write` when the\nkey's user is an admin. Scoped keys work on\n`/api/v1` only. Failed key attempts are throttled per client IP (`429 rate_limited`). A long response opened\nwith a key (video) ends when the key is revoked.\n\n## Conventions\n\n* JSON properties and query parameters are `snake_case`. Request bodies are JSON; unknown fields are refused\n  (`400 validation_error`).\n* Times are RFC 3339 in UTC on output (`2026-10-30T14:05:00Z`, fractional seconds when present). Inputs need an\n  explicit offset, except the Analytics `from` and `to`, which also take local times in the server's time zone.\n* Ids are integers, except clip ids, network scan ids and PTZ preset tokens (strings). Treat them as opaque.\n* Optional values are present as `null`, never omitted.\n* `PATCH` changes only the fields sent. Actions are `POST …/actions/<verb>`. `PUT` is not used.\n* Something you may not view answers `404 not_found`; `403` means you can see it but may not do this.\n\n## Pagination\n\nLists answer `{\"data\": [...], \"next_cursor\": \"…\"}`. Pass `?cursor=<next_cursor>` with the same filters to get the\nnext page; `next_cursor` is `null` on the last page. `?limit=` is 1–200 (default 50). Cursors are opaque and\nbound to the endpoint and filters (`400 invalid_cursor` otherwise). They are not signed and carry no\nauthority: visibility is applied again on every page, so an edited cursor can only skip rows, never reveal\nany. Do not parse them; their format may change.\n\n## Errors\n\nEvery error is `{\"error\": {\"code\", \"message\", \"details\"}}`. `code` is stable (see `ErrorCode`), `message` is\nfor humans, `details` is an object whose keys depend on the code (for example `required_scope` and\n`granted_scopes` for `insufficient_scope`, `field` for `validation_error`, `retry_after_seconds` for 429s,\n`request_id` for `internal_error`).\n\n## Idempotency\n\nOperations marked `x-vigiora-idempotent: true` honour `Idempotency-Key` (1–255 printable ASCII characters).\nThe first response is stored for 24 hours per credential and replayed for a retry of the same request, with\n`Idempotent-Replayed: true`. A replay of a success re-checks your current access to the resource (camera,\nalert or clip) first. Stored responses hold no secrets (camera credentials are always redacted). At most 10,000\nresponses are kept per credential; past that the oldest are dropped and their keys run again. The same key with a different request is `422 idempotency_key_reused`; while the\nfirst request runs, `409 idempotency_key_in_progress`. Server errors (5xx) are not stored. Operations whose\nresponse carries a one-time secret (`x-vigiora-idempotent: unsupported`) refuse the header\n(`400 idempotency_not_supported`).\n\n## Rate limits\n\nEach credential (API key, or user for sessions) has a token bucket of 120 requests refilled at 10 per second.\nResponses carry `RateLimit-Limit` and `RateLimit-Remaining`; a refusal is `429 rate_limited` with\n`Retry-After`.\n\n## Events\n\nEvery event is `{\"id\", \"type\", \"time\", \"camera_id\", \"data\"}`. `id` is a ULID (26 characters, ordered by time).\n`data` is small and never holds secrets. Types (an open set; ignore unknown ones), with the scope needed besides\n`events:read`: `alert.created`, `alert.acknowledged`, `alert.unacknowledged` (`alerts:read`; their `data`\nhas `external` and `source`: `true` and the reporting system for alerts from `POST /alerts`, `false` and `null`\nfor the server's own; `has_snapshot` since 1.17.0); `guardian.event` (`guardian:read`; since 1.17.0 its `data`\nalso has `has_frame`, `has_clip`, `detections` (`[{label, count, max_confidence, tracks}]` from the camera's\ndetectors during the entry), `detector_checked`, `person_present_seconds` and `person_present` (`true`/`false`,\n`null` when no detector could tell), so no extra `GET /guardian/entries/{id}` is needed; since 1.97.0 also\n`trigger` (`motion` or `detection`) and `trigger_label` (the detector label that started it, else `null`));\n`motion.started`, `motion.ended` (`cameras:read`, API 1.17.0: real motion from the motion detector, debounced:\n`started` on the first motion, `ended` after 30 s without any, with `started_at`, `last_motion_at` and\n`duration_seconds`); `presence.changed` (`cameras:read`, API 1.17.0: a detector's presence report says `label`\n(`person`) came into (`present: true`) or left (`false`) the camera's view; `reason` is `detector`, or\n`detector_silent` when the detector stopped reporting while someone was in view);\n`camera.online`, `camera.offline` (camera health, not viewing: `offline` when a recording camera stops writing\nsegments or a camera that does not record stops answering on its stream port, `online` when it recovers;\n`standby` ↔ `online` emits nothing; `data.status` is `live`, `standby` or `idle`), `camera.moved`, `ptz.moved`\n(`cameras:read`); `recording.started`,\n`recording.stopped`, `clip.ready`, `clip.failed` (`recordings:read`); `settings.changed` (`settings:read`);\n`webhook.disabled` (`webhooks:read`); `config.exported` (`settings:read`, admins); `user.created`,\n`user.updated`, `user.deleted` (`users:read`, admins; `data.fields` names the changed fields, never values);\n`alert_rule.created`, `alert_rule.updated`, `alert_rule.deleted` (`alerts:read`: an alert rule changed through\nAPI v1; `data.kind` is `guardian` (a Guardian rule, `data.alert_rule_id`) or `label` (a label alert rule,\n`data.label_alert_rule_id` and `data.label`); `data.fields` names the changed fields, never values);\n`network.camera_found` (`network:read`, admins and operators: automatic scanning found a device that looks like a\ncamera and is not one yet; `data` has `mac`, `ip`, `vendor`, `confidence`, `wizard_ready`, `reasons`, `onvif`,\n`rtsp_open`, `open_ports`, `first_seen`, `hint` and `hint_code`; announced once as a possible camera and once when it becomes\nwizard-ready); `device.state_changed` (`devices:read`, admins and operators, API 1.25.0: a Home Assistant device\nexposed to Vigiora changed; `data` has `thing_id`, `entity_id`, `instance_id`, `instance_name` (API 1.29.0), `name`, `source`, `capability`, `state` (the\ncapability's state), `ha_state`, `previous_ha_state` and `area`; sensor values at most every 10 s);\n`bay.occupied`, `bay.freed` (`analytics:read`, API 1.30.0: a parking bay (an analytics zone of kind `bay`) was\ntaken or became free; `data` has `zone_id`, `zone_name`, `class` (the vehicle), `since` (when the stay began) and\n`at`); `bluetooth.device_found` (`devices:read`, admins and operators, API 1.42.0: a Bluetooth scan saw a device\nfor the first time; `data` has `address`, `address_type`, `random_address`, `name`, `manufacturer`, `kind`,\n`label`, `confidence`, `rssi` and `first_seen_at`; never the note); `plan.applied` (`settings:read`, admins and\noperators, API 1.88.1: a paid plan cart was applied, in full or in part, once the licence covered it; `data` has\n`cart_id`, `status`, `applied` and `skipped` (`[{service, camera_ids}]`)); `robot.wifi_motion` (`cameras:read`, API\n1.124.0: a robot's Wi-Fi movement sensor started to see movement, at most once a minute per robot; `data` has `at`,\n`score` and `threshold`); `robot.nav.started`, `robot.nav.arrived`, `robot.nav.ended`, `robot.place.learned` (`cameras:read`, API 1.129.0: robot navigation; `data` has `kind`, `place_id` and `place_name`, plus `reason` and `message` on `robot.nav.ended`; `robot.place.learned` has `place_id`, `name` and `needs_name`)). **Snapshot links** (API 1.17.0): on the stream and the list, `alert.created` with a snapshot,\n`guardian.event` with a frame, `motion.started`, `presence.changed` (present) and `camera.online` carry\n`data.snapshot_url` and `data.snapshot_url_expires_at`: a signed link (relative to the server's base URL, valid\n15 minutes, minted for the reader and revoked with its key) to the alert's snapshot, the entry's frame or a live\nsnapshot, so an image can be shown without sending the API key. Webhook bodies have no links.\nEvents about a camera reach only callers who may view it; clip events only\ntheir owner (and admins); events with no camera only admins (or the one user they are for). Ids are assigned in\npublication order. The log keeps 7 days.\n\n**Stream** (`GET /api/v1/events/stream`, Server-Sent Events): each event is sent as `id: <id>`,\n`event: <type>`, `data: <JSON event>`. Resume with the `Last-Event-ID` header (EventSource does this by itself)\nor `?last_event_id=`; every event after it is replayed first (recent ones from memory, older ones from the log),\nso nothing published while you were reconnecting is missed. Other frames: a `: heartbeat` comment\nevery 15 s; `event: overflow` (`{\"dropped\": n}`) when this stream fell behind and lost events (reconnect with\n`Last-Event-ID` to fetch them from the log); `event: reset` when `Last-Event-ID` is older than the log; `event:\nshutdown` when the server stops. A stream lasts about a minute (the server's request timeout) and then ends\ncleanly; reconnect with `Last-Event-ID` (the `retry` hint is 1 s). Camera permissions are re-checked every 15 s\nand a revoked key ends its stream within 30 s. At most 3 open streams per credential and 200 per server\n(`429 stream_limit`).\n\n## Things\n\n`GET /api/v1/things` lists devices (\"things\": `server`, `camera`, `microphone`, `speaker`, `room`, `area`,\n`external`), each\nwith a stable `id` (`camera:12`), name, parent, site, rooms, online state and capabilities with their current\nstate. The capability vocabulary is closed and versioned (`GET /api/v1/thing-capabilities`, catalogue `1.0`):\n`video_stream`, `snapshot`, `motion`, `presence`, `object_detection`, `alert`, `recording`, `ai_guardian`,\n`ai_mode`, `ptz`, `speak`, `describe`, `detect_objects`, `occupancy`, `counter`, `device`; each has a state\nschema, commands (each runs one existing operation: its scope, role, camera permission and human-in-the-loop\nclass apply) and events. `POST /api/v1/things/{thing_id}/commands/{capability}.{command}` runs a command.\n`GET /api/v1/events/stream?format=things` sends every event as\n`{specversion, id, source, type: \"vigiora.<capability>.<event>\", subject: <thing id>, time, datacontenttype,\ndataschema, data, vigioracapability, vigioracatalogversion, vigioraeventtype}`. It is an adapter over the\noperations above, not a separate API: everything else stays as it is. Spec: docs/integrations/things-model.md.\n\n**Home Assistant devices** (API 1.25.0, catalogue `1.1`): the Home Assistant entities an admin exposed to Vigiora\n(`/api/v1/integrations/home-assistant/...`) are things too: kind `external`, `source: home-assistant`, id\n`ha:<device key>`, with the capabilities `contact`, `motion`, `presence` (`occupied`), `onoff`, `brightness`,\n`light`, `cover`, `number`, `select`, `button` (API 1.47.0), `lock`, `alarm_mode`, `siren`, `value` and `notify` mapped from their domain and device class. Their commands run\n`commandHomeAssistantDevice` (`devices:control`, confirm-class; a lock, alarm panel or siren always asks the\nperson through MCP) and their changes are `vigiora.<capability>.changed` events. Listing them needs\n`devices:read` (admins and operators).\n\n**Several Home Assistant instances** (API 1.29.0): a server may use several Home Assistants (one per site,\n`/api/v1/integrations/home-assistant/instances`). Entity ids are unique only within an instance, so a device is\nnamed by its **device key**: the entity id for instance 1 (`light.porch`) and `<instance_id>:<entity_id>`\notherwise (`2:light.porch`). Thing ids are `ha:<device key>`; `{entity_id}` path parameters accept a device key;\ndevices, entities, triggers, rule actions, log entries and pending actions carry `instance_id` and\n`instance_name`. The single-instance endpoints (`/bridge`, `/entities`) act on instance 1.\n\n**Analytics phase 2** (API 1.30.0, after the Home Assistant instances of 1.29.0): queue zones and their waits\n(`/analytics/queues`), the busy hours of the week, crossing speeds on calibrated cameras, paths and flows,\nparking bays (`/analytics/bays`, events `bay.occupied` and `bay.freed`), analytics alert rules\n(`/analytics/alert-rules`) and their firings (`/analytics/alert-events`), and door displays\n(`/analytics/displays`); `GET /server` lists the features `analytics_queues`, `analytics_bays`,\n`analytics_alerts` and `analytics_display`.\n\n**Camera catalogue** (API 1.31.0): the server embeds the Vigiora camera catalogue (brands, their stream URL\ntemplates, login advice and MAC prefixes; common models and whether they stream locally; data CC BY-SA 4.0).\n`GET /cameras/catalog?q=` searches it and `GET /cameras/catalog/brands` lists its brands; network devices\n(`NetworkDevice.catalog`) and camera detections (`CameraDetection.catalog`) say what it recognised; a detection\ntakes the picked `model`; a camera it knows has no local stream (Ring, Arlo, Nest, …) fails with\n`no_local_stream`; `GET /server` gives `camera_catalog_version` and the feature `camera_catalog`.\n\n**Floor plans from a description** (API 1.32.0): a site without a plan image is described in words and the AI\ndraws a schematic plan with the cameras placed (`describeFloorPlan`), changed by later instructions\n(`refineFloorPlan`, one-level `undoFloorPlanLayout`); plans carry `source` (`upload` or `ai`) and\n`getFloorPlanLayout` returns the layout. `GET /server` lists the feature `floor_plan_describe`.\n\n**Described floor plans, second pass** (API 1.33.0): areas no longer overlap (the server asks the AI once more and\nthen repairs the plan itself), sizes stated in the description are kept, and each layout camera says the area it is\n`mounted_on` and the areas it `looks_at`, from which the server works out its position and heading (plus optional\n`wall`, `facing`, `mention` and `pinned`). When the site has fewer cameras than the description mentions, your other\ncameras are offered too (placing one on the plan does not change its site); `unplaced_cameras` of an undo is the\nrestored layout's.\n\n**Described floor plans, fourth pass** (API 1.33.1): each layout area may carry `size_m` (`[w, h]` in metres) and\n`relations` (`{to, kind}`: `behind`, `in_front_of`, `left_of`, `right_of`, `north_of`, `south_of`, `east_of`,\n`west_of`, `next_to`, `inside`, `across`), taken from the description; the server lays the areas out from them\n(sides read from the front, the lane or road side) instead of trusting the AI's coordinates. A refine keeps the\nrelations, sizes and camera fields of everything the instruction does not mention.\n\n**Faces: the face itself, and \"Not a face\"** (API 1.33.2): a pending face carries `has_crop` and `bbox`: the\ncamera's face runner sends the face crop with the detection (`getFaceCrop` serves it; `getFacePhoto` is still the\nwhole frame with the box drawn) and the box's place in that frame. `deleteFace` also takes a pending face\n(`det-<alert id>`): its alert goes; with `not_a_face=true` the camera's face runner also ignores that spot for an\nhour.\n\n**AI availability** (API 1.34.2): `getServer` carries `ai` (`status` ok | degraded | unavailable, `reason`, `since`,\n`retry_at`, `first_failure_at`, `resumes_at`, `route`). When the AI provider refuses calls (its account out of credit: `provider_402`; rate-limiting:\n`provider_429`; failing: `provider_5xx`) the server pauses every AI feature at once instead of retrying, probes the\nprovider again at `retry_at`, and resumes by itself. When the account's monthly Vigiora AI allowance is used up\n(`allowance_used`, API 1.113.0) AI is back at `resumes_at` or when AI is added to more cameras. Meanwhile an AI operation (`chat`, `describeCamera`,\n`composeView`, `describeFloorPlan`, …) answers `503 ai_unavailable` with `details.reason` and `details.retry_at`.\n\n**Readable transcripts** (API 1.35.0): `getCameraTranscript` lists the speech-to-text segments of a camera or\nmicrophone in a window (oldest first; the client joins them into passages), `translateTranscript` renders the\npassages you give it in another language and `summarizeTranscript` sums up the last minutes or hours of speech\nin 2–4 sentences, both one AI call charged like a Guardian chat (feature keys `transcript_translate`,\n`transcript_summarize`). `GET /server` lists the feature `transcript_translate`.\n\n**Device controls and settings** (API 1.47.0): every entity of an IoT device carries `control`, a description a\nclient renders as a widget or a form: `kind` (light, switch, cover, lock, alarm, siren, number, select, button,\nsensor_numeric, sensor_state, binary, text, readonly), `role` (`control` an everyday control, `setting` a device\nsetting — Home Assistant's entity_category config —, `reading`, `diagnostic`), `primary` (the entity that stands\nfor its device on a tile; also the device's `primary`), `fields` (type, writable, current value, min, max, step,\nunit, options) and `commands`. A light's entity also has `light` (on, brightness, colour modes, colour, white\ncolour temperature and its range). `setIoTDeviceEntity` changes an entity with field values (a light's on,\nbrightness_pct, rgb and color_temp_kelvin in one call) or a command (cover open/close/stop, button press, lock\nlock/unlock), checked against the description and mapped to one Home Assistant service; the entity must be shared\nwith \"Read + control\" (`409 not_controllable`). Home Assistant covers, numbers, selects and buttons are supported\ndevices now, with the things capabilities `light`, `cover`, `number`, `select` and `button`.\n\n## Webhooks\n\nAdmins subscribe URLs to event types (and cameras) with `/api/v1/webhooks`. Each matching event is POSTed as the\nevent JSON with headers `X-Vigiora-Event` (type), `X-Vigiora-Delivery` (delivery id), `X-Vigiora-Timestamp`\n(Unix seconds) and `X-Vigiora-Signature: sha256=<hex HMAC-SHA256(secret, timestamp + \".\" + raw body)>`.\nVerify with a constant-time compare and refuse timestamps more than 5 minutes old. Test vector: secret\n`whsec_example`, timestamp `1793439000`, body\n`{\"id\":\"01JBXK6P3ZQ8R4V2M7N9T5W1YA\",\"type\":\"webhook.test\",\"time\":\"2026-10-31T09:30:00Z\",\"camera_id\":null,\"data\":{\"webhook_id\":1}}`\n→ `sha256=d3970ed3552b5ff43e5d2f309b492adc79512de73ce6b793568894f11b096312`.\n\nDelivery is **at least once**: deduplicate on the event `id` (a redelivery or a resend after a server restart\nhas a new `X-Vigiora-Delivery`). Under heavy database load the server may drop events for webhooks before a\ndelivery is queued (counted and logged); the event log (`GET /api/v1/events`) still has them, so reconcile from\nit if a gap matters. A webhook belongs to its admin, receives every camera's events of its types\n(including other users' `clip.*`), and outlives the API key that created it (it is deleted with its user).\n\nA 2xx answer within 10 s delivers; the answer's body is never read or stored. Otherwise the delivery is retried\n1 min, 5 min, 30 min, 2 h, 6 h and 12 h after each failure (7 attempts), never later than 24 h after the event;\nredirects are not followed; each webhook has at most one attempt in flight. The delivery log shows the status\ncode and a short error class (`timeout`, `refused`, `tls`, `dns`, `blocked`, `connection`, `http_error`), never\nthe receiver's answer. A webhook is disabled after it has failed for 24 h without a success, or after 20 failed\nattempts spread over at least 6 h (or at once on `410 Gone`); test sends never count. One `webhook.disabled`\nevent is emitted; pending deliveries are kept as `held` and resume when `PATCH enabled: true` re-enables it.\nAfter `rotate-secret`, deliveries carry two signatures for 24 h (`sha256=<new>,sha256=<old>`); accept either.\n\nURLs must be `https`. Private (LAN) addresses and plain `http` (LAN only) need `allow_insecure: true`, which only\nan admin session or an `admin`-scoped key may set. Always refused, whatever `allow_insecure` says: this server's\nown addresses (every interface, loopback, its container network), its service ports on private addresses,\nlink-local and cloud-metadata addresses, the mesh ranges, multicast, unspecified and reserved addresses, and the\nIPv6 forms that embed an IPv4 address. The name is resolved once per attempt and the connection is pinned to the\nchecked address (no DNS rebinding). The delivery log keeps 14 days.\n\n## AI agents: human in the loop\n\nAI agents on the MCP endpoint (`/api/v1/mcp`) ask the user before risky operations only while *human in the\nloop* (HITL) is on for their credential; when it is off they act directly. The server setting\n(`GET`/`PATCH /api/v1/settings/agents`, on by default) applies to every API key and connected app unless that\nkey or app overrides it: `inherit` (default), `on` or `off` (`PATCH /api/v1/api-keys/{key_id}`, or the web\napp's Connected apps). Admins change the server setting and any override; users change their own keys and\napps, and may choose `off` only while the server setting is off (such an `off` stops counting once an admin\nturns the server setting on). `GET /api/v1/agent-policy` reports the caller's effective policy and the\noperations that need approval: those marked `x-vigiora-confirm: true`, and those marked\n`x-vigiora-destructive: true` without `x-vigiora-confirm: false`.\n\nPlain REST calls are never prompted; the MCP endpoint enforces the policy. With HITL on, a confirm-class tool\ncall from a client that supports elicitation shows the user an Allow/Deny prompt and runs only when allowed\n(denied: tool error `user_declined`). Any other client gets the tool error `confirmation_required`: the agent\nmust ask the user and call again with `confirm: true`. Elicitation is the stronger mode (the person, not the\nmodel, answers), and is used whenever the client offers it, `confirm` or not. With HITL off, tools run at once\nand `confirm` is ignored.\n\nLimits: enforcement is per call, and the server can only trust what the client reports. A client that\nauto-accepts elicitation prompts, that does not declare the elicitation capability, or that speaks a protocol\nolder than 2026-07-28 (the sessionless endpoint cannot learn its capabilities or call it back) reaches the\n`confirm: true` path, where the agent itself relays the user's answer. Prompts show the action written by\nVigiora first; names an app or user chose (the app's own name, camera and user names) are quoted and shortened,\nupdates list the changed fields with their new values, and secrets and URL credentials are never shown.\n\n## Vendor extensions\n\n`x-vigiora-scopes` (the one scope required; `[]` = any credential; `[session]` = user sessions only),\n`x-vigiora-roles`, `x-vigiora-camera-permission`, `x-vigiora-idempotent` (`true`, `false`, `unsupported`),\n`x-vigiora-destructive` and `x-vigiora-read-only` (MCP tool hints when they differ from the method's),\n`x-vigiora-confirm` (`true`: AI agents need the user's approval while human in the loop is on; see above),\n`x-vigiora-mcp` (`false`: not offered as an MCP tool, for example binary images an assistant cannot use).\n"
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "tags": [
    {
      "name": "Me",
      "description": "The caller's identity and scopes."
    },
    {
      "name": "Cameras",
      "description": "Cameras (called monitors in the web app's internal API), live snapshots and AI switch."
    },
    {
      "name": "PTZ",
      "description": "Pan/tilt/zoom control. Every move is bounded in time; the server stops the camera at the end."
    },
    {
      "name": "Robot navigation",
      "description": "API 1.129.0. A robot camera remembers places (room level) and drives to a named one, or home, with the Robot navigation add-on (hal-robotnav, a GPU runner). Paths sit under /cameras/{camera_id}/robot."
    },
    {
      "name": "Alerts",
      "description": "Detections and alerts. `is_alert` marks a label promoted by the camera's alert rules."
    },
    {
      "name": "Analytics",
      "description": "People and vehicle counts, occupancy, dwell and heatmaps from the Vigiora Analytics add-on. API 1.30.0 adds queue zones and their waits (`/analytics/queues`), the busy hours of the week, crossing speeds on calibrated cameras (an estimate), paths and flows, parking bays (zones of kind `bay`, `/analytics/bays`, `bay.occupied` and `bay.freed` events), analytics alert rules with their firings, and door displays (a public page showing whether an area has room; its token is shown once). Zones gain `kind`, `queue_min_wait_sec`, `reserved_schedule` and `max_stay_min`, cameras a `calibration`, areas `open_hours`, and occupancy the source `bays`."
    },
    {
      "name": "Floor plans",
      "description": "Floor plans per site with the cameras, speakers, rooms and analytics areas placed on them, their live state and plain-language descriptions of where each camera is. Anyone who can see a site sees its plans (items they cannot see left out); editing needs the admin role, or the admin or operator role with manager level on the site."
    },
    {
      "name": "Views",
      "description": "AI views (API 1.34.0): the user says what they want to check (\"entrance and driveway live, plus today's alerts\") and the AI composes a view: cards (live video, alerts, people counts, heatmaps, occupancy, queues, parking, a floor plan, transcripts, recordings, faces, plates) on the cameras it resolves from the request, in a grid. The server gives the model a catalogue of what the caller can see, matches the names it answers with, drops what a camera cannot show and caps the cards at 12. Views are per user: recent ones are kept (the 30 last opened), pinned ones for good."
    },
    {
      "name": "Faces",
      "description": "Recognised faces (enrolled and pending) and their photos."
    },
    {
      "name": "Recordings",
      "description": "Recorded segments, coverage timeline and playback."
    },
    {
      "name": "Clips",
      "description": "Clip exports (MP4 cut from recordings) and their public share links."
    },
    {
      "name": "Library",
      "description": "The media library (API 1.52.0): pictures and clips saved on the server, in folders, and albums (ordered lists of saved items). Kept until deleted; recording retention never removes them."
    },
    {
      "name": "Guardian",
      "description": "The Guardian log (what the AI saw and heard), its search, on-demand analysis and chat, and the speech transcript of a camera or microphone (its segments, translated passages and summaries)."
    },
    {
      "name": "Settings",
      "description": "Sites, rooms and layouts."
    },
    {
      "name": "System",
      "description": "Server status and health."
    },
    {
      "name": "Users",
      "description": "Users and permission groups. Admins only."
    },
    {
      "name": "Config",
      "description": "Configuration export and import (backup and restore). Admins only."
    },
    {
      "name": "API keys",
      "description": "Personal API keys with scopes. User sessions only."
    },
    {
      "name": "Events",
      "description": "The event log and live event stream."
    },
    {
      "name": "Webhooks",
      "description": "Signed event delivery to your URLs. Admins only."
    },
    {
      "name": "Automations",
      "description": "Rules drawn on a canvas: a trigger (a detection, a device changing, a camera going offline, a time of day, a web address, or by hand), conditions and actions (a notification, a device command, a light effect, a sound or siren, a PTZ preset, the AI guardian, an outgoing webhook, a wait). Admins and operators."
    },
    {
      "name": "Network",
      "description": "Discovery on the server's own LAN (self-hosted servers only): scan the directly connected private subnets for devices, open camera ports and ONVIF cameras, and resolve a MAC address to its current IP (DHCP addresses change; MACs do not). Only RFC 1918 subnets connected to a physical interface are ever probed (never CGNAT, public or link-local ranges), at most a /22 (1022 hosts) per scan, with TCP connects to an allowlist of ports (80, 443, 554, 8000, 8080, 8899, 9000, 34567, 37777) and one WS-Discovery multicast probe. Automatic camera following has priority on the LAN: while it sweeps, scans and lookup sweeps answer `503 network_busy` with `Retry-After` at once (and a running scan it interrupts ends `failed` with `error: busy…`); lookup sweeps also share a server-wide budget of 4 per 10 minutes (`503 network_busy`, `details.reason: lookup_budget`). When discovery cannot work here (hosted server, a container without host networking, no neighbour table on this OS, no private subnet) every operation answers `409 network_unavailable` with `details.reason` (`hosted`, `container_network` — a Docker/Podman bridge, Kubernetes pod, containerd or LXC container without host networking, or Docker Desktop —, `not_supported`, `no_lan`, `disabled`), never an empty result (except `GET /network/auto-scan`, which answers `available: false` with the reason). Automatic scanning (`/network/auto-scan`) runs these scans on a schedule and keeps the new camera candidates (`/network/candidates`). Admins and operators with `network:read`."
    },
    {
      "name": "Setup",
      "description": "The first-install setup wizard and the dashboard's Setup checklist: health checks with fixes, the checklist and the AI camera suggestion. Camera detection (connect with a login, streams found automatically) is under Cameras. The web app's wizard calls these with the admin's session once its account step signed the admin in."
    },
    {
      "name": "Alert rules",
      "description": "What raises alerts: Guardian alert rules (natural-language rules the AI checks each analysed clip and transcript against), label alert rules (which detector labels are alerts) and smart-motion rules (lines and zones). Rules only fire on cameras with AI (`ai_enabled`)."
    },
    {
      "name": "Briefing",
      "description": "The dashboard Briefing: what needs attention, the AI recap and the activity feed of the caller's cameras."
    },
    {
      "name": "AI Live",
      "description": "AI Live sessions on single cameras (rooms have their own under `/rooms/{room_id}/ai-live`)."
    },
    {
      "name": "Clients",
      "description": "vigiora-clients: the boxes on remote sites that relay their cameras to this server."
    },
    {
      "name": "Admin",
      "description": "Billing, costs, connected apps, enrolled AI service instances and external tools. User sessions only (never an API key), as in the web app."
    },
    {
      "name": "Things",
      "description": "A platform-neutral view for IoT platforms (Home Assistant, MQTT, Matter, Google Home, Alexa, SmartThings, HomeKit): devices with capabilities from a closed, versioned catalogue, commands that run the existing operations, and events in one CloudEvents-style envelope. See Things in the description."
    },
    {
      "name": "Media",
      "description": "Signed, short-lived media links (live video, images) for clients that cannot send an API key."
    },
    {
      "name": "Integrations",
      "description": "Home Assistant: install it next to this server (\"Install Home Assistant for me\"; Linux servers for now), with the Vigiora integration set up, or connect an existing one. Vigiora runs the pinned ghcr.io/home-assistant/home-assistant image (version and digest recorded by Vigiora) as the Docker container vigiora-homeassistant through a root helper that a person installs once with a command on the server; the web app never asks for the administrator password. Home Assistant is reachable on the LAN only. Install, update and uninstall need the user's approval for AI agents while human in the loop is on.\nMQTT (API 1.26.0): Vigiora publishes its Things to an MQTT broker (retained state per thing, every event in the Things envelope, Home Assistant MQTT discovery) and, when an admin allows control, runs Things commands sent to the command topic. Chat notifications (API 1.26.0): alert rules can send Telegram and LINE messages (`telegram_enabled`, `line_enabled`), with the entry's picture on Telegram; at most 20 messages a minute per service, the rest of a burst summarised. The broker password and the bot tokens are never returned.\nAdd camera flow (API 1.28.0): network scans also send the camera makers' discovery probes (Hikvision SADP, Dahua, SSDP, mDNS) and report each device's model, firmware and serial, whether it is on DHCP and, for a Hikvision, activated; a device answering from an address another device holds is marked `ip_conflict` and can be moved to DHCP from here (`POST /network/devices/actions/move-to-dhcp`, admins). Camera detection reports the device's facts (model, PTZ, microphone, speaker, audio track), the maker's login advice and a suggested name; `add-detected` can turn on object recognition and Core AI as it creates the camera."
    },
    {
      "name": "IoT devices",
      "description": "The IoT devices page (API 1.39.0): one list of every device Vigiora knows through Home Assistant — the bridge's devices and the Zigbee devices of the Home Assistant Vigiora installed, merged by Home Assistant device id — with search, filters, a detail with the data mapping (what Vigiora makes of each entity) and the settings (rename, rooms, cameras, exposure, Zigbee actions)."
    },
    {
      "name": "Bluetooth",
      "description": "Bluetooth nearby (API 1.42.0): the devices in range of the server's Bluetooth adapter (BLE and classic, through BlueZ), scanned once an hour and on demand, each with what it advertises, a classification and a report of the data it could provide and how Vigiora could use it. Advertisements only: nothing is ever paired or connected to."
    },
    {
      "name": "Loona",
      "description": "Loona pet robot (API 1.64.0, experimental, read-only): the server finds a Loona robot on the home network, keeps a session to it and reads its battery and version; it also appears on the IoT devices page (source `loona`). Off by default and dormant until an admin enables it and enters the KEYi account user id. Unofficial integration: it uses the vendor app's local protocol and may not be covered by the vendor's terms of service."
    },
    {
      "name": "PerceptionCoach",
      "description": "Perception Coach (API 1.68.0): a background service that audits each AI-guardian camera's prompt against the live frames and either rewrites it (blank prompt, or a camera that opted in) or records a suggestion an operator can apply. Off by default; uses AI credits within a daily cap. Every prompt change is kept in the camera's prompt history so the human prompt can be restored. Since 1.69.0 it also tunes each room's AI rules (`rooms.ai_rules`) the same way."
    },
    {
      "name": "Memory",
      "description": "What Vigiora remembers about the calling user (API 1.65.0): durable facts learned from their Guardian chats, which they can list, correct and delete. Every call is limited to the caller's own facts."
    },
    {
      "name": "Account",
      "description": "The caller's own sign-in security (API 1.107.0): two-factor sign-in with an authenticator app (status with `account:read`; turning it on or off and new recovery codes need a user session, never an API key) and the signed-in devices list (`account:read`, signing one out `account:write`). Every call is limited to the caller's own account. OAuth clients (MCP connections) are never granted the `account:*` scopes."
    },
    {
      "name": "Add-ons",
      "description": "Add-ons (API 1.104.0): the catalogue (Vigiora's own add-ons first, then the community's) with a hardware check against this server, the installed community add-ons with their progress, and install, update and remove. A community add-on runs in Docker on this server or on a remembered SSH machine, from the commit Vigiora reviewed, with an override the server writes (the author's compose file is never edited), and enrols with a token limited to its permissions. Paid community add-ons are listed but cannot be installed yet. Installing from a git address with no review (developer mode) is done from the web app only, as are add-ons asking for elevated access (both ask for the admin's password). Vigiora's built-in runners keep `/runners`. Alerts from add-ons (API 1.106.0): an add-on granted the `alerts:write` scope may report a detection through the HAL API (`POST /api/hal/events` with a `detection` object, not part of `/api/v1`), only on cameras it is assigned to, only on the label namespaces it declares in its manifest `labels` (`tamper:lens covered`), never a plain label or a namespace Vigiora owns (`face:`, `plate:`, `qr:`, `guardian:`, `analytics:` and others), without a picture, at most 30 a minute and 300 an hour. It is then an alert like any other: `GET /alerts`, `alert.created`, the camera's label alert rules and speakers. The alert's `addon` names the add-on; a camera label an add-on can only report as a result has `results_only: true`. Pictures (API 1.106.0): an add-on with `streams:read` gets one current frame of a camera it is assigned to from `GET /api/hal/frame` (HAL API, not part of `/api/v1`); go2rtc's RTSP restream is reachable only with host networking."
    },
    {
      "name": "Runners",
      "description": "GPU runners (API 1.60.0): the vision runners that run beside the server on a GPU machine (`runner-objects` finds any object, `runner-plates` reads number plates, `runner-face` recognises faces, `runner-vision` runs a LiquidAI vision model locally for the floor-plan scan, on a GPU or the CPU, `runner-robotnav` is the Robot navigation add-on for robot cameras, API 1.129.0). List them with the state of the on-device install and the runners that enrolled, and mint the one-time install token behind the copyable install command. The password-gated on-device install and the SSH install stay in the web app."
    },
    {
      "name": "Docs",
      "description": "This document."
    }
  ],
  "security": [
    {
      "apiKey": []
    },
    {
      "apiKeyHeader": []
    },
    {
      "bearerJwt": []
    }
  ],
  "paths": {
    "/api/v1/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Who am I",
        "description": "The authenticated user and the credential used, with its effective scopes (`null` for a session).",
        "tags": [
          "Me"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The caller.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/agent-policy": {
      "get": {
        "operationId": "getAgentPolicy",
        "summary": "Human-in-the-loop policy for AI agents",
        "description": "Whether AI agents using this credential must ask the user before risky operations (human in the loop), what decided it (`server`: the server setting; `api_key` or `connected_app`: this credential's override) and the operations that need approval while it is on. Informative on REST (REST calls are never prompted); the MCP endpoint enforces it.",
        "tags": [
          "Me"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The caller's effective policy.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentPolicy"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras": {
      "get": {
        "operationId": "listCameras",
        "summary": "List cameras",
        "description": "Cameras the caller may view, in the Monitors page order (`sort_order`, set with `POST /cameras/actions/reorder`), then the cameras never ordered by ascending id; until someone reorders, that is ascending id. Camera credentials in `stream_url` are always redacted. API 1.102.0 (the order).",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "enabled",
            "in": "query",
            "description": "Only enabled (`true`) or disabled (`false`) cameras.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "site_id",
            "in": "query",
            "description": "Only cameras of this site.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of cameras.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createCamera",
        "summary": "Add a camera",
        "description": "Adds an RTSP (or iframe) camera on this server's network, or a camera (`client_id`, optionally `remote_stream_name`) or USB microphone (`source_type: usb_audio`, `client_id`, `audio_device`) relayed by a vigiora-client (see `GET /cameras/available-streams`). New cameras get AI automatically while the plan allows it (see `ai_enabled`). `sub_stream_url` (same host as `stream_url`) adds the low-resolution stream live view and motion detection use; `onvif_url` sets the PTZ address by hand (same rules as on update); `hardware_id` records the camera's MAC (user sessions only, `403 api_key_not_allowed` otherwise; camera following sends the stream credentials to the device with that MAC). URLs pass the same source checks as the web app; credentials come back `REDACTED`.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CameraCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new camera.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Camera"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCamera",
        "summary": "Get a camera",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The camera.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Camera"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateCamera",
        "summary": "Update a camera",
        "description": "Changes only the fields sent. A `stream_url` (or `onvif_url`) read back with `REDACTED` markers keeps the stored credentials (a marked URL pointing at a different host is refused). `client_id` and `hardware_id` are user sessions only (`403 api_key_not_allowed`): they decide where the camera's credentials go. Per-service AI settings are under `/cameras/{camera_id}/ai-services`.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CameraUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated camera.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Camera"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteCamera",
        "summary": "Delete a camera",
        "description": "Deletes the camera and its recordings index; the owning vigiora-client drops it on its next heartbeat.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/enable": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "enableCamera",
        "summary": "Enable a camera",
        "description": "Starts streaming (and recording, if `recording_enabled`).",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The camera.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Camera"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/disable": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "disableCamera",
        "summary": "Disable a camera",
        "description": "Stops streaming and recording. Recorded footage is kept.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The camera.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Camera"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/enable-ai": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "enableCameraAI",
        "summary": "Switch AI on for a camera",
        "description": "Turns on the per-camera AI (detections, alerts, Guardian). Guardian looks at a camera when motion detection triggers it, so on a video camera without a motion trigger this also switches on the free `motion-detect` service; `services_enabled` lists what the call switched on, and `warnings` keeps `no_motion_trigger` when no trigger could be added. Past the plan's AI camera limit this is `402 limit_reached`; with `details.pending = true` the server is checking the plan and switches AI on by itself if it covers the camera.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The camera.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraAIResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/disable-ai": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "disableCameraAI",
        "summary": "Switch AI off for a camera",
        "description": "Refused with `409 dependent_service_assigned` while another AI service on the camera depends on it; motion detection stays on (motion recording and other services may use it); switch it off with `POST /cameras/{camera_id}/ai-services/motion-detect/actions/disable`.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The camera.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Camera"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/actions/bulk-update": {
      "post": {
        "operationId": "bulkUpdateCameras",
        "summary": "Change several cameras at once",
        "description": "Applies the same change (`enabled`, `recording_enabled`, `ai_enabled`) to up to 100 cameras, each with the rules of the single-camera operations (manager permission on the camera; the plan's AI camera limit). Each camera is reported separately: one failing does not undo the others, and the answer is `200` even when every camera failed. A camera whose AI is already in the requested state is left alone (and reported `ok`). Duplicate ids are reported once.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkCameraUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What happened to each camera.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkCameraUpdateResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/actions/reorder": {
      "post": {
        "operationId": "reorderCameras",
        "summary": "Reorder the cameras",
        "description": "Sets the order of the cameras on the Monitors page (and of `GET /cameras`), one order for the whole server and every user. `camera_ids` are cameras the caller can view, in the new order: they come first, the other cameras the caller can view follow in their current order, and the cameras the caller cannot view keep their places. Every camera's `sort_order` is rewritten (1..N) at once. `404 not_found`: an id the caller cannot view (nothing changed). Admins and operators. API 1.102.0.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CameraOrder"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new order of the cameras the caller can view.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraOrder"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/analyze": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "analyzeCamera",
        "summary": "Analyze a camera now",
        "description": "Runs one Guardian analysis of the camera right now (a short clip, the AI's description, the camera's alert rules, which may notify), skipping the motion gate and cooldown. The description is also added to the Guardian log (`guardian.event`). Uses AI credits. A failed analysis is an error, never an empty success: `409 ai_not_enabled` (no AI on the camera), `503 capture_failed` (no clip), `503 ai_unavailable`, `402 insufficient_credits`; `503 service_unavailable` when Guardian analysis is not enabled on this server. Limits per credential: 6 analyses a minute and 2 AI operations at once (`429 rate_limited`); non-admins also wait for the camera's 5-minute analysis cooldown (`429`, `details.reason: camera_cooldown`). With `include_objects: true` (API 1.11), object recognition first runs on three live frames of the moment (one a second, optional `prompts`), its findings are given to the AI as context and returned in `objects` (best detection per label); it then also fails with `503 no_detector`, `504 detector_timeout` or `502 detector_failed`.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyzeCameraRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The analysis.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianAnalysis"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/DetectorFailed"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "504": {
            "$ref": "#/components/responses/DetectorTimeout"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/transcribe-recordings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "transcribeRecordings",
        "summary": "Transcribe recordings in a time range",
        "description": "Runs speech-to-text over the camera's stored recordings between `from` and `to`, writing the transcripts so they appear in the playback Insights pane at their real times (API 1.71). Use it to read what was said in past recordings when live audio monitoring was off, or was only just turned on. Only the audio actually in the recordings is transcribed — a camera with no microphone produces none. Idempotent in effect: a passage already transcribed is not duplicated. The call returns a job handle (`202 Accepted`) and transcription continues in the background; poll the matching `GET` for progress. `200 OK` instead of `202` means a run for this camera was already in flight (the body is that run's progress). Uses AI credits like live transcription. `400 validation_error` for a missing/!after range, a window longer than 24 h, or no recordings in it; `402 insufficient_credits`; `503 service_unavailable` when audio monitoring is disabled on this server or no speech-to-text provider is configured.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranscribeRecordingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A run was already in flight; its progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackfillProgress"
                }
              }
            }
          },
          "202": {
            "description": "Transcription started; poll the GET for progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackfillProgress"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "getTranscribeRecordings",
        "summary": "Recording transcription progress",
        "description": "The progress of this camera's most recent recording-transcription run (API 1.71): whether it is still running, how many recording segments are done of the total, and how many transcripts it has added. Returns a zeroed body (`running: false`) when no run has ever started for the camera.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-read-only": true,
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The run's progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackfillProgress"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/detect-objects": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "detectObjects",
        "summary": "Find objects in a camera frame",
        "description": "Runs open-vocabulary object recognition on one frame of the camera — live (`at` omitted) or the recorded frame at `at` — on this server's object recognition runner (the `hal-objects` Vision Engine service, a GPU module), and returns what it found: label, confidence and a box normalised to the frame. `prompts` lists what to look for in plain words (at most 20, 40 characters each, e.g. `[\"person\", \"red t-shirt\", \"parcel\"]`); without prompts the runner uses the camera's own prompt list. With `annotate` (default true) the frame with the boxes drawn is kept for 15 minutes at `annotated_image_url`, readable by the same credential only. A recorded `at` also needs the `recordings:read` scope (`403 insufficient_scope`). Read-only: nothing is stored as a detection. `503 no_detector` when no runner is online, `504 detector_timeout` when it does not answer within 10 s, `502 detector_failed`; `422 clip_no_recordings` when no recording covers `at`; `503 snapshot_unavailable` when the camera gives no live frame. Limits per credential: 20 a minute and 2 AI operations at once (`429 rate_limited`).",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-read-only": true,
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DetectObjectsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The objects found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DetectObjectsResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/DetectorFailed"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "504": {
            "$ref": "#/components/responses/DetectorTimeout"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/images/actions/analyze": {
      "post": {
        "operationId": "analyzeImage",
        "summary": "Describe and find objects in an image",
        "description": "Analyses an image you upload (JPEG, PNG or WebP, at most 10 MB and 40 megapixels): `describe` (default true) asks the AI for a short description (uses AI credits like a camera analysis; needs the `guardian:write` scope; `402 insufficient_credits`), `detect` (default true) runs object recognition on the object recognition runner, with optional `prompts` (as for detect-objects). Send it as `multipart/form-data` (field `image`, plus the options as form fields; `prompts` comma-separated) or as JSON with the image base64-encoded in `image_base64` (MCP clients: the MCP endpoint accepts at most 1 MB per call, so about 750 KB of image). The image is decoded and re-encoded on the server (metadata is dropped) and is never stored: only the annotated result, when asked for, is kept in memory for 15 minutes at `annotated_image_url`, readable by the same credential only. Limits per credential: 6 a minute with `describe` (the analyze limit), 20 a minute for detection only, 2 AI operations at once.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-read-only": true,
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageAnalyzeRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ImageAnalyzeUpload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The analysis.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageAnalysis"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/DetectorFailed"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "504": {
            "$ref": "#/components/responses/DetectorTimeout"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/object-images/{image_id}": {
      "parameters": [
        {
          "name": "image_id",
          "in": "path",
          "required": true,
          "description": "From `annotated_image_url`.",
          "schema": {
            "type": "string",
            "pattern": "^img_[0-9a-f]{32}$"
          }
        }
      ],
      "get": {
        "operationId": "getObjectImage",
        "summary": "Annotated object recognition image",
        "description": "The frame or image with the found objects' boxes drawn, for 15 minutes after the request that made it, readable only by the credential that made it (the same user for a session); a camera frame also needs viewer permission on the camera still. Not served through a Cloudflare Tunnel origin (media is served by the media origin).",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "JPEG image.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/snapshot": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraSnapshot",
        "summary": "Live snapshot",
        "description": "A current JPEG frame. When the camera cannot produce one, a frame up to 2 minutes old may be served (`Age` header in seconds); otherwise `503 snapshot_unavailable`. A camera that gave no frame moments ago is not asked again for a while (30 s, growing to 5 minutes while it stays silent), and the answer is then immediate (the kept frame or the 503). Not served through a Cloudflare Tunnel origin (media is served by the media origin).",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "JPEG image.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/actions/move": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "movePTZ",
        "summary": "Move the camera",
        "description": "Moves at the given velocities for `duration_ms` (default 400, at most 5000), then stops. A move sent while another is running for the same camera is dropped (`status: coalesced`). With `hold: true` (API 1.46.0) the camera keeps moving (`status: holding`) until `…/ptz/actions/stop`, or until this call is not repeated within ~1.2 s (the server stops it: a dead-man, so a lost client never leaves a camera turning). Repeat the hold call every ~400 ms to keep moving; a repeat with the same velocities sends nothing to the camera, new velocities change direction. A camera behind a theia-client moves 600 ms per hold call.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PTZMove"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The command ran.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/actions/stop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "stopPTZ",
        "summary": "Stop the camera",
        "description": "Stops the camera now and ends a hold move (`hold` on …/ptz/actions/move); a camera behind a theia-client gets a zero-velocity move ending in a stop. A camera without PTZ (`has_ptz` false) is `409 ptz_not_supported`, as for every PTZ operation, and a camera whose PTZ needs ONVIF while its `onvif_enabled` is off is `409 onvif_disabled`; `502 ptz_failed` means a PTZ camera refused or did not answer. Timed moves always end at their duration anyway; use this to cut one short.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The command ran.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/actions/stop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "stopRobot",
        "summary": "Stop a robot camera",
        "description": "API 1.121.0. Stops a robot camera (`body_type` robot, the Vigiora Robot) now. It ends a hold move and sends a PTZ stop, as `…/ptz/actions/stop` does, then calls the robot's own stop, which also cancels a route it is driving. A camera that is not a robot is `409 not_a_robot`; `502 ptz_failed` means the robot refused or did not answer. A robot behind a theia-client gets the PTZ stop only. Safe to call any time and repeatedly.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The robot was told to stop.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/light": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getRobotLight",
        "summary": "Headlight of a robot camera",
        "description": "API 1.123.0. Reads the robot's headlight from its own state (`on`, `level` 1..120, `remaining_s` before it switches itself off). `409 not_a_robot` for other cameras, `409 light_unsupported` for firmware without a light, `502 ptz_failed` when the robot does not answer.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The headlight.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotLight"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/actions/light": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "setRobotLight",
        "summary": "Switch a robot camera's headlight",
        "description": "API 1.123.0. `on` is required. When on, the light stays lit for `ttl_s` seconds (1..600, default 120) at `level` (1..120, default 60) and then switches itself off, so a client that wants it on keeps renewing it. `409 not_a_robot` for other cameras, `409 light_unsupported` for firmware without a light, `502 ptz_failed` when the robot does not answer. Safe to repeat.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "on"
                ],
                "properties": {
                  "on": {
                    "type": "boolean"
                  },
                  "level": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 120,
                    "default": 60
                  },
                  "ttl_s": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 600,
                    "default": 120
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The headlight now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotLight"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/wifi-motion": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getRobotWifiMotion",
        "summary": "Wi-Fi movement sensed by a robot camera",
        "description": "API 1.124.0. The robot hears movement in the room from how people disturb its Wi-Fi signal (no picture involved). `valid` is false while the robot is moving, for a second after, and on a route (then `score`, `baseline`, `threshold` and `rssi` are null); `warming_up` while it learns the room. `history` is the last 30 scores, oldest first, one per `1/history_hz` seconds, null where not valid. `409 not_a_robot`, `409 robot_unsupported` (firmware without it), `502 ptz_failed`. Movement also arrives as the `robot.wifi_motion` event.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The reading.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotWifiMotion"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateRobotWifiMotion",
        "summary": "Switch the robot's Wi-Fi movement sensor",
        "description": "API 1.124.0. `enabled` switches the sensor; `threshold` sets the movement score above which it reports movement (0 = automatic). Answers the new reading.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "threshold": {
                    "type": "number",
                    "minimum": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The reading now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotWifiMotion"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/actions/camera": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "setRobotCamera",
        "summary": "Switch a robot camera's picture on or off",
        "description": "API 1.124.0. Turns the robot's camera off (it then streams nothing; the camera shows `paused`, not `offline`) or back on. The robot also pauses its camera itself while Bluetooth or a deep scan runs (`paused_reason` `ble`, `deep_scan`, `manual`). `409 not_a_robot`, `409 robot_unsupported`, `502 ptz_failed`.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "on"
                ],
                "properties": {
                  "on": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The camera now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotCameraState"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/actions/sense": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "senseRobot",
        "summary": "Scan the room with a robot camera",
        "description": "API 1.124.0. The robot listens for `seconds` (3..10, default 5) and reports the Wi-Fi networks it hears, the Bluetooth devices around it and the movement it measured. The call lasts about `seconds` + 3 s and the robot's own web server is busy meanwhile. The result is stored (the last 20 per robot) and answered. Wi-Fi and Bluetooth names stay on this server and are never logged. `409 robot_busy` when the robot is moving or on a route, `409 not_a_robot`, `409 robot_unsupported`, `502 ptz_failed`.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "seconds": {
                    "type": "integer",
                    "minimum": 3,
                    "maximum": 10,
                    "default": 5
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stored scan.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotScan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/bluetooth": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getRobotBluetooth",
        "summary": "Bluetooth of a robot camera",
        "description": "API 1.127.0. What the robot's Bluetooth jobs found, namely the last scan and the last keyboard search (stored on this server, the last 20 results per robot are kept), the MIDI keyboard the robot remembers, whether it has Bluetooth at all, and, while it is away on a job, `away.until` and `away.remaining_s`. The robot is offline for about 20 s per job; that is a planned pause, so its stream shows `paused`, not `idle`, and no camera.offline is sent. `restart` says why the robot last restarted (diagnostics; `after_bluetooth_job` marks a normal job restart). `low_battery` is true while the robot is too low on power for a job. `melodies` are the built-in melody names for `play-melody`. While the robot is away, `GET …/robot/wifi-motion` answers `camera.paused_reason` `ble` and `resumes_in_s`. Bluetooth names and addresses stay on this server and are never logged. `409 not_a_robot`.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The robot's Bluetooth.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotBluetooth"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/actions/bluetooth-scan": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "scanRobotBluetooth",
        "summary": "Scan Bluetooth with a robot camera",
        "description": "API 1.127.0. The robot listens for Bluetooth devices for `seconds` (2..15, default 5). It then goes offline for about 20 s (its Wi-Fi is off; the camera shows `paused`, with no alert) and comes back with the result (read `GET …/robot/jobs/{job_id}` (or `GET …/robot/bluetooth` for the stored scan) after `ready_after_s`). `409 robot_busy` when the robot is moving, on a route or already away, `409 ble_unsupported` (firmware or build without Bluetooth), `409 battery_low` (charge the robot first), `409 not_a_robot`, `502 ptz_failed`. Takes the robot offline, so an AI agent asks first.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "seconds": {
                    "type": "integer",
                    "minimum": 2,
                    "maximum": 15,
                    "default": 5
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job started; the robot is away until it is done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotJobStarted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/actions/find-keyboards": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "findRobotKeyboards",
        "summary": "Find Bluetooth MIDI keyboards with a robot camera",
        "description": "API 1.127.0. Like `bluetooth-scan`, but lists only Bluetooth MIDI keyboards. The robot is away for about 20 s. The result (`devices`) is stored and read from `GET …/robot/jobs/{job_id}` or `GET …/robot/bluetooth` (`keyboards`). Errors as for `bluetooth-scan`. Takes the robot offline, so an AI agent asks first.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "seconds": {
                    "type": "integer",
                    "minimum": 2,
                    "maximum": 15,
                    "default": 5
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job started; the robot is away until it is done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotJobStarted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/actions/play-melody": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "playRobotMelody",
        "summary": "Play a melody on a Bluetooth keyboard with a robot camera",
        "description": "API 1.127.0. The robot connects to a Bluetooth MIDI keyboard and plays a melody (about 20 s away from Wi-Fi, shown as `paused`). Send `melody` (text such as `C4:300 E4:300 R:200 G4:600`, a note with `#` or `b` and an octave, `:` and its length in ms, `R` for a rest; or the name of a built-in melody from `GET …/robot/bluetooth` `melodies`) or `notes` (a list of `n` 0..127, `v` 1..127, `ms` and `at`); at most 256 notes and 30 s. The keyboard is `keyboard_address`, or a part of its name in `keyboard_name`; without either, the keyboard the robot remembers, else the first one it finds. `409 robot_busy`, `409 ble_unsupported`, `400 validation_error` (not a playable melody, or the robot did not know the keyboard). The outcome (`ok`, `events`, `sent`, or an `error` such as `keyboard not found`) is in `GET …/robot/jobs/{job_id}`. Makes sound in a real room and takes the robot offline, so an AI agent asks first.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "melody": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "notes": {
                    "type": "array",
                    "maxItems": 256,
                    "items": {
                      "type": "object",
                      "required": [
                        "n",
                        "ms"
                      ],
                      "properties": {
                        "n": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 127
                        },
                        "v": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 127
                        },
                        "ms": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 10000
                        },
                        "at": {
                          "type": "integer",
                          "minimum": 0
                        }
                      }
                    }
                  },
                  "keyboard_address": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "keyboard_name": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "velocity": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 127
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job started; the robot is away until it is done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotJobStarted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/jobs/{job_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "name": "job_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getRobotJob",
        "summary": "A robot's Bluetooth job",
        "description": "API 1.127.0. `status` is `pending` until the robot is back and has answered (`ready_after_s` after the start, up to 30 s more), then `done` or `failed` (`error`; `battery_low` when the robot ran out of power starting the job). `result` is the robot's own answer, for `scan` and `midi_devices` `{ok, devices, took_ms}` (each device `{address, rssi, name, services}`), for `midi_play` `{ok, address, name, events, sent, encrypted, subscribed, took_ms}` (`encrypted` false means the keyboard may ignore the notes). Jobs are kept in memory (a server restart forgets them; the stored scans stay in `GET …/robot/bluetooth`). `404` for an unknown job.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotJob"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/patrol": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getRobotPatrol",
        "summary": "AI patrol status of a robot camera",
        "description": "API 1.122.0. The robot's current or last AI patrol (`running`, `step`, the last move and why, what it sees, how it ended) and, before any run, the defaults with the estimated AI credits. Kept in memory (a server restart forgets the last run).",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotPatrolStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/patrol/actions/start": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "startRobotPatrol",
        "summary": "Start an AI patrol of a robot camera",
        "description": "API 1.122.0. The robot drives around the room on its own, avoiding obstacles from its camera picture (it has no distance sensors). Each step reads a fresh frame, asks the vision model for one short move (one metered AI call, about 1 AI credit) and drives it as a timed burst (forward at most 600 ms, turns and back at most 400 ms, speed at most 0.6). `minutes` (default 5, at most 30) and 20 steps a minute bound a run; `goal` is optional (\"check the kitchen and come back\"). It stops on Stop robot, any manual drive, a lost or late picture, the robot not answering, weak Wi-Fi (below -80 dBm), AI unavailable or no credits, and always ends with the robot's own stop. `409 not_a_robot` for other cameras, `409 conflict` while one runs, `402 insufficient_credits`, `503 ai_unavailable`.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RobotPatrolStart"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The AI patrol started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotPatrolStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/patrol/actions/stop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "stopRobotPatrol",
        "summary": "Stop an AI patrol",
        "description": "API 1.122.0. Ends the robot's AI patrol; the robot gets its own stop. Answers the final status (or the idle one when nothing ran). Safe to repeat.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The final status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotPatrolStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/nav": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getRobotNav",
        "summary": "Robot navigation status",
        "description": "API 1.129.0. Who controls the robot (`nav`, `patrol`, `manual` or none), the current or last go-to (place, step, last action, how it ended), a learning session, where the robot thinks it is, how many places and views it remembers, whether the Robot navigation add-on is online (the Wi-Fi movement reading is `GET .../robot/wifi-motion`). A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotNavStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/nav/actions/stop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "stopRobotNav",
        "summary": "Stop robot navigation",
        "description": "API 1.129.0. Ends a go-to, return home or place save; the robot gets its own stop and the light goes off. Safe to repeat. Stop robot (`POST .../robot/actions/stop`) ends navigation too. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotNavStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/nav/actions/return-home": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "returnRobotHome",
        "summary": "Send the robot home",
        "description": "API 1.129.0. Like go-to, to the Home place (the robot's base). `minutes` (default the robot's `max_minutes`, at most 30) bounds the run. `409 conflict` when it has no Home place, while another run, a patrol or a learning session holds the robot, or within 10 s of a manual drive. `503 addon_offline` when the Robot navigation add-on (hal-robotnav) is not online; nothing moves. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RobotNavGo"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotNavStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/nav/learn/actions/start": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "startRobotNavLearn",
        "summary": "Start learning the home",
        "description": "API 1.129.0. `drive`: you drive the robot by hand and it keeps a view each time the wheels settle (it does not move by itself). `explore`: the AI patrol drives and each settled picture is kept (AI credits as for an AI patrol; `402 insufficient_credits`, `503 ai_unavailable`). Near-identical views are skipped; the first view becomes the Home place when there is none. `503 addon_offline` when the Robot navigation add-on (hal-robotnav) is not online; nothing moves. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RobotNavLearnStart"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Learning.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotNavStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/nav/learn/actions/stop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "stopRobotNavLearn",
        "summary": "Stop learning",
        "description": "API 1.129.0. Ends a learning session (and the AI patrol of `explore`); what was learned stays. Safe to repeat. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotNavStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/nav/map": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "exportRobotNavMap",
        "summary": "Export the robot's place memory",
        "description": "API 1.129.0. Places, views (keyframes: rough position, Wi-Fi fingerprint, brightness; not the embeddings), the links between them and the motion calibration, as JSON. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The map.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotNavMap"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteRobotNavMap",
        "summary": "Forget everything the robot learned",
        "description": "API 1.129.0. Deletes every place, view and picture of this robot and its run history. The robot must learn again. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "x-vigiora-destructive": true,
        "responses": {
          "204": {
            "description": "Forgotten."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/nav/keyframes/{keyframe_id}/image": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "$ref": "#/components/parameters/RobotKeyframeId"
        }
      ],
      "get": {
        "operationId": "getRobotKeyframeImage",
        "summary": "A learned view's picture",
        "description": "API 1.129.0. The JPEG the robot saw when it learned this view. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "JPEG image.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/nav/runs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listRobotNavRuns",
        "summary": "Robot navigation history",
        "description": "API 1.129.0. Go-to, return home and place-save runs, newest first, each with its step log. Kept 30 days. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotNavRunPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/nav/settings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getRobotNavSettings",
        "summary": "Robot navigation settings",
        "description": "API 1.129.0. `movement_events` (Wi-Fi movement near the idle robot, the `robot.wifi_motion` event, starts one Guardian look at its camera; default on) and `max_minutes` (the default run limit, 10). A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotNavSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateRobotNavSettings",
        "summary": "Change robot navigation settings",
        "description": "API 1.129.0. Absent fields stay. Turning `movement_events` off stops the Guardian look that Wi-Fi movement starts (`robot.wifi_motion` itself is still published). A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RobotNavSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotNavSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/places": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listRobotPlaces",
        "summary": "The robot's places",
        "description": "API 1.129.0. Every place the robot learned (Home first). `needs_name` marks a place still waiting for a name; `suggested_name` comes only from the local vision model (hal-vision), never the cloud. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The places.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotPlaceList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createRobotPlace",
        "summary": "Save the robot's current spot as a place",
        "description": "API 1.129.0. The robot turns on the spot in 8 steps of 45 degrees, keeping a view at each (so it can recognise the place from any side), then faces the first view again. Without `name` the place needs a name: the local vision model suggests one when it is online, otherwise ask the user (no picture goes to the cloud). `kind: home` makes it the robot's base (one per robot). Answers the place at once; the turn runs in the background (`GET .../robot/nav`). `409 conflict` for a second home or a busy robot. `503 addon_offline` when the Robot navigation add-on (hal-robotnav) is not online; nothing moves. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RobotPlaceCreate"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Saving.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotPlace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/places/{place_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "$ref": "#/components/parameters/RobotPlaceId"
        }
      ],
      "get": {
        "operationId": "getRobotPlace",
        "summary": "A robot place",
        "description": "API 1.129.0. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotPlace"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateRobotPlace",
        "summary": "Name or change a robot place",
        "description": "API 1.129.0. Absent fields stay. `room_id` links the place to a room of the floor plans (null clears it); naming the place clears `needs_name`. Nothing moves. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RobotPlaceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotPlace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteRobotPlace",
        "summary": "Delete a robot place",
        "description": "API 1.129.0. The place goes; its views stay in the map as waypoints. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-destructive": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/places/{place_id}/actions/goto": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "$ref": "#/components/parameters/RobotPlaceId"
        }
      ],
      "post": {
        "operationId": "gotoRobotPlace",
        "summary": "Send the robot to a place",
        "description": "API 1.129.0. Room level: the robot works out where it is from its camera (and Wi-Fi), plans over the places and views it learned, and drives there in short timed moves, checking a fresh still before each and the floor in front of it, with the AI patrol's limits (20 moves a minute, Wi-Fi above -80 dBm, battery). It switches its light on where it is dark. `minutes` (default the robot's `max_minutes`, at most 30). Follow it with `GET .../robot/nav` or the `robot.nav.*` events; it ends `arrived`, `stopped`, `manual` (someone drove it), `lost`, `blocked`, `no_route`, `too_dark`, `low_battery`, `weak_wifi`, `robot_unreachable`, `addon_offline`, `timeout` or `error`, always with the robot's own stop. `409 conflict` while something else drives it or the place has no views. `503 addon_offline` when the Robot navigation add-on (hal-robotnav) is not online; nothing moves. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RobotNavGo"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotNavStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/robot/places/{place_id}/actions/relocalise": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "$ref": "#/components/parameters/RobotPlaceId"
        }
      ],
      "post": {
        "operationId": "relocaliseRobot",
        "summary": "Tell the robot where it is",
        "description": "API 1.129.0. \"I'm here\": sets the robot's position to this place (its first view). The next go-to trusts it once instead of looking around. Nothing moves. A camera that is not a robot is `409 not_a_robot`.",
        "tags": [
          "Robot navigation"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RobotNavStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/presets": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listPTZPresets",
        "summary": "List PTZ presets",
        "description": "The camera's stored positions, read from the camera (cameras on this server's network only; otherwise `409 ptz_not_supported`). One page; `next_cursor` is always `null`. Needs `cameras:control` because it talks to the camera.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The presets.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPresetPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "savePTZPreset",
        "summary": "Save a PTZ preset",
        "description": "Stores the camera's current position as a new preset, or over the preset `token` (cameras on this server's network). To rename a preset without moving it use `PATCH /api/v1/cameras/{camera_id}/ptz/presets/{preset_token}`; to delete one, `DELETE` on the same path (API 1.51.0).",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PTZPresetCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The preset.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPreset"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/presets/{preset_token}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "$ref": "#/components/parameters/PresetToken"
        }
      ],
      "get": {
        "operationId": "getPTZPreset",
        "summary": "Get a PTZ preset",
        "description": "API 1.51.0. One preset, read from the camera. `404` when the camera has no such preset.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The preset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPreset"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updatePTZPreset",
        "summary": "Rename or move a PTZ preset",
        "description": "API 1.51.0. `name` renames the preset without moving it (an empty `name` clears the name). Reolink cameras store the name themselves (over the Reolink app port, TCP 9000). Other cameras cannot rename a preset without also saving the current position into it (ONVIF SetPreset, Hikvision ISAPI), so the camera is not asked and Vigiora keeps the name instead (`name_in_vigiora: true`; it shows in Vigiora only). `position: \"current\"` stores the camera's current position into the preset, keeping its name (the same as `POST /api/v1/cameras/{camera_id}/ptz/presets` with its `token`). Give `name`, `position` or both. `dwell_seconds` (API 1.56.0, 3-3600) sets how long a patrol stays on the preset (kept by Vigiora). Confirm-class because it can overwrite a preset's position. `404` when the camera has no such preset.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PTZPresetUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The renamed preset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPreset"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deletePTZPreset",
        "summary": "Delete a PTZ preset",
        "description": "API 1.51.0. Removes the preset from the camera (ONVIF RemovePreset, Hikvision ISAPI DELETE), and the name Vigiora kept for it.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/ptz/patrols/active": {
      "get": {
        "operationId": "listActivePTZPatrols",
        "summary": "Running patrols",
        "description": "API 1.56.0. The patrols running now, on the cameras the caller can see (the camera grid marks them \"Patrolling\").",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PTZPatrolStatus"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/patrols": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listPTZPatrols",
        "summary": "List a camera's patrols",
        "description": "API 1.56.0. Patrol mode: named tours of the camera's presets. The one-click patrol over every preset (`all_presets: true`) comes first once it was used.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPatrolList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createPTZPatrol",
        "summary": "Create a patrol",
        "description": "API 1.56.0. A named patrol: ordered steps (a preset, an optional dwell time overriding the preset's own, an optional move speed 0-1), loop or once, random order, a home preset, a schedule, pause on activity and after a person moves the camera (`manual_pause_seconds`, default 120). Creating does not move the camera.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PTZPatrolInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPatrol"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/patrols/{patrol_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "name": "patrol_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer"
          }
        }
      ],
      "get": {
        "operationId": "getPTZPatrol",
        "summary": "Get a patrol",
        "description": "API 1.56.0.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPatrol"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updatePTZPatrol",
        "summary": "Update a patrol",
        "description": "API 1.56.0. Fields given replace the stored ones; `steps` replaces every step in the order given (reordering is an update). A running patrol keeps its steps until it is started again.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PTZPatrolInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPatrol"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deletePTZPatrol",
        "summary": "Delete a patrol",
        "description": "API 1.56.0. Stops it first when it runs. The presets stay.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Done."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/patrol": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getPTZPatrolStatus",
        "summary": "What the camera's patrol is doing",
        "description": "API 1.56.0. `active: false` when no patrol runs. `state`: `moving`, `dwelling`, `paused` (`pause_reason`: `user`, `manual_move`, `activity`), `outside_schedule`, `unreachable` (retried with a back-off), `no_presets`.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPatrolStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/patrol/actions/start": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "startPTZPatrol",
        "summary": "Start a patrol",
        "description": "API 1.56.0. Starts `patrol_id`, or with `all_presets: true` the one-click patrol over every preset (each preset's own dwell time). One patrol runs per camera: a running one is replaced. Runs survive a server restart. The camera moves; motion detection ignores Vigiora's moves. Cameras reached through a client answer `409`.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PTZPatrolStart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPatrolStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/patrol/actions/stop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "stopPTZPatrol",
        "summary": "Stop the patrol",
        "description": "API 1.56.0. The camera stays where it is. `409` when no patrol runs.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPatrolStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/patrol/actions/pause": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "pausePTZPatrol",
        "summary": "Pause the patrol",
        "description": "API 1.56.0. Holds the patrol where it is until resume.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPatrolStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/patrol/actions/resume": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "resumePTZPatrol",
        "summary": "Resume the patrol",
        "description": "API 1.56.0. Continues a paused patrol (also ends a pause after a manual move). The camera moves.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPatrolStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/panorama": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraPanorama",
        "summary": "A camera's panorama",
        "description": "API 1.63.0. The running panorama capture (`phase`: `queued`, `sweeping`, `stitching`, `done`, `failed`) or, when none ran since the server started, the last stored panorama. In `done` the `scan` holds the picture's size, how it was joined (`stitch_status`: `stitched`, or `fallback` = the frames laid side by side), the per-frame pan position and the picture at `image_url`. Angles are relative to the sweep (`angle_basis: relative`, `pan_fraction` 0 = left end stop, 1 = right end stop); this is a scanned estimate, not a measurement. `404` until the first capture.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraPanorama"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "startCameraPanorama",
        "summary": "Capture a panorama",
        "description": "API 1.63.0. Starts a panorama capture in the background (`202`, poll `GET .../panorama`). A camera that pans sweeps its pan range (about a minute: it finds the end stops, stops at overlapping positions, then returns to where it started) and the frames are joined into one wide picture; Vigiora picks the number of frames. A camera that does not pan gives its single frame (`kind: single`). Nothing is judged by AI and no AI credits are used. A person moving the camera stops the sweep. `409` while a patrol, a patrol setup or another panorama runs on the camera, or for a camera behind a theia-client.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "202": {
            "description": "Started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraPanorama"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/panorama/image": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraPanoramaImage",
        "summary": "A camera's panorama picture",
        "description": "API 1.63.0. The latest stored panorama as a JPEG (at most 1280 px per frame wide).",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/patrol-scans": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "startPTZPatrolScan",
        "summary": "Set a patrol up automatically",
        "description": "API 1.56.0. Starts the automatic patrol setup (`202`, poll `GET .../patrol-scans/{scan_id}`): Vigiora reads what the camera can do (`phase: limits`), finds its pan range by moving to the end stops (cameras without absolute positions), takes a picture at each of up to 12 positions across it and at the existing presets (`looking`; each position is saved as a preset), asks Vigiora AI what each view shows, how important it is and how long to stay there (`deciding`; at most 20 pictures, charged to AI credits), and proposes a patrol (`proposal`). Accept or cancel it. A person moving the camera stops the scan (`failed`, `reason: manual_move`); without AI it fails with `reason: ai_not_connected` (this server is not connected to a Vigiora account: checked first, before the camera moves, `failed_phase: precheck`), `ai_unavailable` (temporary) or `no_credits` (set the patrol up by hand). The camera moves; motion detection ignores it. `409` while a patrol or another setup runs.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "202": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPatrolScan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/patrol-scans/{scan_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "name": "scan_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "maxLength": 64
          }
        }
      ],
      "get": {
        "operationId": "getPTZPatrolScan",
        "summary": "Automatic patrol setup progress",
        "description": "API 1.56.0. The phase, the views found so far (with the AI's label, importance, zones and dwell as they are judged) and, in `proposal`, the proposed steps. Kept for an hour after it ends.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPatrolScan"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/patrol-scans/{scan_id}/pictures/{picture_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "name": "scan_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "maxLength": 64
          }
        },
        {
          "name": "picture_id",
          "in": "path",
          "required": true,
          "description": "The candidate index.",
          "schema": {
            "type": "integer",
            "minimum": 0
          }
        }
      ],
      "get": {
        "operationId": "getPTZPatrolScanPicture",
        "summary": "A picture from the automatic setup",
        "description": "API 1.56.0. The view at candidate `index` (JPEG, 640 px wide). Dropped when the setup is accepted or cancelled.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/storage": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraStorage",
        "summary": "Disk the camera's recordings take",
        "description": "API 1.94.0. How much disk the camera's recordings take per day and over its retention. `measured` is what the camera really wrote: its finished recordings of the last 7 days, when there is at least an hour of them; `estimate` is the figure from the stream geometry (H.264 at ~0.1 bit per pixel per frame for the main stream, a D1 sub-stream when `record_sub_stream` is on, a flat 0.65 GB a day for a microphone). `bytes_per_day` and `projected_bytes` (over `retention_days`) use the measurement when there is one and the estimate otherwise; `source` says which. `used_bytes` is what the camera's recordings take right now. The query may describe a geometry other than the saved one (`width`, `height`, `fps`, `sub_stream`, `retention_days`), as a settings form does before saving: a different stream gets the estimate, since the measurement is for the other one. Feature `camera_storage`.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "width",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "height",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "fps",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "sub_stream",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Record the sub-stream instead of the main stream."
          },
          {
            "name": "hd_on_motion",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Also keep the main stream while there is movement (`record_hd_on_motion`). API 1.100.0."
          },
          {
            "name": "retention_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 365
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The figures.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraStorage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/patrol-scans/{scan_id}/actions/accept": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "name": "scan_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "maxLength": 64
          }
        }
      ],
      "post": {
        "operationId": "acceptPTZPatrolScan",
        "summary": "Save the proposed patrol",
        "description": "API 1.56.0. Saves the proposal (or the edited `steps`: order, dwell, label) as a patrol whose steps are marked AI-suggested (`ai_label`). Views the scan made become presets named after what is in view, each with its dwell time; the scan's other presets are removed. `start: true` starts it.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PTZPatrolScanAccept"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPatrol"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/patrol-scans/{scan_id}/actions/cancel": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "name": "scan_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "maxLength": 64
          }
        }
      ],
      "post": {
        "operationId": "cancelPTZPatrolScan",
        "summary": "Cancel the automatic setup",
        "description": "API 1.56.0. Stops a running setup or drops its proposal: the presets it made are removed and the camera goes back to where it was.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZPatrolScan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/presets/{preset_token}/actions/goto": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "$ref": "#/components/parameters/PresetToken"
        }
      ],
      "post": {
        "operationId": "gotoPTZPreset",
        "summary": "Go to a PTZ preset",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The camera moved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/timeline": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraTimeline",
        "summary": "Recording coverage",
        "description": "The stretches of `[from, to)` that have footage, merging segments less than 2 seconds apart. At most 31 days. The segment still being written counts up to its last write (API 1.98.0; before, the newest footage appeared only when its segment closed, up to 10 minutes late). The span it ends has `in_progress` set to `true` and its `end` moves forward on the next read. That segment has no recording id yet, so it is not in `GET /recordings` until it closes.",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The coverage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Timeline"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/previews": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listCameraPreviews",
        "summary": "List the scrubbing pictures of a camera's recordings",
        "description": "API 1.116.0. The preview sprite of each finished recording overlapping `[from, to)` (at most 48 hours), oldest first. A sprite is one JPEG with a small picture (160 px wide) every `interval_seconds` of the recording, `columns` per row: picture `k` shows the moment `start + k × interval_seconds` and sits at column `k mod columns`, row `k div columns`. Sprites are made when a recording closes, or on the first request of `sprite_url` for older recordings; `ready` says whether it exists now (`tile_height` is null until then). Nothing is made by this call. The segment still being written has none (it is not listed). The camera's privacy masks are painted on every picture.",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "After `from`, at most 48 hours later.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sprites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/timeline/marks": {
      "get": {
        "operationId": "listTimelineMarks",
        "summary": "List what happened on cameras in a time range, folded for a timeline",
        "description": "API 1.116.0. The marks a Playback timeline draws for up to 16 cameras in `[from, to)` (at most 7 days). Every event (detections and the reports of runners attached to the camera, Guardian entries, speech transcripts) gets a `kind`; events of one camera and kind that start less than `bucket_seconds` after the previous one ends are folded into one mark with their `count`, span (`start`, `end`) and up to 5 `labels` (most frequent first). Choose `bucket_seconds` as the time one pixel or one mark covers at your zoom (default: the range divided by 240). `rep` is the member to show: one with a picture first, an alert before others, then the highest confidence; `thumbnail_url` is a 160 px picture of it (null for speech or when it has none); `ids` are up to 50 ids of the members of `rep.type` (`detection` ids are alert ids). `alert` is true when a member raised an alert (the camera's alert rules promote its label, a Guardian alert rule fired, or kind `alert`: lines, zones, QR codes, weapons). `text` is the start of the Guardian description or of the speech. At most 3000 marks, oldest first (`truncated` says later ones were cut: ask for a shorter range or a larger bucket). Kinds: `person`, `vehicle`, `animal`, `face`, `plate`, `speech`, `sound`, `guardian`, `alert`, `other`. Door and other sensors are not listed (they are not linked to cameras).",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "camera_ids",
            "in": "query",
            "required": true,
            "description": "1 to 16 camera ids, comma-separated. A camera you may not view is `404 not_found`.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+(,[0-9]+)*$"
            },
            "example": "3,7"
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "After `from`, at most 7 days later.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "bucket_seconds",
            "in": "query",
            "description": "Fold events closer than this (1 to 86400; default the range divided by 240).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 86400
            }
          },
          {
            "name": "kinds",
            "in": "query",
            "description": "Only these kinds, comma-separated.",
            "schema": {
              "type": "string"
            },
            "example": "person,vehicle"
          }
        ],
        "responses": {
          "200": {
            "description": "The marks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimelineMarks"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/recordings/events": {
      "get": {
        "operationId": "searchRecordingEvents",
        "summary": "Find recorded events (the Recordings page search)",
        "description": "API 1.117.0. Every detection and Guardian entry of the cameras you may view, newest first, filtered, with the total and the counts of each filter value. One result is one card: repeats of the same camera and label are one card, its newest detection, with `count` the detections it stands for and `pictures` their pictures. Repeats are detections of one track (the detector's `track_id`) each within 10 minutes of the next, or with no track, each within 3 minutes of the next. A Guardian entry is one card. `total` and the facets count cards. With `attention=true` every unacknowledged alert is its own card. Time: send `range` (as the app's address does) or `from`/`to`; with neither the search covers any time. The app's Recordings page sends `min_confidence=0.5` unless the person changes it; this API has no confidence default, so a call without `min_confidence` counts more than the page shows. Filters combine with AND; the values of one filter with OR; `camera_ids` and `room_ids` together are a union of places (a room stands for its cameras). On the first page (no `cursor`) the answer has `total` and `facets`: the count of each value of each filter with every other filter applied but not its own, so a count says what picking that value gives. Values with no results are left out. Later pages have `total` and `facets` null. A camera you may not view never matches (no error). Guardian entries need the `guardian:read` scope as well; without it only detections are returned. What each filter matches is listed in docs/recordings-page.md.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "show",
            "in": "query",
            "description": "`all` (detections and Guardian entries) or `events` (detections only).",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "events"
              ],
              "default": "all"
            }
          },
          {
            "name": "labels",
            "in": "query",
            "description": "Comma-separated `person` (people and faces), `vehicle` (vehicles and plates), `animal`, `other` (everything else: Guardian alerts, lines, zones, QR codes, sounds, weapons…). A Guardian entry has the label of the detection that started it, else `other`.",
            "schema": {
              "type": "string"
            },
            "example": "vehicle"
          },
          {
            "name": "person",
            "in": "query",
            "description": "A recognised face's name (repeat for several); `unknown` is a face that matched nobody. Only detections.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 200
              },
              "maxItems": 100
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "plate",
            "in": "query",
            "description": "Part of a licence plate; case, spaces and `-._·/` are ignored. Only plate reads.",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "example": "AB12"
          },
          {
            "name": "triggers",
            "in": "query",
            "description": "Comma-separated: `motion` (a Guardian analysis motion started), `sound` (a sound detection), `doorbell`, `sensor` (an alert another system reported with `POST /alerts`), `line_zone` (a line crossing or a zone), `guardian` (every Guardian entry and Guardian alert), `addon` (reported by a community add-on).",
            "schema": {
              "type": "string"
            },
            "example": "guardian"
          },
          {
            "name": "vehicle_types",
            "in": "query",
            "description": "Comma-separated vehicle classes as the detector names them (`car`, `truck`, `bus`, `motorcycle`, `bicycle`…).",
            "schema": {
              "type": "string"
            },
            "example": "car"
          },
          {
            "name": "camera_ids",
            "in": "query",
            "description": "Comma-separated camera ids (at most 100).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+(,[0-9]+)*$"
            }
          },
          {
            "name": "room_ids",
            "in": "query",
            "description": "Comma-separated room ids (at most 100); a room stands for its cameras.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+(,[0-9]+)*$"
            }
          },
          {
            "name": "range",
            "in": "query",
            "description": "The last hour (`1h`), day (`1d`), week (`1w`) or 30 days (`1m`), or `all` (any time): the app's address names. `from` or `to`, when sent, win. Left out with no `from`/`to`: any time.",
            "schema": {
              "type": "string",
              "enum": [
                "1h",
                "1d",
                "1w",
                "1m",
                "all"
              ]
            },
            "example": "1w"
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Exclusive; after `from`.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "min_confidence",
            "in": "query",
            "description": "0 to 1; hides detections scored below it. Alerts (labels an alert rule of the camera promotes) and Guardian entries are always kept. No default here (the app's page sends 0.5).",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          {
            "name": "attention",
            "in": "query",
            "description": "Only alerts not acknowledged yet, each its own card: what the app's alert bell counts. The time (`range`, `from`, `to`) and `min_confidence` do not apply to it; the other filters do. `facets.attention` is this same number whatever the time.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Up to 6 words; each must be found in the label (a class, a face name, a plate), the camera's name, the name of a room the camera is in, or a Guardian description or what was heard.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "gate car"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of events.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingEvents"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/recordings/cards/actions/acknowledge": {
      "post": {
        "operationId": "acknowledgeRecordingCards",
        "summary": "Mark whole cards seen",
        "description": "API 1.117.0. Acts on whole Recordings cards (GET /recordings/events: a card stands for `count` repeats of one camera and label). `alert_ids` (at most 100) are any detection of each card, usually the card's `id`. The server takes each card as it is now, with the same grouping as the search: a repeat that arrived after the list was read is included, and the answer's `cards[].count` and `detection_count` say how many detections the cards hold now. Cards you cannot see are in `not_found_ids`; cards on cameras where you lack the camera permission in `forbidden_ids`. Every unacknowledged alert of the cards is acknowledged (`done_count`; alert.acknowledged is emitted for each).",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordingCardsAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was acknowledged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingCardsResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/recordings/cards/actions/delete": {
      "post": {
        "operationId": "deleteRecordingCards",
        "summary": "Delete whole cards",
        "description": "API 1.117.0. Acts on whole Recordings cards (GET /recordings/events: a card stands for `count` repeats of one camera and label). `alert_ids` (at most 100) are any detection of each card, usually the card's `id`. The server takes each card as it is now, with the same grouping as the search: a repeat that arrived after the list was read is included, and the answer's `cards[].count` and `detection_count` say how many detections the cards hold now. Cards you cannot see are in `not_found_ids`; cards on cameras where you lack the camera permission in `forbidden_ids`. Every detection of the cards and its picture is deleted for good (`done_count`), as DELETE /alerts/{alert_id} without `delete_recording` does for one: recordings are kept, audited. Guardian entries are deleted with deleteGuardianEntries (they go to Recently deleted).",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-destructive": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordingCardsAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingCardsResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/recordings/cards/actions/save": {
      "post": {
        "operationId": "saveRecordingCards",
        "summary": "Save whole cards to the media library",
        "description": "API 1.117.0. Acts on whole Recordings cards (GET /recordings/events: a card stands for `count` repeats of one camera and label). `alert_ids` (at most 100) are any detection of each card, usually the card's `id`. The server takes each card as it is now, with the same grouping as the search: a repeat that arrived after the list was read is included, and the answer's `cards[].count` and `detection_count` say how many detections the cards hold now. Cards you cannot see are in `not_found_ids`; cards on cameras where you lack the camera permission in `forbidden_ids`. Every picture of the cards is copied into the media library (`folder`), one item each, named after the card's `name` (else its label), the time and its place in the card (`library_item_ids`; `done_count` pictures). At most 500 pictures per request. Admins and operators; the camera needs viewer permission.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordingCardsSave"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingCardsResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/area-searches": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "createAreaSearch",
        "summary": "Find when a part of the picture changed",
        "description": "Starts a search of the camera's recordings between `from` and `to` (at most 7 days; `to` in the future is cut to now) for the moments when something inside `area` changed: an item that moved, appeared or went away, however small or slow. `area` is a rectangle in fractions (0 to 1) of the picture from its top left corner, at least 0.02 wide and high. The search reads the recordings themselves (one frame every 5 seconds, cropped to the area), so it also finds what no detector and no Guardian description noticed. Each side of a comparison is the median of 30 seconds, so someone walking through leaves no finding, and the comparison is by pattern, so a change of brightness is not a finding. A change of the whole picture at once (lights, night mode) is counted in `lighting_skipped` and not listed. A smaller area finds smaller things: an area up to 40 % of the picture's width is read at full detail, a larger one is reduced. `sensitivity` is `low`, `medium` (default) or `high`. The search runs in the background: the answer is `202` with `status: running`; read `GET /cameras/{camera_id}/area-searches/{search_id}` until `status` is `done`. A day of one camera takes seconds to a minute. Two searches run at a time on a server (`429 rate_limited` with `Retry-After` beyond that) and a result is kept for 30 minutes. The segment still being recorded is not read. Nothing is stored or changed (the scope is `recordings:write` because it starts work on the server, like a clip export). API 1.99.0. Feature `area_search`.",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": false,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AreaSearchCreate"
              },
              "example": {
                "from": "2026-11-19T00:00:00+07:00",
                "to": "2026-11-19T12:00:00+07:00",
                "area": {
                  "x": 0.59,
                  "y": 0.8,
                  "width": 0.16,
                  "height": 0.19
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The search, started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AreaSearch"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/area-searches/{search_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "name": "search_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getAreaSearch",
        "summary": "Read an area search",
        "description": "The search's progress (`status`, `progress` from 0 to 1) and what it found so far (`changes`, oldest first; they fill in while it runs). A finding of kind `changed` means the area looks different afterwards (an item moved, appeared or went away); `activity` means something stayed in the area for a while and left it as it was. `start` and `end` are when the change showed, `at` when it was strongest, `box` where in the picture, and `before_at` / `after_at` two moments to compare: `GET …/changes/{change_id}/picture` serves the area at either. `across_gap` is true for a change that happened while nothing was recorded. A search is forgotten 30 minutes after it finished (`404`). API 1.99.0.",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The search.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AreaSearch"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteAreaSearch",
        "summary": "Cancel an area search",
        "description": "Stops the search when it is still running and forgets its result. Nothing else changes. API 1.99.0.",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": false,
        "x-vigiora-destructive": false,
        "responses": {
          "204": {
            "description": "Canceled and forgotten."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/area-searches/{search_id}/changes/{change_id}/picture": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "name": "search_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "change_id",
          "in": "path",
          "required": true,
          "description": "The finding's position in `changes`, from 0.",
          "schema": {
            "type": "integer",
            "minimum": 0
          }
        }
      ],
      "get": {
        "operationId": "getAreaSearchPicture",
        "summary": "Picture of the area before or after a finding",
        "description": "A JPEG of the search's area as it was at the finding's `before_at` (`side=before`) or `after_at` (`side=after`), cut from the recording and at most 480 pixels wide. `404 no_recording` when the recording that held the moment is gone. API 1.99.0.",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "side",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "before",
                "after"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The picture.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/hd-recordings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listHdRecordings",
        "summary": "List a camera's HD clips",
        "description": "The HD clips of a camera that overlap `from`..`to` (at most 31 days), oldest first. A camera with `record_sub_stream` and `record_hd_on_motion` records its sub stream all the time and also saves the main (HD) stream for every period with movement: one clip from about 10 seconds before the movement to 20 seconds after it, cut every 10 minutes while the movement goes on. The clips cover the same time as the continuous recording, so they are not part of `GET /api/v1/recordings` or the timeline; play one with its `media_url`. They are kept as long as the camera's recordings (`retention_days`). At most 2000 clips per answer: ask a shorter range for more. API 1.100.0. Feature `hd_on_motion`.",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The clips.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HDRecordingList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/hd-recordings/{hd_recording_id}/media": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "name": "hd_recording_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer",
            "format": "int64"
          }
        }
      ],
      "get": {
        "operationId": "getHdRecordingMedia",
        "summary": "Play an HD clip",
        "description": "The clip as MP4, H.264 (`Range` requests honoured; `download=true` adds a `Content-Disposition` attachment). This is the `media_url` of an HD clip; send the same credentials as for any call. Through the cloud gateway of a free plan, a used-up remote-video allowance answers `429 relay_limit`. API 1.100.0.",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "download",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "Range",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "MP4 video.",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "Partial MP4 content.",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/relocate": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "relocateCamera",
        "summary": "Move a camera to its MAC's current address",
        "description": "For a LAN camera whose hardware id (MAC) the server has learned, finds the address that MAC has now (as `GET /network/lookup`) and, when it changed, rewrites the host of the camera's stream (and PTZ) URL through the same path automatic camera following uses: the go2rtc source and recorder follow and a `camera.moved` event is emitted. Before switching, the device at the new address must accept the camera's stored login (RTSP Digest, with a wrong-password control), so the credentials only go to the right camera. `dry_run: true` only reports what would change. An unchanged address answers `changed: false`. Refusals are `409 conflict` with `details.reason`: `no_hardware_id`, `not_lan_camera`, `device_not_found`, `ambiguous`, `shared_mac`, `ip_in_use`, `old_address_alive` (something still answers at the camera's current address), `mac_mismatch` (the new address does not answer with the camera's MAC when poked right before the login check; no login is sent then), `verify_failed`, `camera_changed`, `apply_failed`; `409 network_unavailable` when discovery cannot work on this server; `503 network_busy` (see Network). Counts against the lookup limit (30 a minute per credential). Residual risk: a device that impersonates the camera's MAC while the camera is offline passes the address checks; it receives only an RTSP Digest response (never the password) and must accept the stored login and refuse a wrong one before the camera is moved to it.",
        "tags": [
          "Cameras",
          "Network"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-destructive": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RelocateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (applied, would apply, or unchanged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraRelocation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/actions/suggest-name": {
      "post": {
        "operationId": "suggestCameraName",
        "summary": "Name a camera from its picture",
        "description": "API 1.36.0. The AI names a camera `<Room> – <position>` (\"Living room – TV side\", \"Kitchen – sink\", \"Carport – pool side\") from a frame: the room it watches and where it is mounted or what it faces, chosen so the name fits the other cameras the caller can see (same style and language, a position that tells it apart from cameras in the same room, never a repeat). Give either `snapshot_jpeg_base64` (the thumbnail `POST /cameras/actions/detect` returned, for a camera being added) or `camera_id` (an existing camera: its latest cached snapshot is used, `503 snapshot_unavailable` when none was served yet). `site_id` picks the site whose cameras the name must fit (default: the existing camera's site, else all the caller sees); `vendor`, `model`, `current_name` and `language` are hints. The answer has the name, its room and position, up to three alternatives, a one-line reason and the names it was fitted to. One AI call with the frame and the latest frames of up to 6 other cameras, charged like a Guardian chat (feature `camera_name` in `GET /server` features). `503 ai_unavailable` when the server has no AI or the AI gave no usable name, `402 insufficient_credits` when out of credits. Nothing is renamed: the caller decides.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CameraNameRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The suggested name.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraNameSuggestion"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/actions/detect": {
      "post": {
        "operationId": "detectCamera",
        "summary": "Detect a camera's streams",
        "description": "Connects to the camera at `ip` with its login and finds its stream addresses, so nobody has to type an RTSP URL. ONVIF first (GetCapabilities, GetProfiles, GetStreamUri for the main and sub profiles, WS-Security digest), then the camera catalogue's stream templates for the brand (or the picked `model`, API 1.31.0) and a curated table of per-maker RTSP paths (Hikvision, EZVIZ, Dahua, Amcrest, Reolink, TP-Link Tapo, Uniview, Axis, Foscam, Wyze, eufy, Hanwha, VIVOTEK, XMEye, generic), each checked with a short RTSP DESCRIBE, over TLS for `rtsps://` (API 1.96.0: Wyze RTSPS on 322, Foscam on 88, a maker's fixed port; 8554 when 554 is closed and no `port` was given; at most 24 paths); `vendor` (or the maker the last network scan found for the address) is tried first. API 1.96.0: a UniFi Protect console (UniFi OS on HTTPS 443) is recognised and read with the user's UniFi login: `method: console`, `console: unifi_protect`, and `cameras` lists its cameras, each with its own `detection_id` (a camera whose RTSP is off in Protect too: `add-detected` turns RTSP on for it with the same login, or fails with `409 conflict`, `details.reason: console_rtsp_off`, saying which camera to turn it on for in Protect); the top-level `detection_id` is the first ready camera's. Answers within about 20 seconds with `ok: true`, the stream URLs **without credentials**, codec, size, frame rate and a JPEG thumbnail, and a `detection_id` (valid 30 minutes, for you only) to pass to `POST /cameras/actions/add-detected`; or `ok: false` with `failure` (`auth_failed`, `onvif_auth_failed`, `rtsp_closed`, `unreachable`, `no_stream`, `timeout`, `no_local_stream`), a message and a hint; `catalog` says what the camera catalogue knows about the camera. Cameras lock their account after a few failed logins, so: the login is sent only to `ip`, only when the camera asks for it; an RTSP refusal ends the detection at once and that login is not sent to that camera again for 30 minutes; an ONVIF refusal (API 1.96.0: for every brand, as many keep ONVIF users apart from the camera login) is followed by the stream paths with the same login, `onvif_login_refused: true` when one answered, and a refusal there counts as two; until an RTSP DESCRIBE with the login answered 200 (or 404: the camera checked the login, then found no such path), only one stream path gets it (paths are first checked without credentials); and after 3 refused logins in a sliding 30 minutes a camera gets no login at all (`429 rate_limited`, `details.reason: camera_login_budget`, `Retry-After`). `attempts_left` says how many refusals remain before then: warn the user. `ip` must be on a private subnet this server is connected to (as for network scans: RFC 1918 on a physical interface, never link-local, CGNAT or VPN interfaces; `400` with `details.connected_subnets`) and `port` one of the camera ports; where network discovery is unavailable (hosted servers, containers without host networking) this answers `409 network_unavailable`. Credentials are never logged or returned. This is active: it connects to the camera.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CameraDetectRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The detection (look at `ok`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraDetection"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/actions/detect-batch": {
      "post": {
        "operationId": "detectCameraBatch",
        "summary": "Detect several cameras with one login",
        "description": "\"Apply to all from this maker\": runs `detectCamera` with one login for 1–32 addresses in the background and answers `202` with the batch to poll (`GET /cameras/detect-batches/{batch_id}`). Each camera is probed on its own (3 at a time, never two probes of one camera at once) with the same per-camera login budget; a camera whose budget is spent is not tried (`rate_limited: true`). One running batch per user (`409 conflict`, `details.reason: batch_running`) and at most 3 on the server (`details.reason: server_busy`). Every address must be valid, on a connected subnet, and listed once; `409 network_unavailable` as for `detectCamera`.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CameraDetectBatchRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The batch started.",
            "headers": {
              "Location": {
                "description": "The batch's URL.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DetectionBatch"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/detect-batches/{batch_id}": {
      "parameters": [
        {
          "name": "batch_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "maxLength": 64
          }
        }
      ],
      "get": {
        "operationId": "getDetectionBatch",
        "summary": "Get a camera detection batch",
        "description": "The batch's status (`running`, `done`) and each camera's (`pending`, `running`, `done`) with its detection once done. Yours only; the last 10 batches are kept in memory, not across restarts.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The batch.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DetectionBatch"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/actions/add-detected": {
      "post": {
        "operationId": "addDetectedCameras",
        "summary": "Add detected cameras",
        "description": "Creates a camera for each detection (`detection_id` from `detectCamera` or a batch) through `POST /cameras`: the same validation, plan limits, events and streaming setup, with the stream URL (and its credentials) kept on the server, so they never pass through the client. Size and frame rate come from the detection; the recording default applies unless `recording_enabled` is given; a sub stream is set up automatically where the camera has one. Answers `201` when at least one camera was created (else `200`) with `created` (the cameras) and `failed` (each detection's v1 error, e.g. `not_found` for an expired detection, `limit_reached`, `validation_error`; API 1.96.0: `conflict` with `details.reason: console_rtsp_off` for a console camera whose RTSP could not be turned on). A console camera (API 1.96.0) whose RTSP is off is turned on in the console first, with the console login the detection keeps; without a `name` it is named as in the console. At most 32 at a time.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddDetectedRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "No camera was created (see `failed`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddDetectedResult"
                }
              }
            }
          },
          "201": {
            "description": "At least one camera was created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddDetectedResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/network/actions/scan": {
      "post": {
        "operationId": "startNetworkScan",
        "summary": "Scan the local network",
        "description": "Starts a scan of the server's directly connected private subnets (each narrowed to the /22 around the server's own address; at most 1022 hosts in all) and answers `202` with the scan to poll (`GET /network/scans/{scan_id}`). The scan sweeps every host with one TCP connect (any answer makes the OS learn its MAC), reads the neighbour (ARP) table, checks the requested allowlisted ports on live hosts, sends one ONVIF WS-Discovery probe (multicast, plus unicast to hosts with a scanned port open; an answer counts only with a device URL on the answering address; a camera with ONVIF disabled answers nothing) and, with `resolve_names: true`, looks up reverse DNS names (off by default: it sends the LAN's addresses to the server's resolver). It ends within about 60 seconds (`failed` with `error: timed out` otherwise, keeping what it found). When the 1022-host cap leaves connected subnets out, `truncated` is true and `skipped_subnets` lists them; scan one with `subnet`. While camera following sweeps: `503 network_busy`. One scan runs at a time per server: another request meanwhile is `409 scan_in_progress` with `details.scan_id`. At most 2 scans a minute per credential (`429 rate_limited`). `subnet` must lie inside a connected private subnet and be /22 to /30; `ports` must be from the allowlist (`details.allowed_ports` on refusal).",
        "tags": [
          "Network"
        ],
        "security": [
          {
            "apiKey": [
              "network:read"
            ]
          },
          {
            "apiKeyHeader": [
              "network:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "network:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NetworkScanRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The scan started.",
            "headers": {
              "Location": {
                "description": "The scan's URL.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworkScan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/network/scans/{scan_id}": {
      "parameters": [
        {
          "name": "scan_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "maxLength": 64
          }
        }
      ],
      "get": {
        "operationId": "getNetworkScan",
        "summary": "Get a network scan",
        "description": "The scan's status (`running`, `done`, `failed`), phase, progress (0–100) and the devices found so far (all of them once finished; at most 1022). The last 10 scans are kept in memory, not across restarts.",
        "tags": [
          "Network"
        ],
        "security": [
          {
            "apiKey": [
              "network:read"
            ]
          },
          {
            "apiKeyHeader": [
              "network:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "network:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The scan.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworkScan"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/network/devices": {
      "get": {
        "operationId": "listNetworkDevices",
        "summary": "List devices on the local network",
        "description": "The latest known devices: those of the most recent scan, updated with the current neighbour table of the connected subnets (no new traffic is sent). Ordered by IP. `known_camera_id` is the Vigiora camera with this MAC or address when you may view it; `is_known_camera` is true for any camera. Ports, ONVIF and hostnames come from the last scan only.",
        "tags": [
          "Network"
        ],
        "security": [
          {
            "apiKey": [
              "network:read"
            ]
          },
          {
            "apiKeyHeader": [
              "network:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "network:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "vendor",
            "in": "query",
            "description": "Vendor (the short maker name from the IEEE registry) contains this text, case-insensitive.",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "has_port",
            "in": "query",
            "description": "Only devices with this (allowlisted) port open in the last scan.",
            "schema": {
              "type": "integer",
              "enum": [
                80,
                443,
                554,
                8000,
                8080,
                8899,
                9000,
                34567,
                37777
              ]
            }
          },
          {
            "name": "unassigned",
            "in": "query",
            "description": "`true`: only devices no Vigiora camera uses; `false`: only those one does.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of devices.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworkDevicePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/network/lookup": {
      "get": {
        "operationId": "lookupNetworkAddress",
        "summary": "Find the current IP of a MAC (or the MAC of an IP)",
        "description": "`?mac=` resolves the address a MAC has now: the neighbour table when that entry still answers (`source: neighbor`), else a sweep of the connected subnets in small chunks that stops as soon as the MAC answers (`source: sweep`; up to about 20 seconds). MACs may be written `aa:bb:cc:dd:ee:ff`, `AA-BB-CC-DD-EE-FF`, `aabb.ccdd.eeff` or `aabbccddeeff`; the answer is lower-case with colons. `?ip=` (a private address in a connected subnet) gives that host's MAC. Give exactly one. Not on the network: `404 not_found`. At most 30 lookups a minute per credential; a sweep yields to camera following and lookup sweeps share a budget of 4 per 10 minutes per server (`503 network_busy` with `Retry-After`). Not read-only for MCP clients: a lookup may probe the LAN.",
        "tags": [
          "Network"
        ],
        "security": [
          {
            "apiKey": [
              "network:read"
            ]
          },
          {
            "apiKeyHeader": [
              "network:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "network:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-read-only": false,
        "parameters": [
          {
            "name": "mac",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 32
            }
          },
          {
            "name": "ip",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 15
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The device.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworkLookup"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/network/auto-scan": {
      "get": {
        "operationId": "getAutoScan",
        "summary": "Get the automatic network scan settings",
        "description": "Automatic scanning for new cameras: whether it is on (`enabled`; on by default on a self-hosted server), how often it runs (`interval_minutes`, one of `interval_choices`), the last run and its summary (devices found, how many are cameras already, new cameras ready for the setup wizard, possible cameras), the next planned run and, while a scan of it runs, `running`, `scan_id` and `progress`. Each run is an ordinary network scan (same rules and limits as `POST /network/actions/scan`) started about 2 minutes after the server starts and then every interval plus a small random delay. A run is skipped quietly while another scan runs, camera following needs the LAN (retried after 5 minutes) or discovery cannot work here (`last_skipped`). On a hosted server, or when discovery cannot work here, this still answers `200` with `available: false` and `unavailable_reason` (as `details.reason` of `network_unavailable`); a hosted server is always `enabled: false`.",
        "tags": [
          "Network"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The automatic scan settings and state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoScan"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateAutoScan",
        "summary": "Turn automatic network scanning on or off",
        "description": "Sets `enabled` and/or `interval_minutes` (15, 30, 60, 180 or 720) and answers the new state. Turning it on (or changing the interval) plans the next run one interval after the last one, at least a minute from now. Emits `settings.changed` (`data.resource: network.auto_scan`). A hosted server refuses with `409 network_unavailable` (`details.reason: hosted`). Admins only.",
        "tags": [
          "Network"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoScanUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The automatic scan settings and state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoScan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/network/auto-scan/actions/run": {
      "post": {
        "operationId": "runAutoScan",
        "summary": "Scan the network for new cameras now",
        "description": "Runs the automatic scan now, whether the schedule is on or off (\"Scan now\"), and answers `202` with the scan's id. Follow it with `GET /network/scans/{scan_id}` (progress) or `GET /network/auto-scan` (`running`, then `last_run` and `last_summary` once its devices are processed); then `GET /network/candidates`. New cameras are announced like scheduled ones (`network.camera_found`). Same limits as `POST /network/actions/scan`: one scan at a time (`409 scan_in_progress` with `details.scan_id`), camera following first (`503 network_busy`), 2 scans a minute per credential, `409 network_unavailable` when discovery cannot work here.",
        "tags": [
          "Network"
        ],
        "security": [
          {
            "apiKey": [
              "network:read"
            ]
          },
          {
            "apiKeyHeader": [
              "network:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "network:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "202": {
            "description": "The scan started.",
            "headers": {
              "Location": {
                "description": "The scan's URL.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoScanStarted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/network/candidates": {
      "get": {
        "operationId": "listCameraCandidates",
        "summary": "List new cameras found on the network",
        "description": "Devices the scans found (by MAC) that look like a camera and are not one yet (no Vigiora camera has their MAC or address) and were not dismissed. `confidence`: `high` (answers ONVIF or has RTSP port 554 open), `medium` (a camera maker's MAC with a port open, or ONVIF port 8899 open) — both `wizard_ready`: offer the setup wizard's Connect step for them —, or `low` (\"possible camera\": Reolink's port 9000 open without RTSP, unless the MAC's maker is a computer, phone, router or NAS maker such as Apple — the Reolink desktop app opens 9000 too —, or a camera maker's or a Wi-Fi camera chip maker's MAC, such as iComm Semiconductor, with no camera port open; `hint` and `hint_code` say what to turn on, then scan again). `reasons` lists the signals (`onvif`, `rtsp_open`, `onvif_port_open`, `reolink_port_open`, `camera_vendor`, `camera_chip`). Ordered by confidence, then IP. Only devices still on the network are listed: one that the latest scans did not see (more than one scan interval plus 10 minutes before the newest sighting) is left out until a scan sees it again. Devices not seen for 7 days are forgotten (at most 5000 are kept). Random (locally administered) MACs count only with a camera port open or an ONVIF answer.",
        "tags": [
          "Network"
        ],
        "security": [
          {
            "apiKey": [
              "network:read"
            ]
          },
          {
            "apiKeyHeader": [
              "network:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "network:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "wizard_ready",
            "in": "query",
            "description": "`true`: only `high` and `medium` candidates; `false`: only `low` ones.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of candidates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworkCandidatePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/network/candidates/{candidate_id}/actions/dismiss": {
      "parameters": [
        {
          "name": "candidate_id",
          "in": "path",
          "required": true,
          "description": "The candidate's `id`, its MAC (`aa:bb:cc:dd:ee:ff`; other common spellings accepted).",
          "schema": {
            "type": "string",
            "maxLength": 32
          }
        }
      ],
      "post": {
        "operationId": "dismissCameraCandidate",
        "summary": "Ignore a device found on the network",
        "description": "Hides the device from the candidates and from new-camera announcements (\"Ignore this device\"). It is announced again only if it disappears from the network for 7 days (and is forgotten) and then comes back. Unknown MAC: `404 not_found`.",
        "tags": [
          "Network"
        ],
        "security": [
          {
            "apiKey": [
              "network:read"
            ]
          },
          {
            "apiKeyHeader": [
              "network:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "network:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-destructive": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Dismissed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CandidateDismissal"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/network/devices/actions/move-to-dhcp": {
      "post": {
        "operationId": "moveDeviceToDHCP",
        "summary": "Move a camera from a conflicting static address to DHCP",
        "description": "For a new camera found with `ip_conflict` (on its factory static address while another device holds that address). Answers `202` with a job to poll (`GET /network/dhcp-moves/{job_id}`). The job pins a neighbour entry for the camera's MAC at that address (so the server's packets reach the camera, not the other device), reads who answers (`device_info`: it must be the camera's MAC), switches it to DHCP (Hikvision and EZVIZ over ISAPI, Dahua and Amcrest over their CGI), reboots it, waits up to 2 minutes for its next discovery reply and reports `new_ip`; then detect it there (`POST /cameras/actions/detect`). The credentials are the camera's own and are never stored or returned. Admins only; one move per camera at a time (`409 conflict`). A server without CAP_NET_ADMIN cannot pin the entry: the job ends `failed` with `needs_privilege` and the one command to run on the server (`sudo ip neigh replace …`), after which the same request succeeds. API 1.28.0.",
        "tags": [
          "Network"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DHCPMoveRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The move started.",
            "headers": {
              "Location": {
                "description": "The job's URL.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DHCPMove"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/network/dhcp-moves/{job_id}": {
      "parameters": [
        {
          "name": "job_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "maxLength": 64
          }
        }
      ],
      "get": {
        "operationId": "getDHCPMove",
        "summary": "Poll a move to DHCP",
        "description": "The job of `POST /network/devices/actions/move-to-dhcp`; kept for an hour after it ends. API 1.28.0.",
        "tags": [
          "Network"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DHCPMove"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/qr-codes": {
      "get": {
        "operationId": "listQRCodes",
        "summary": "List QR code reads",
        "description": "The QR codes the cameras read in their video (API 1.84.0), newest first, on cameras the caller may view. Every camera with server motion detection reads the codes it sees while there is motion (a pass held up, a parcel label at the door, an asset tag), on the server CPU, at most once a second, and records the same code once a minute per camera. A code needs about 75-100 px across in the picture: within 1-2 m of a 1080p wide camera. Each read is also an alert labelled `qr:<payload>` (the payload cut to the label's 64 characters; `alert_id`), so a label alert rule on `qr:<payload>` fires when that code is shown. Internal floor-plan walkthrough beacons (`vigiora-wt:…`) are not alerts and are listed only with `include_internal=true`.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Only codes whose text contains this (case-insensitive).",
            "schema": {
              "type": "string",
              "maxLength": 256
            }
          },
          {
            "name": "include_internal",
            "in": "query",
            "description": "Also list the internal walkthrough beacons (default false).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Seen at or after (inclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Seen before (exclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of QR code reads.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QRCodeReadPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alerts": {
      "get": {
        "operationId": "listAlerts",
        "summary": "List alerts",
        "description": "Detections on cameras the caller may view, newest first. Filter with `is_alert=true` for alerts only (labels promoted by the camera's alert rules).",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "label",
            "in": "query",
            "description": "Exact label (`person`, `car`, …). `face` matches every recognised face (`face:<name>`); `qr` every QR code read (`qr:<payload>`, API 1.84.0).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "acknowledged",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "is_alert",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "Only alerts reported by this external system (`POST /alerts`).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Detected at or after (inclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Detected before (exclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of alerts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createAlert",
        "summary": "Report an alert",
        "description": "Ingests an alert from an external system (a sensor, an analytics product) on one of this server's cameras: operator permission on the camera. `source` names the reporting system and is returned on the alert (and filterable with `GET /alerts?source=`). The alert appears in lists, Briefing and the event stream (`alert.created`, and webhooks) like the server's own detections; the camera's alert rules decide `is_alert`. Labels starting `face:`, `plate:`, `qr:` or `analytics:` (any case for the last three) are reserved. Retry safely with `Idempotency-Key`. An alert whose `bbox` centre is inside one of the camera's privacy masks is not stored: the answer is 200 with `dropped: privacy_mask` (API 1.108.0).",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Not stored, because the box centre is inside a privacy mask of the camera.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertDropped"
                }
              }
            }
          },
          "201": {
            "description": "The alert.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alerts/actions/acknowledge": {
      "post": {
        "operationId": "acknowledgeAlerts",
        "summary": "Acknowledge alerts in bulk",
        "description": "Either `ids` (at most 500; ids you cannot see are reported in `not_found_ids`, ids on cameras where you lack operator permission in `forbidden_ids`), or `before` (every unacknowledged alert detected before that time on cameras where you have operator permission, optionally one `camera_id`).",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkAcknowledge"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was acknowledged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkAcknowledgeResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alerts/{alert_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AlertId"
        }
      ],
      "get": {
        "operationId": "getAlert",
        "summary": "Get an alert",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The alert.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteAlert",
        "summary": "Delete an alert",
        "description": "Deletes the alert and its snapshot; with `delete_recording=true` also the recording segment that covers it (evidence: audited).",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "name": "delete_recording",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alerts/{alert_id}/snapshot": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AlertId"
        }
      ],
      "get": {
        "operationId": "getAlertSnapshot",
        "summary": "Alert snapshot",
        "description": "The JPEG saved with the detection (`has_snapshot`). Not served through a Cloudflare Tunnel origin. With `width`, a downscaled JPEG (aspect kept), cached by the browser (`private, max-age=604800, immutable`, with an `ETag`).",
        "tags": [
          "Alerts"
        ],
        "parameters": [
          {
            "name": "width",
            "in": "query",
            "required": false,
            "description": "Thumbnail width in pixels (160, 320 or 640); `full` or absent is the original. A source no wider than `width` is sent as is.",
            "schema": {
              "type": "string",
              "enum": [
                "160",
                "320",
                "640",
                "full"
              ]
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "JPEG image.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alerts/{alert_id}/actions/acknowledge": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AlertId"
        }
      ],
      "post": {
        "operationId": "acknowledgeAlert",
        "summary": "Acknowledge an alert",
        "description": "Needs operator permission on the alert's camera (alerts without a camera need an admin).",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The alert.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alerts/{alert_id}/actions/unacknowledge": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AlertId"
        }
      ],
      "post": {
        "operationId": "unacknowledgeAlert",
        "summary": "Reopen an alert",
        "description": "Marks an acknowledged alert as not acknowledged again (`alert.unacknowledged`). Needs operator permission on the alert's camera (alerts without a camera need an admin).",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The alert.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/faces": {
      "get": {
        "operationId": "listFaces",
        "summary": "List faces",
        "description": "Recognised faces of cameras the caller may view (faces without a camera: admins only), newest first: enrolled faces and, as `pending`, faces seen in the last 24 hours that are not enrolled (their id is `det-<alert id>`).",
        "tags": [
          "Faces"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "pending",
            "in": "query",
            "description": "Only pending (`true`) or enrolled (`false`) faces.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of faces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/faces/{face_id}/photo": {
      "parameters": [
        {
          "$ref": "#/components/parameters/FaceId"
        }
      ],
      "get": {
        "operationId": "getFacePhoto",
        "summary": "Face photo",
        "description": "The face's JPEG (`has_photo`). Not served through a Cloudflare Tunnel origin.",
        "tags": [
          "Faces"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "JPEG image.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/faces/{face_id}/crop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/FaceId"
        }
      ],
      "get": {
        "operationId": "getFaceCrop",
        "summary": "Face crop",
        "description": "The face itself, as the camera's face runner cut it from the frame (`has_crop`; pending faces only, API 1.33.2). Not served through a Cloudflare Tunnel origin.",
        "tags": [
          "Faces"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "JPEG image.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/recordings": {
      "get": {
        "operationId": "listRecordings",
        "summary": "List recordings",
        "description": "Segments on cameras the caller may view, oldest first. With `from`/`to`, the segments that overlap `[from, to)`.",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of recordings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/recordings/{recording_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RecordingId"
        }
      ],
      "get": {
        "operationId": "getRecording",
        "summary": "Get a recording",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The recording.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recording"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/recordings/{recording_id}/media": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RecordingId"
        }
      ],
      "get": {
        "operationId": "getRecordingMedia",
        "summary": "Play a recording",
        "description": "The segment as MP4 (`Range` requests honoured; `download=true` adds a `Content-Disposition` attachment). This is the playback URL of a recording (`media_url`); send the same credentials as for any call. Not served through a Cloudflare Tunnel origin. Through the cloud gateway of a free plan, a used-up remote-video allowance answers `429 relay_limit` (`details.reason` is the gateway's code).",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "download",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "Range",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "MP4 video.",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "Partial MP4 content.",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/recordings/{recording_id}/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RecordingId"
        }
      ],
      "get": {
        "operationId": "getRecordingPreview",
        "summary": "Get a recording's scrubbing pictures",
        "description": "API 1.116.0. The recording's preview sprite: one JPEG with a picture (160 px wide) every `X-Vigiora-Preview-Interval` seconds, `X-Vigiora-Preview-Columns` per row, `X-Vigiora-Preview-Count` in all, each `X-Vigiora-Preview-Tile-Width` × `X-Vigiora-Preview-Tile-Height` pixels (picture `k` is the moment `start + k × interval`, at column `k mod columns`, row `k div columns`). Made when the recording closed, or now on the first request (one pass over the file at low resolution; a busy server answers `503 preview_busy` with `Retry-After`). The camera's privacy masks are painted on every picture; when they cannot be read the sprite is withheld (`503 preview_unavailable`). `404 no_preview` for a recording without pictures (a microphone) or one still being written. Cached by the browser (`private, max-age=86400`, with an `ETag` that changes with the recording and the masks). Not served through a Cloudflare Tunnel origin.",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-mcp": false,
        "responses": {
          "200": {
            "description": "JPEG sprite.",
            "headers": {
              "X-Vigiora-Preview-Interval": {
                "description": "Seconds between two pictures.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Vigiora-Preview-Columns": {
                "description": "Pictures per row.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Vigiora-Preview-Count": {
                "description": "Pictures in the sprite.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Vigiora-Preview-Tile-Width": {
                "description": "Width of one picture in pixels.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Vigiora-Preview-Tile-Height": {
                "description": "Height of one picture in pixels.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "description": "Not modified (`If-None-Match`)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/recordings/{recording_id}/actions/protect": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RecordingId"
        }
      ],
      "post": {
        "operationId": "protectRecording",
        "summary": "Protect a recording",
        "description": "A protected recording is never deleted by retention (nor with an alert's clip) until unprotected. Needs operator permission on its camera. Protected recordings may use at most a share of the recordings disk (20 % by default) so they can never stop recording; past it `409 protect_limit`, and on a critically low disk `507 disk_low` (existing protections stay).",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The recording.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recording"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "507": {
            "$ref": "#/components/responses/InsufficientStorage"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/recordings/{recording_id}/actions/unprotect": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RecordingId"
        }
      ],
      "post": {
        "operationId": "unprotectRecording",
        "summary": "Unprotect a recording",
        "description": "Retention applies again (a recording past its camera's retention goes at the next sweep).",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The recording.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recording"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clips": {
      "get": {
        "operationId": "listClips",
        "summary": "List clips",
        "description": "Your clip exports on cameras you may still view (admins see every clip), newest first. `from`/`to` select clips whose requested footage overlaps `[from, to)`. Clips are kept 24 hours after they finish (longer while a share link is live).",
        "tags": [
          "Clips"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "running",
                "ready",
                "failed"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of clips.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClipPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createClip",
        "summary": "Export a clip",
        "description": "Starts cutting `[from, to)` (at most 30 minutes) of a camera's recordings into one MP4. Answers\n`202` with the job; poll `GET /api/v1/clips/{clip_id}` until `status` is `ready` or `failed`. Ready clips\nare kept 24 hours (longer while a share link is live). A window the camera kept in HD (`record_hd_on_motion`:\nthe HD clips hold all of it) is cut from the HD footage; any other window from the continuous recording\n(API 1.100.0).\n\nSince 1.43.0 `kind: mosaic` exports one video of 2–9 cameras (`camera_ids`, tile order) as tiles\nsynchronised on wall-clock time: 1920×1080 for up to 4 tiles, 2560×1440 for more, 15 fps, re-encoded\n(H.264), no audio. Tiles are arranged by `layout` cells (the saved layout's grid) when given, else in `cols`\ncolumns (0: the smallest square-ish grid). A camera without footage for part of the window shows a dark\ntile then; a camera without any footage is a dark tile with \"No recording\". `labels` (default true) draws\neach camera's name on its tile when the server's ffmpeg can (`mosaic_labels` of the preflight says so). A\nmosaic counts as one clip against the quotas; its size estimate is half the sum of its cameras' clip\nestimates. Every camera must be viewable by the caller (else `404`).\n\nSince 1.109.0 `kind: timelapse` samples one camera's recordings over `[from, to)` of up to 7 days into one\nMP4 of `length_seconds` (30, 60, 120 or 300): the recordings are joined, gaps are skipped, and one frame is\ntaken at an even interval of the footage that exists (keyframes only when the interval is long enough, to keep\nthe CPU low). The camera's local time is burned into the bottom-right corner (in the camera's time zone, when\nthe server's ffmpeg can draw text). Footage shorter than `length_seconds` is `422 timelapse_too_short`; a\nrange over 7 days is `422 timelapse_too_long`. Only one timelapse is made at a time on a server\n(`429 timelapse_busy`, with `Retry-After`); it also holds one of the clip slots. `DELETE /api/v1/clips/{clip_id}`\ncancels a running one. The output is listed with the other clips and kept as long as they are (24 hours).",
        "tags": [
          "Clips"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClipCreate"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The export job.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Clip"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "507": {
            "$ref": "#/components/responses/InsufficientStorage"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clips/{clip_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClipId"
        }
      ],
      "get": {
        "operationId": "getClip",
        "summary": "Get a clip",
        "description": "Your own clips (admins: any) while you may still view the camera.",
        "tags": [
          "Clips"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The clip.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Clip"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteClip",
        "summary": "Delete a clip",
        "description": "Deletes the file and every share link to it.",
        "tags": [
          "Clips"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clips/{clip_id}/actions/create-download-url": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClipId"
        }
      ],
      "post": {
        "operationId": "createClipDownloadURL",
        "summary": "Get a download URL",
        "description": "A single-use URL (a path on this server) that downloads the ready clip without credentials, valid for 60 seconds. `409 clip_not_ready` until the export is ready.",
        "tags": [
          "Clips"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadURL"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clips/{clip_id}/shares": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClipId"
        }
      ],
      "get": {
        "operationId": "listClipShares",
        "summary": "List a clip's share links",
        "description": "Every link of the clip (active, expired and revoked). One page; `next_cursor` is always `null`. The link URLs are not returned (only creation returns them). Needs `clips:share`, like creating and revoking.",
        "tags": [
          "Clips"
        ],
        "security": [
          {
            "apiKey": [
              "clips:share"
            ]
          },
          {
            "apiKeyHeader": [
              "clips:share"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "clips:share"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The links.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharePage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createClipShare",
        "summary": "Create a public share link",
        "description": "A public link (no sign-in) to the ready clip, expiring after `expires_in` (and never later than 7 days after the clip finished). The URL is returned only here. Needs the `clips:share` scope, which no other scope implies. A link created with an API key lives no longer than the key (it is revoked when the key is revoked and expires when the key expires).",
        "tags": [
          "Clips"
        ],
        "security": [
          {
            "apiKey": [
              "clips:share"
            ]
          },
          {
            "apiKeyHeader": [
              "clips:share"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "clips:share"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShareCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The link, with its URL.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareCreated"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clips/{clip_id}/shares/{share_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClipId"
        },
        {
          "$ref": "#/components/parameters/ShareId"
        }
      ],
      "delete": {
        "operationId": "revokeClipShare",
        "summary": "Revoke a share link",
        "tags": [
          "Clips"
        ],
        "security": [
          {
            "apiKey": [
              "clips:share"
            ]
          },
          {
            "apiKeyHeader": [
              "clips:share"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "clips:share"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "204": {
            "description": "Revoked."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/live-shares": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listCameraLiveShares",
        "summary": "List a camera's live share links",
        "description": "API 1.109.0. Every live share link of the camera (active, expired and revoked), newest first, with when\nit was last used and how many people are watching now. One page; `next_cursor` is always `null`. The link\nURLs and codes are not returned (only creation returns them). Admins and operators; the caller needs the\noperator permission on the camera. Needs `clips:share`.",
        "tags": [
          "Clips"
        ],
        "security": [
          {
            "apiKey": [
              "clips:share"
            ]
          },
          {
            "apiKeyHeader": [
              "clips:share"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "clips:share"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The links.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveSharePage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createCameraLiveShare",
        "summary": "Create a live share link",
        "description": "API 1.109.0. Makes a public link to this ONE camera's live view for `expires_in` (`1h`, `1d` by default, or\n`7d`). Anyone with the URL AND the 6-digit `code` watches the live picture in a browser without an account;\nnothing else is reachable through it (no other camera, no recordings or playback, no PTZ, no talking, no other\nAPI). Both are returned only here: the server keeps only hashes, so a lost link is revoked and made again.\nThe code is checked on the server: 5 wrong codes lock the link for 15 minutes (`locked_until`). At most 5\npeople watch one link at a time. Expiry and revoking are enforced on every request and cut people already\nwatching. The link also stops working if its creator is disabled or loses the operator role or the operator\npermission on the camera. The page and stream also work through remote access (the site address, the\nCloudflare Tunnel's media address for video). Admins and operators with the operator permission on the camera.\nNeeds the `clips:share` scope, which no other scope implies. A link created with an API key lives no longer\nthan the key. Creating one asks the person first when human in the loop is on.",
        "tags": [
          "Clips"
        ],
        "security": [
          {
            "apiKey": [
              "clips:share"
            ]
          },
          {
            "apiKeyHeader": [
              "clips:share"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "clips:share"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LiveShareCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The link, with its URL and code.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveShareCreated"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/live-shares/{live_share_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "$ref": "#/components/parameters/LiveShareId"
        }
      ],
      "delete": {
        "operationId": "revokeCameraLiveShare",
        "summary": "Revoke a live share link",
        "description": "API 1.109.0. Ends the link now and cuts everyone watching through it.",
        "tags": [
          "Clips"
        ],
        "security": [
          {
            "apiKey": [
              "clips:share"
            ]
          },
          {
            "apiKeyHeader": [
              "clips:share"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "clips:share"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "204": {
            "description": "Revoked."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/api-keys": {
      "get": {
        "operationId": "listAPIKeys",
        "summary": "List API keys",
        "description": "Your keys, newest first. Admins may pass `user_id` (one user) or `all_users=true`. Legacy keys (`scoped: false`) show their implicit scopes.",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "user_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "all_users",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of keys.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKeyPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createAPIKey",
        "summary": "Create an API key",
        "description": "Creates a scoped key for yourself. The full key is in the response only once. `admin`, `users:read`, `users:write` and `settings:write` need the admin role. At most 20 active keys per user (`409 conflict`).",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": "unsupported",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/APIKeyCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The key, with its secret.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKeyCreated"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/api-keys/{key_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/KeyId"
        }
      ],
      "get": {
        "operationId": "getAPIKey",
        "summary": "Get an API key",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKey"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateAPIKey",
        "summary": "Change an API key",
        "description": "Sets the key's human-in-the-loop override for AI agents (`inherit`, `on`, `off`). Your own keys, or any key for an admin; `off` needs an admin while the server setting is on (`403 forbidden`).",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/APIKeyUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKey"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "revokeAPIKey",
        "summary": "Revoke an API key",
        "description": "Revokes at once (keys are never hard-deleted). Requests in flight with the key end within 30 seconds. Revoking a revoked key is a no-op.",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "204": {
            "description": "Revoked."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/events": {
      "get": {
        "operationId": "listEvents",
        "summary": "List events",
        "description": "The event log (7 days), oldest first; page forward with the cursor. Visibility as for the stream. `from` is inclusive, `to` exclusive.",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "apiKey": [
              "events:read"
            ]
          },
          {
            "apiKeyHeader": [
              "events:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "events:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "types",
            "in": "query",
            "description": "Comma-separated event types.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "camera_ids",
            "in": "query",
            "description": "Comma-separated camera ids (at most 100).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of events.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/events/stream": {
      "get": {
        "operationId": "streamEvents",
        "summary": "Stream events (SSE)",
        "description": "Server-Sent Events: see Events in the description. Filters as for the list.",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "apiKey": [
              "events:read"
            ]
          },
          {
            "apiKeyHeader": [
              "events:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "events:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "types",
            "in": "query",
            "description": "Comma-separated event types.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "camera_ids",
            "in": "query",
            "description": "Comma-separated camera ids (at most 100).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "last_event_id",
            "in": "query",
            "description": "Resume after this event (or send the Last-Event-ID header).",
            "schema": {
              "type": "string",
              "minLength": 26,
              "maxLength": 26
            }
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "`v1` (default): the event envelope. `things` (API 1.18.0): the Things envelope (CloudEvents attributes; `event:` is the things type, e.g. `vigiora.motion.started`); `types` still filters by the v1 types.",
            "schema": {
              "type": "string",
              "enum": [
                "v1",
                "things"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The event stream.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/webhooks": {
      "get": {
        "operationId": "listWebhooks",
        "summary": "List webhooks",
        "description": "Every webhook of the server, newest first, each with its newest delivery (`last_delivery_*`). Admins, and operators' sessions (read only; the `webhooks:*` scopes stay admin-only for keys).",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "apiKey": [
              "webhooks:read"
            ]
          },
          {
            "apiKeyHeader": [
              "webhooks:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "webhooks:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of webhooks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createWebhook",
        "summary": "Create a webhook",
        "description": "The signing `secret` is returned only here (and by rotate-secret). At most 50 webhooks per server.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          },
          {
            "apiKeyHeader": [
              "webhooks:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "webhooks:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The webhook, with its secret.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookWithSecret"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/webhooks/{webhook_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WebhookId"
        }
      ],
      "get": {
        "operationId": "getWebhook",
        "summary": "Get a webhook",
        "description": "Never shows the secret.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "apiKey": [
              "webhooks:read"
            ]
          },
          {
            "apiKeyHeader": [
              "webhooks:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "webhooks:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateWebhook",
        "summary": "Update a webhook",
        "description": "Changes only the fields sent. `enabled: true` re-enables a disabled webhook and resets its failure count.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          },
          {
            "apiKeyHeader": [
              "webhooks:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "webhooks:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhook",
        "summary": "Delete a webhook",
        "description": "Deletes it and its delivery log.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          },
          {
            "apiKeyHeader": [
              "webhooks:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "webhooks:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/webhooks/{webhook_id}/actions/rotate-secret": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WebhookId"
        }
      ],
      "post": {
        "operationId": "rotateWebhookSecret",
        "summary": "Rotate the signing secret",
        "description": "A new secret takes effect at once and is returned only here.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          },
          {
            "apiKeyHeader": [
              "webhooks:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "webhooks:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The webhook, with its new secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookWithSecret"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/webhooks/{webhook_id}/actions/test": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WebhookId"
        }
      ],
      "post": {
        "operationId": "testWebhook",
        "summary": "Send a test event",
        "description": "Sends a `webhook.test` event now (one attempt, no retries) and returns the delivery. A disabled webhook answers `409 conflict`.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          },
          {
            "apiKeyHeader": [
              "webhooks:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "webhooks:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivery"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/webhooks/{webhook_id}/deliveries": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WebhookId"
        }
      ],
      "get": {
        "operationId": "listWebhookDeliveries",
        "summary": "Delivery log",
        "description": "The webhooks deliveries (14 days), newest first.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "apiKey": [
              "webhooks:read"
            ]
          },
          {
            "apiKeyHeader": [
              "webhooks:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "webhooks:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "delivering",
                "succeeded",
                "failed",
                "held"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/webhooks/{webhook_id}/deliveries/{delivery_id}/actions/redeliver": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WebhookId"
        },
        {
          "$ref": "#/components/parameters/DeliveryId"
        }
      ],
      "post": {
        "operationId": "redeliverWebhook",
        "summary": "Redeliver",
        "description": "Queues the same payload again as a new delivery, due at once (with its own retries).",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "apiKey": [
              "webhooks:write"
            ]
          },
          {
            "apiKeyHeader": [
              "webhooks:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "webhooks:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "202": {
            "description": "The new delivery.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivery"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/entries": {
      "get": {
        "operationId": "listGuardianEntries",
        "summary": "List Guardian entries",
        "description": "The Guardian log (what the AI saw and heard) of cameras the caller may view, newest first (by `occurred_at`). `description` is plain text in the requested language (`lang`, else `Accept-Language`, else English); `descriptions` has every language.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Lang"
          },
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "At or after (inclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Before (exclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of entries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianEntryPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/entries/{entry_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/EntryId"
        }
      ],
      "get": {
        "operationId": "getGuardianEntry",
        "summary": "Get a Guardian entry",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "The entry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianEntry"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteGuardianEntry",
        "summary": "Delete a Guardian entry",
        "description": "Moves the entry to Recently deleted (`GET /api/v1/guardian/trash`): the entry, its clip and frame (with their cached thumbnail sizes), its search index and object-detection context, the alerts Guardian raised for it and their acknowledgements and \"Reviewed\" marks. It disappears from every list, feed and search at once and can be restored until it is purged (`retention_days`, default 7). The camera's continuous recordings are never deleted. An entry whose clip a protected recording covers answers `409 entry_protected`; one inside an active clip export or public share link `409 entry_shared` (`details`: `reasons`, `recording_ids`, `clip_ids`, `share_ids`). An admin can delete it anyway with `force=true`, which also revokes those share links. Audited. API 1.19.0.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "name": "force",
            "in": "query",
            "description": "Admins only. Delete even when the clip is protected or shared, revoking its share links.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Moved to Recently deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/entries/actions/delete": {
      "post": {
        "operationId": "deleteGuardianEntries",
        "summary": "Delete Guardian entries in bulk",
        "description": "Deletes up to 200 entries as `DELETE /api/v1/guardian/entries/{entry_id}` does, each on its own: the ones deleted are in `succeeded`, the others in `failed` with the error code they would have answered alone (`not_found`, `forbidden`, `entry_protected`, `entry_shared`). `force` is for admins only. API 1.19.0.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GuardianDeleteIds"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was done, per id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianBulkResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/trash": {
      "get": {
        "operationId": "listGuardianTrash",
        "summary": "List recently deleted Guardian entries",
        "description": "Entries deleted from cameras where you have operator permission, newest deletion first, with who deleted them and when they will be purged (`purge_at`). API 1.19.0.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Lang"
          },
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of deleted entries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianTrashPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/trash/settings": {
      "get": {
        "operationId": "getGuardianTrashSettings",
        "summary": "Recently deleted settings",
        "description": "How many days deleted Guardian entries stay restorable before they are purged. API 1.19.0.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianTrashSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateGuardianTrashSettings",
        "summary": "Change the Recently deleted settings",
        "description": "Sets `retention_days` (1–90); it applies to entries already deleted too. Audited. API 1.19.0.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GuardianTrashSettings"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianTrashSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/trash/{entry_id}/frame": {
      "parameters": [
        {
          "$ref": "#/components/parameters/EntryId"
        }
      ],
      "get": {
        "operationId": "getGuardianTrashFrame",
        "summary": "Get a deleted Guardian entry's frame",
        "description": "The frame of a recently deleted entry, for a preview before restoring it. API 1.19.0.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "w",
            "in": "query",
            "description": "A smaller JPEG this many pixels wide (160, 320 or 640), or `full` (default).",
            "schema": {
              "type": "string",
              "enum": [
                "160",
                "320",
                "640",
                "full"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The JPEG.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/trash/actions/restore": {
      "post": {
        "operationId": "restoreGuardianEntries",
        "summary": "Restore deleted Guardian entries",
        "description": "Puts up to 200 recently deleted entries back, with their ids, clip, frame and alerts. An entry whose camera was deleted cannot be restored (`conflict`). Audited. API 1.19.0.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GuardianTrashIds"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was done, per id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianBulkResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/trash/actions/purge": {
      "post": {
        "operationId": "purgeGuardianEntries",
        "summary": "Permanently delete recently deleted entries",
        "description": "Removes up to 200 entries from Recently deleted for good, with their files (\"Delete permanently now\"). It cannot be undone. Audited. API 1.19.0.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GuardianTrashIds"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was done, per id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianBulkResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/search": {
      "get": {
        "operationId": "searchGuardian",
        "summary": "Search the Guardian log",
        "description": "Finds entries by meaning (semantic search through the Vigiora AI gateway, `match: semantic` with a `similarity`) or, when that is unavailable or finds nothing, by keyword (`match: keyword`), on cameras the caller may view. One ranked page: `next_cursor` is always `null`.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Lang"
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "What to look for (at most 500 characters).",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of hits, 1–50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The hits, best first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianSearchHitPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/chat": {
      "post": {
        "operationId": "guardianChat",
        "summary": "Ask Guardian",
        "description": "Asks Guardian (the AI assistant of the web app) a question about what the cameras saw: it answers from the Guardian log, alerts and counts of cameras the caller may view, using the tools listed in `tool_calls`. `camera_id` focuses the question on one camera; `conversation_id` (one of your conversations in the web app) stores the exchange there. Uses AI credits (`402 insufficient_credits` when they ran out); at most 10 chats a minute and 2 AI operations at once per credential (`429 rate_limited`); no control characters or line breaks in the text; `503 service_unavailable` when AI is not available. When the server uses the owner's own AI model (`GET /system/ai-model`) and that model fails, the `503` says why in `message`, with `details.reason` one of `own_model_timeout`, `own_model_unreachable`, `own_model_error`, `own_model_capability` or `own_model_cancelled`; nothing is sent to Vigiora cloud AI then. Not idempotent: every call asks the AI again. Actions (API 1.113.0): Guardian can also act for admins and operators (sound a camera siren, set up an alert on a camera, control a Home Assistant device). While human in the loop is on (`GET /agent-policy`), and always for locks, alarm panels and sirens of Home Assistant, such an action does not run: it is returned in `pending_actions` and waits up to 5 minutes for the user, who approves or denies it in the Vigiora app (in the conversation given as `conversation_id`). Nothing you send approves it (a `confirm` argument is ignored, also when the AI passes it): approving and denying are user sessions only (`POST /guardian/pending-actions/{pending_id}/actions/approve`), so an agent can never approve its own action.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GuardianChat"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Guardian's answer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianChatReply"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/pending-actions/{pending_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/GuardianPendingId"
        }
      ],
      "get": {
        "operationId": "getGuardianPendingAction",
        "summary": "A Guardian chat action waiting for approval",
        "description": "One of your actions Guardian chat holds for your approval, and its state (`pending`, `approved`, `failed`, `denied`, `expired`). Your own only (another user's is `404`). User sessions only. API 1.113.0.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianPendingAction"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/pending-actions/{pending_id}/actions/approve": {
      "parameters": [
        {
          "$ref": "#/components/parameters/GuardianPendingId"
        }
      ],
      "post": {
        "operationId": "approveGuardianPendingAction",
        "summary": "Approve a Guardian chat action",
        "description": "Runs the action once, with its stored arguments, as you: your role and camera permissions are checked again now (a user demoted or disabled since is `403`). `409 conflict` when it expired (`reason: pending_action_expired`), was already decided (`pending_action_decided`) or `args_hash` is not the stored one (`pending_action_changed`). The outcome is added to the conversation. User sessions only: an agent can never approve its own action. API 1.113.0. Admins and operators.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GuardianPendingApprove"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The decision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianPendingDecision"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/pending-actions/{pending_id}/actions/deny": {
      "parameters": [
        {
          "$ref": "#/components/parameters/GuardianPendingId"
        }
      ],
      "post": {
        "operationId": "denyGuardianPendingAction",
        "summary": "Deny a Guardian chat action",
        "description": "Drops the action; nothing runs. The outcome is added to the conversation. User sessions only. API 1.113.0.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The decision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianPendingDecision"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/automations": {
      "get": {
        "operationId": "listAutomations",
        "summary": "List automations",
        "description": "The automations drawn on the Automations page, newest first: each one's name, on/off switch, graph (triggers, conditions and actions joined by wires), whether it has sensitive actions and whether an admin confirmed them, and its last run. The webhook secret is never shown. API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of automations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createAutomation",
        "summary": "Create an automation",
        "description": "Stores an automation. The graph is checked first (`400 validation_error`, `details.problems` lists each problem in plain words with its `node_id` and `field`): at least one trigger, at most 40 steps, no loop, every step reachable from a trigger, every step type known (`GET /automations/node-types`) and every setting valid; cameras must exist and devices must be shared with Vigiora. `enabled` defaults to true. An automation with sensitive actions (unlock a door, open a garage door, arm or disarm the alarm, a siren) cannot be turned on until an admin confirms it (`409 conflict`, `details.reason` `sensitive_confirmation_required`): an admin signed in may pass `confirm_sensitive: true` (`403 forbidden` for anyone else). A graph with a webhook trigger gets a secret web address, returned once in `webhook_path` (POST to it on the LAN to run the automation). At most 200 automations (`409 conflict`). It makes the server act by itself, so it needs confirmation from an AI agent. API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The automation (with its webhook path, shown this once).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationWithWebhook"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/automations/node-types": {
      "get": {
        "operationId": "listAutomationNodeTypes",
        "summary": "List the steps an automation can use",
        "description": "The palette of the automation editor: every trigger, condition and action type with its settings (name, type, whether it is required, bounds, choices, default). `wired: false` marks a type the server shows but cannot run yet. `sensitive_reasons` words each reason an automation needs an admin's confirmation. API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The node types.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationNodeTypes"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/automations/actions/validate": {
      "post": {
        "operationId": "validateAutomation",
        "summary": "Check an automation's graph",
        "description": "Checks a graph without storing it, as create and update would, and answers the problems in plain words (an empty list when it is valid) and the reasons it would need an admin's confirmation. API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationValidate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationProblems"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/automations/actions/import": {
      "post": {
        "operationId": "importAutomation",
        "summary": "Create an automation from a blueprint",
        "description": "Answers a blueprint's questions and stores the automation. Send `blueprint_id` (a built-in blueprint, GET /automations/blueprints) or `blueprint` (a blueprint file, at most 256 KB, checked as untrusted input) with `answers` (input key to a camera id, a device key, a text or true/false). Wrong or missing answers and an invalid graph give `400 validation_error` with `details.problems`. An automation with sensitive actions is saved switched off unless an admin signed in passes `confirm_sensitive: true`. It makes the server act by itself, so it needs confirmation from an AI agent. API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationImport"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The automation (with its webhook path, shown this once).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationWithWebhook"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/automations/blueprints": {
      "get": {
        "operationId": "listAutomationBlueprints",
        "summary": "Built-in automation blueprints",
        "description": "The blueprints shipped with the server (welcome home, doorbell, camera offline, …), each with its questions and, for camera and device questions, the cameras and devices of this server that fit (`candidates`; a device commanded by the automation must be shared for control). `sensitive` is true when the blueprint can unlock, open a garage door, arm or disarm or sound a siren with every optional step on. API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The blueprints.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationBlueprintList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/automations/blueprints/actions/check": {
      "post": {
        "operationId": "checkAutomationBlueprint",
        "summary": "Check a blueprint file",
        "description": "Reads a blueprint file (at most 256 KB; unknown fields, unknown step types and invalid settings are refused with `400 validation_error`) and answers it with its questions and the matching cameras and devices, as GET /automations/blueprints does for the built-in ones. Stores nothing. API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationBlueprintCheck"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The blueprint with its questions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationBlueprintOffer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/automations/{automation_id}": {
      "get": {
        "operationId": "getAutomation",
        "summary": "Read one automation",
        "description": "One automation with its graph. API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/AutomationId"
          }
        ],
        "responses": {
          "200": {
            "description": "The automation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Automation"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateAutomation",
        "summary": "Change an automation",
        "description": "Changes the name, the on/off switch or the whole graph (fields left out keep their value), with the checks of create. Moving steps or renaming keeps an admin's confirmation; changing a sensitive action (another lock, another command) needs a new one before the automation can stay on (`409 conflict`). Adding a webhook trigger makes a web address, returned once in `webhook_path`; removing it deletes the address. It needs confirmation from an AI agent. API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/AutomationId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The automation after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationWithWebhook"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteAutomation",
        "summary": "Delete an automation",
        "description": "Deletes an automation, its web address and its run log. It needs confirmation from an AI agent. API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/AutomationId"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/automations/{automation_id}/actions/run": {
      "post": {
        "operationId": "runAutomation",
        "summary": "Run or test an automation now",
        "description": "Runs an automation by hand, on or off, from its manual trigger (else its first trigger) with a sample of what that trigger would hand over; its conditions still apply. `dry_run: true` acts on nothing: every condition is checked and every action is described (`would_run`), and the run is answered (`200`) and logged as a test. A real run happens in the background (`202`; waits can take minutes) and lands in the run log; `409 conflict` while it is already running. An automation with sensitive actions runs only once an admin confirmed it, and an API key or agent must pass `acknowledge_sensitive: true` after the user approved it (`409 conflict`, `details.reason` `sensitive_confirmation_required`); through MCP that always asks the person. `503 service_unavailable` when the engine is not running. API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:control"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/AutomationId"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationRunRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The dry run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRun"
                }
              }
            }
          },
          "202": {
            "description": "The run started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRunStarted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/automations/{automation_id}/actions/confirm": {
      "post": {
        "operationId": "confirmAutomation",
        "summary": "Confirm an automation's sensitive actions",
        "description": "An admin, signed in, confirms the automation's sensitive actions as they are now (\"This automation can unlock a door\"), so it can be turned on and they run. A later change to a sensitive action needs a new confirmation. Never through an API key or an agent. API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/AutomationId"
          }
        ],
        "responses": {
          "200": {
            "description": "The confirmed automation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Automation"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/automations/{automation_id}/actions/rotate-webhook": {
      "post": {
        "operationId": "rotateAutomationWebhook",
        "summary": "Replace an automation's web address",
        "description": "Makes a new secret web address for the automation's webhook trigger, returned once; the old one stops working. `409 conflict` when the automation has no webhook trigger. The address answers on the server's local network only. It needs confirmation from an AI agent. API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/AutomationId"
          }
        ],
        "responses": {
          "200": {
            "description": "The new address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationWebhook"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/automations/{automation_id}/blueprint": {
      "get": {
        "operationId": "exportAutomation",
        "summary": "Export an automation as a blueprint",
        "description": "The automation as a blueprint file to share: every camera, device, known face, number plate, preset and web address becomes a question for whoever imports it, so nothing of this home is in the file; web addresses are always removed and the webhook token is never included. API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/AutomationId"
          }
        ],
        "responses": {
          "200": {
            "description": "The blueprint file.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationBlueprint"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/automations/{automation_id}/runs": {
      "get": {
        "operationId": "listAutomationRuns",
        "summary": "An automation's run log",
        "description": "The automation's runs, newest first (the last 200 are kept): when, which trigger and what it handed over (short), each step's result (`fired`, `pass`, `fail`, `ok`, `error`, `blocked`, `would_run`) with a plain message and its duration, and the overall result (`ok`, `partial`, `failed`, `not_met`, `no_steps`, `dry_run`). API 1.111.0.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/AutomationId"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRunPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/sites": {
      "get": {
        "operationId": "listSites",
        "summary": "List sites",
        "description": "The site hierarchy (branches and their zones, `parent_id`), by ascending id.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of sites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SitePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createSite",
        "summary": "Create a site",
        "description": "A branch (`parent_id` null) or a zone inside one (two levels). Site grants give groups every camera of a site, so site changes are audited. `settings:write` is granted only to admins' keys; operators use a user session.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SiteCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The site.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Site"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/sites/{site_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SiteId"
        }
      ],
      "get": {
        "operationId": "getSite",
        "summary": "Get a site",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The site.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Site"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateSite",
        "summary": "Update a site",
        "description": "Changes only the fields sent; `parent_id: null` moves a zone to the top level (a site with zones cannot move under another).",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SiteUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The site.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Site"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteSite",
        "summary": "Delete a site",
        "description": "Its cameras and rooms are kept without a site; its zones become top-level, or are deleted too with `cascade=true`.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "name": "cascade",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms": {
      "get": {
        "operationId": "listRooms",
        "summary": "List rooms",
        "description": "Rooms (cameras AI Live watches together) whose every camera the caller may view, by ascending id. Viewers do not see rooms without cameras.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of rooms.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoomPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createRoom",
        "summary": "Create a room",
        "description": "Cameras AI Live watches (and speaks, moves) together. Cameras need operator permission. Needs the admin or operator role and operator permission on every camera of the room. `source: virtual` with `cameras` and `device_entity_ids` makes a virtual room: a collection of cameras and Home Assistant devices from different rooms (API 1.38.0). Rooms with source `plan` are made by the server from room polygons on floor plans (`replaceFloorPlanItems`, `describeFloorPlan`, `syncFloorPlanRooms`).",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoomWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The room.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Room"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "get": {
        "operationId": "getRoom",
        "summary": "Get a room",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The room.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Room"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateRoom",
        "summary": "Update a room",
        "description": "Changes only the fields sent; `cameras` replaces the room's cameras (the ones the floor plan manages stay) and `device_entity_ids` its Home Assistant devices. Renaming a room drawn on a floor plan renames its polygon. `ai_actuation_enabled`, `ai_ptz_enabled` and `ai_speak_enabled` let AI Live move cameras and speak. `speech_microphone` (API 1.115.0) chooses which microphones of the room are sent to speech-to-text: `auto` (the best one, chosen by the server), `all`, or one camera id of the room. Needs the admin or operator role and operator permission on every camera of the room.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoomWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The room.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Room"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteRoom",
        "summary": "Delete a room",
        "description": "Needs the admin or operator role and operator permission on every camera of the room.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/layouts": {
      "get": {
        "operationId": "listLayouts",
        "summary": "List layouts",
        "description": "Saved camera grids: the caller's own and the shared ones, by ascending id. Cells of cameras the caller may not view are left out.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of layouts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LayoutPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createLayout",
        "summary": "Create a layout",
        "description": "A personal camera grid (cameras the caller may view). `settings:write` keys are admins' only; others use a session.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LayoutWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The layout.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Layout"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/layouts/{layout_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LayoutId"
        }
      ],
      "get": {
        "operationId": "getLayout",
        "summary": "Get a layout",
        "description": "Another user's personal layout is `404`.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The layout.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Layout"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateLayout",
        "summary": "Update a layout",
        "description": "The caller's own layouts only (shared layouts are `403`). `cells` replaces the grid.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LayoutWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The layout.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Layout"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteLayout",
        "summary": "Delete a layout",
        "description": "The caller's own layouts only.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/status": {
      "get": {
        "operationId": "getSystemStatus",
        "summary": "Server status",
        "description": "Version, load, disks and totals of the whole server (every camera, not only the caller's).",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/health": {
      "get": {
        "operationId": "getSystemHealth",
        "summary": "Server health",
        "description": "The self-heal watchdog's latest check of the server's components (`monitoring: false` when the watchdog is off). Since API 1.126.0 also the automatic memory profile (`memory_profile`, read-only).",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The health snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemHealth"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/users": {
      "get": {
        "operationId": "listUsers",
        "summary": "List users",
        "description": "Every user, by ascending id. Admins only.",
        "tags": [
          "Users"
        ],
        "security": [
          {
            "apiKey": [
              "users:read"
            ]
          },
          {
            "apiKeyHeader": [
              "users:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "users:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of users.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createUser",
        "summary": "Add a user",
        "description": "Creates a user (password 8-72 bytes, stored as a bcrypt hash and never returned). Role `viewer` by default. Admins only. Audit-logged; emits `user.created`.",
        "tags": [
          "Users"
        ],
        "security": [
          {
            "apiKey": [
              "users:write"
            ]
          },
          {
            "apiKeyHeader": [
              "users:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "users:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The user.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/users/{user_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/UserId"
        }
      ],
      "get": {
        "operationId": "getUser",
        "summary": "Get a user",
        "tags": [
          "Users"
        ],
        "security": [
          {
            "apiKey": [
              "users:read"
            ]
          },
          {
            "apiKeyHeader": [
              "users:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "users:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The user.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateUser",
        "summary": "Change a user",
        "description": "Changes the fields sent (`group_ids` replaces the membership). A new password ends every session of the user. Demoting or disabling the last enabled admin is `409 conflict`. Audit-logged with the changed field names (never values); emits `user.updated`.",
        "tags": [
          "Users"
        ],
        "security": [
          {
            "apiKey": [
              "users:write"
            ]
          },
          {
            "apiKeyHeader": [
              "users:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "users:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The user.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteUser",
        "summary": "Delete a user",
        "description": "Deletes the user with their API keys and webhooks. The last enabled admin cannot be deleted (`409 conflict`). Audit-logged; emits `user.deleted`.",
        "tags": [
          "Users"
        ],
        "security": [
          {
            "apiKey": [
              "users:write"
            ]
          },
          {
            "apiKeyHeader": [
              "users:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "users:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/users/{user_id}/actions/reset-two-factor": {
      "parameters": [
        {
          "$ref": "#/components/parameters/UserId"
        }
      ],
      "post": {
        "operationId": "resetUserTwoFactor",
        "summary": "Turn a user's two-factor sign-in off",
        "description": "For a user who lost their phone and their recovery codes: turns their two-factor sign-in off so the password alone signs in again (they can turn it on again from their account page). Written to the audit log (`user.two_factor.reset`). Answers the user's status after the change (already off: nothing changes). Admins' user sessions only, never an API key. API 1.107.0.",
        "tags": [
          "Users"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "responses": {
          "200": {
            "description": "The user's two-factor status after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwoFactorStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/groups": {
      "get": {
        "operationId": "listGroups",
        "summary": "List groups",
        "description": "Permission groups with their members and camera and site grants, by ascending id. Admins only.",
        "tags": [
          "Users"
        ],
        "security": [
          {
            "apiKey": [
              "users:read"
            ]
          },
          {
            "apiKeyHeader": [
              "users:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "users:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of groups.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createGroup",
        "summary": "Create a group",
        "description": "Members (`user_ids`) get the group's camera and site permissions. Audited.",
        "tags": [
          "Users"
        ],
        "security": [
          {
            "apiKey": [
              "users:write"
            ]
          },
          {
            "apiKeyHeader": [
              "users:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "users:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The group.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Group"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/setup/diagnostics": {
      "get": {
        "operationId": "runDiagnostics",
        "summary": "Run the health checks",
        "description": "Runs every health check of the setup wizard and answers the report: recording disk (free space: `warn` under 15 %, `fail` under 5 %; write access), clock (SNTP offset: `warn` over 5 s, `fail` over 5 min), network ports (the web port, go2rtc's internal port 1984, 554 is not needed), Vigiora cloud link (enrolment, last heartbeat, remote access relay), go2rtc, ffmpeg, graphics acceleration (information only), LAN camera search, DNS (vigiora.com), updates and (API 1.45.0) camera clocks (from the stored camera clock checks: cameras whose clock is off, in another zone or not synced; no camera is contacted). Each check is `ok`, `warn`, `fail` or `skip` (not applicable, or could not decide) with a plain explanation and, for `warn`/`fail`, a `fix`: `auto` (run it with `POST /setup/diagnostics/actions/fix` and its `action_id`; admins only) or `manual` with steps for this server's `platform` (`linux`, `docker`, `macos`, `windows`). Checks run concurrently, each within 6 seconds. `cached=true` answers the last report when there is one (no new checks). This sends a little traffic (an NTP query, a DNS lookup, local port checks).",
        "tags": [
          "Setup"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "cached",
            "in": "query",
            "description": "`true`: the last report instead of a new run (a new run when there is none).",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiagnosticsReport"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/setup/diagnostics/actions/fix": {
      "post": {
        "operationId": "runDiagnosticFix",
        "summary": "Run an automatic fix",
        "description": "Runs one whitelisted fix and then its check again: `restart_go2rtc` (restarts the video streaming service on native installs: live view and recording of every camera stop for a few seconds), `check_updates` (checks for an update now), `resync_cloud` (contacts Vigiora cloud now) or `sync_clock` (API 1.43.1, native Linux installs with the installer's time-sync helper: turns on internet time sync with `timedatectl set-ntp true` and restarts the time daemon so the clock is corrected now). Nothing else can run; an unknown id is `400 validation_error` with `details.allowed_actions`, one not available on this install `409 conflict` (`details.reason: action_unavailable`), a fix that failed `409 conflict` (`action_failed`). One fix at most every 20 seconds per action (`429 rate_limited`). Admins only.",
        "tags": [
          "Setup"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-destructive": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiagnosticFixRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The fix ran; the check's new result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiagnosticFixResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/setup/checklist": {
      "get": {
        "operationId": "getSetupChecklist",
        "summary": "Get the setup checklist",
        "description": "The first-install checklist the dashboard shows until it is complete: `health`, `cameras`, `recording`, `ai_cameras`, `notifications`, `phone_app` and `claude_connector` (optional), each `done`, `skipped` or `pending`. `source` says why: `auto` (the data shows it: the last health run had no failure, a camera exists / records / has AI, a device gets push notifications or a webhook exists, an app is connected over OAuth) or `user` (marked with `PATCH`). `complete` is true when every non-optional item is done or skipped.",
        "tags": [
          "Setup"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The checklist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupChecklist"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateSetupChecklist",
        "summary": "Mark setup checklist items",
        "description": "Marks items `done` or `skipped`, or back to `pending` (clears the mark), in one step: `{\"items\": {\"phone_app\": \"skipped\"}}`. Every wizard step is skippable. An item the data shows as done stays done. Answers the whole checklist. Admins only.",
        "tags": [
          "Setup"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupChecklistUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The checklist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupChecklist"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/setup/ai-camera-suggestions": {
      "get": {
        "operationId": "suggestAICameras",
        "summary": "Suggest the cameras for AI",
        "description": "Ranks the enabled cameras you can view for the plan's AI camera slots (`slots`; the free plan has 2; `used` by cameras that already have AI, `free` left). `basis` says how: `activity` (people, detections and motion of the last `window_days` days), `stream` (no activity yet: cameras whose stream is live now come first) or `order` (neither known: the first cameras added). `suggested` marks the cameras to give the free slots; turn AI on with `POST /cameras/{camera_id}/actions/enable-ai`.",
        "tags": [
          "Setup"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The ranking.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AICameraSuggestions"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/settings": {
      "get": {
        "operationId": "getSettings",
        "summary": "Server settings",
        "description": "The recording defaults a new camera gets when its create request does not say (web app and API), camera following, the Vision Engine events retention and (API 1.42.0) the Bluetooth scan switches (`bluetooth_enabled`, `bluetooth_scan_interval_minutes`, `bluetooth_scan_seconds`).",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Settings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateSettings",
        "summary": "Change server settings",
        "description": "Changes the defaults sent; `default_retention_days` is one of `retention_choices` (the camera form's choices). Existing cameras keep their own values. Emits `settings.changed`.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Settings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/settings/agents": {
      "get": {
        "operationId": "getAgentSettings",
        "summary": "AI agent settings",
        "description": "The server-wide human-in-the-loop setting for AI agents (see the overview).",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateAgentSettings",
        "summary": "Change AI agent settings",
        "description": "Turns human in the loop on or off for the server (API keys and connected apps that override it keep their own value). Emits `settings.changed`.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/agents/perception-coach": {
      "get": {
        "operationId": "getPerceptionCoach",
        "summary": "Perception Coach status",
        "description": "The coach configuration (`enabled`, `interval_seconds`, `bar`, `daily_cap`), the model calls made today (`calls_today`, UTC day) and the newest prompt history entries (`recent`, at most 10, of cameras the caller may view). API 1.68.0. Admins and operators.",
        "tags": [
          "PerceptionCoach"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The coach state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PerceptionCoachStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/agents/perception-coach/settings": {
      "patch": {
        "operationId": "patchPerceptionCoachSettings",
        "summary": "Change the Perception Coach settings",
        "description": "Turns the coach on or off and sets how often a camera is audited (`interval_seconds`), the score below which a prompt is rewritten or a rewrite suggested (`bar`, above 0 up to 1) and the model calls allowed per day (`daily_cap`, 0 pauses it). Fields left out keep their value. Enabling lets AI rewrite camera prompts and spend AI credits, so it needs confirmation from an AI agent. `400 validation_failed` for a bad value. API 1.68.0. Admins only.",
        "tags": [
          "PerceptionCoach"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PerceptionCoachSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PerceptionCoachSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/agents/perception-coach/history": {
      "get": {
        "operationId": "perceptionCoachHistory",
        "summary": "Perception Coach prompt history",
        "description": "The newest prompt history entries, newest first: every prompt a person wrote (`human`, recorded when the coach first replaces it) and every prompt the coach applied or suggested (`coach`; `score` and `rationale` say why). With `camera_id` only that camera (needs permission to view it); otherwise all cameras the caller may view. API 1.68.0. Admins and operators.",
        "tags": [
          "PerceptionCoach"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "camera_id",
            "in": "query",
            "description": "Only this camera.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "room_id",
            "in": "query",
            "description": "Only this room (API 1.69.0); not together with `camera_id`.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "At most this many (1–200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The entries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PerceptionCoachHistory"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/apply-perception-coach": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "applyPerceptionCoach",
        "summary": "Apply the Perception Coach suggestion",
        "description": "Replaces the camera's AI guardian prompt with the coach's newest suggestion (the human opting in). The prompt in force is kept in the history first, so `POST /cameras/{camera_id}/actions/revert-perception-coach` can restore it. `404 not_found` when the coach has no suggestion that differs from the prompt in force; `409 conflict` when the prompt changed while this ran. API 1.68.0. Admins and operators.",
        "tags": [
          "PerceptionCoach"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The prompt now in force.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PerceptionCoachPrompt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/revert-perception-coach": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "revertPerceptionCoach",
        "summary": "Restore the human prompt",
        "description": "Puts back the camera's newest human-written AI guardian prompt (the one the coach replaced) and records the revert in the history. `404 not_found` when no human prompt was ever recorded for the camera; `409 conflict` when the prompt changed while this ran. API 1.68.0. Admins and operators.",
        "tags": [
          "PerceptionCoach"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The prompt now in force.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PerceptionCoachPrompt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/actions/apply-perception-coach": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "post": {
        "operationId": "applyRoomPerceptionCoach",
        "summary": "Apply the Perception Coach suggestion to a room",
        "description": "Replaces the room's AI rules (`ai_rules`) with the coach's newest suggestion (the human opting in). The rules in force are kept in the history first, so `POST /rooms/{room_id}/actions/revert-perception-coach` can restore them. `404 not_found` when there is no such room or the coach has no suggestion that differs from the rules in force; `409 conflict` when the rules changed while this ran. Needs operator permission on every camera of the room (an empty room is reachable by admins and operators); `403 forbidden` otherwise. API 1.69.0. Admins and operators.",
        "tags": [
          "PerceptionCoach"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-room-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The rules now in force (in `prompt`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PerceptionCoachPrompt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/actions/revert-perception-coach": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "post": {
        "operationId": "revertRoomPerceptionCoach",
        "summary": "Restore the human room rules",
        "description": "Puts back the room's newest human-written AI rules (the ones the coach replaced) and records the revert in the history. `404 not_found` when there is no such room or no human rules were ever recorded; `409 conflict` when the rules changed while this ran. Needs operator permission on every camera of the room (an empty room is reachable by admins and operators); `403 forbidden` otherwise. API 1.69.0. Admins and operators.",
        "tags": [
          "PerceptionCoach"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-room-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The rules now in force (in `prompt`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PerceptionCoachPrompt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/config/export": {
      "get": {
        "operationId": "exportConfig",
        "summary": "Export the configuration",
        "description": "The server's configuration as one versioned JSON document (format `vigiora.config` version 2): settings, sites, cameras, alert rules, rooms, layouts, outputs and floor plans with their items (not users, recordings or alerts). The floor plan images are not in the JSON (each plan names its file); `format=bundle` (1.27.0) answers a zip instead, `vigiora-config.json` plus the images at the names the plans give (`floorplans/<id>/plan-<version>.png|jpg`), which `POST /config/import` restores. Every credential (stream URL userinfo and credential parameters, ONVIF URL credentials, SRT passphrases) is `REDACTED`. With `include_secrets=true` they are encrypted instead, each as `{\"$enc\": \"v1:<base64url>\"}` (AES-256-GCM, key = Argon2id of the `X-Export-Passphrase` header over a random salt, t=3, m=64 MiB, p=1, recorded in `kdf`); that needs a credential with the `admin` scope (an admin session or an `admin`-scoped key) and a passphrase of at least 12 characters. The passphrase is never stored or logged. Every export is written to the audit log and emits `config.exported` (admins only).",
        "tags": [
          "Config"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "include_secrets",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "`json` (default) or `bundle`: a zip with the document and the floor plan images.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "bundle"
              ]
            }
          },
          {
            "name": "X-Export-Passphrase",
            "in": "header",
            "description": "With `include_secrets=true`; at least 12 characters.",
            "schema": {
              "type": "string",
              "minLength": 12
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The configuration document, or the bundle.",
            "headers": {
              "Content-Disposition": {
                "$ref": "#/components/headers/ContentDisposition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigDocument"
                }
              },
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/config/import": {
      "post": {
        "operationId": "importConfig",
        "summary": "Import a configuration",
        "description": "Applies a document from `GET /config/export` in one transaction. Objects are matched by id (alert rules by camera and label). A field absent from an object keeps the stored value, so a partial object never clears anything; a new object needs its required fields (`id` and `name`; cameras also `stream_url`, outputs `kind`) and gets the create defaults for the rest. Objects missing from the document are left alone: an import never deletes, and importing the same document again changes nothing. Every object is validated with the rules of its create or update (camera source URLs, ONVIF URL, names and lengths, references); any invalid object refuses the whole document (`400 validation_error`, every problem listed in `details.errors` as `{type, id, field, message}`), as does a wrong passphrase or a plan limit: nothing is ever partly applied. A camera's `retention_days` is one of 1, 3, 7, 14, 30, 90 (or its stored value); a reduction deletes recordings and needs `allow_retention_reduction=true` (it is listed in the change's `warnings` and counted in `summary.retention_reductions`). `REDACTED` credentials keep the stored value of the same camera; encrypted ones need the export's `X-Export-Passphrase` (decrypted before the transaction starts). A layout whose owner is not a user here is skipped. `dry_run=true` answers the same report without changing anything. Imported cameras are picked up by the stream reconciler within a minute (recording changes at the recorder's next reconcile or restart). Written to the audit log. At most 8 MiB as JSON. Floor plans (version 2 documents) are matched by id too; their items are replaced when `items` is sent and their references (cameras, rooms, speakers, analytics areas) must exist on the server or in the document. A plan's image comes from a bundle (`Content-Type: application/zip`, the export with `format=bundle`, at most 256 MiB): a new plan needs its image file in the bundle; an existing plan keeps its stored image when the file is not there (noted in `warnings`). Version 1 documents still import.",
        "tags": [
          "Config"
        ],
        "security": [
          {
            "apiKey": [
              "admin"
            ]
          },
          {
            "apiKeyHeader": [
              "admin"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "admin"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "name": "dry_run",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "allow_retention_reduction",
            "in": "query",
            "description": "Allow lowering a camera's `retention_days` (recordings older than the new period are deleted at the next retention sweep). Without it a reduction refuses the document.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "X-Export-Passphrase",
            "in": "header",
            "description": "For a document with encrypted values.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigImport"
              }
            },
            "application/zip": {
              "schema": {
                "type": "string",
                "format": "binary",
                "description": "A bundle: `vigiora-config.json` and the floor plan images."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was (or would be) changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigImportResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alert-rules": {
      "get": {
        "operationId": "listAlertRules",
        "summary": "List Guardian alert rules",
        "description": "Guardian alert rules of the cameras the caller may view, by ascending id. `email_recipients` is `null` unless the caller is an admin or operator with a user session.",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "What the rule is checked against: `video` (only `video_rule`), `audio` (only `audio_rule`), `video_and_audio` (both) or `none` (neither: it never fires).",
            "schema": {
              "type": "string",
              "enum": [
                "video",
                "audio",
                "video_and_audio",
                "none"
              ]
            }
          },
          {
            "name": "enabled",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of rules.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRulePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/alert-rules": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listCameraAlertRules",
        "summary": "List a camera's Guardian alert rules",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "type",
            "in": "query",
            "description": "What the rule is checked against: `video` (only `video_rule`), `audio` (only `audio_rule`), `video_and_audio` (both) or `none` (neither: it never fires).",
            "schema": {
              "type": "string",
              "enum": [
                "video",
                "audio",
                "video_and_audio",
                "none"
              ]
            }
          },
          {
            "name": "enabled",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of rules.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRulePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createAlertRule",
        "summary": "Create a Guardian alert rule",
        "description": "A natural-language rule the Guardian AI checks the camera's analysed clips (`video_rule`) and transcripts (`audio_rule`) against; give one or both (both: the video must match and the audio must have matched within 5 minutes). The texts go into the AI's prompt: control characters and invisible formatting characters are refused (line breaks and tabs are allowed in `description` and the rules). Rules only fire on cameras with AI: when the camera's AI is off the rule is still created and `warnings` lists `ai_not_enabled`. E-mail settings (`email_enabled`, `email_recipients`) are never set with an API key or an OAuth token (`403 api_key_not_allowed`): use the web app; recipients only by admins and operators.",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertRuleCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The rule.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alert-rules/{alert_rule_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AlertRuleId"
        }
      ],
      "get": {
        "operationId": "getAlertRule",
        "summary": "Get a Guardian alert rule",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The rule.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRule"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateAlertRule",
        "summary": "Update a Guardian alert rule",
        "description": "Changes only the fields sent. Same checks as on create; `null` clears `cooldown_seconds` (the severity's default), `video_rule` or `audio_rule` (one must remain). A `null` `email_recipients` from a caller who cannot see them is ignored.",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertRuleUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The rule.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteAlertRule",
        "summary": "Delete a Guardian alert rule",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alert-rules/{alert_rule_id}/actions/enable": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AlertRuleId"
        }
      ],
      "post": {
        "operationId": "enableAlertRule",
        "summary": "Enable a Guardian alert rule",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The rule.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alert-rules/{alert_rule_id}/actions/disable": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AlertRuleId"
        }
      ],
      "post": {
        "operationId": "disableAlertRule",
        "summary": "Disable a Guardian alert rule",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The rule.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/label-alert-rules": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listLabelAlertRules",
        "summary": "List a camera's label alert rules",
        "description": "Which detector labels on the camera are alerts (`is_alert` on its alerts), by ascending id.",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of rules.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelAlertRulePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createLabelAlertRule",
        "summary": "Create a label alert rule",
        "description": "Makes detections of `label` on the camera alerts (when `enabled`) with `severity`. One rule per label and camera: a second is `409 conflict`.",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelAlertRuleCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The rule.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelAlertRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/label-alert-rules/{label_alert_rule_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LabelAlertRuleId"
        }
      ],
      "get": {
        "operationId": "getLabelAlertRule",
        "summary": "Get a label alert rule",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The rule.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelAlertRule"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateLabelAlertRule",
        "summary": "Update a label alert rule",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelAlertRuleUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The rule.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelAlertRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteLabelAlertRule",
        "summary": "Delete a label alert rule",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/labels": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listCameraLabels",
        "summary": "List a camera's detector labels",
        "description": "The labels the camera's detectors have produced (AI service events and detections, at most 500 of each) and the label alert rules set on them, in one page (`next_cursor` is always `null`).",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The labels.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraLabelPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/motion-rules": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listMotionRules",
        "summary": "List a camera's smart-motion rules",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of rules.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MotionRulePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createMotionRule",
        "summary": "Create a smart-motion rule",
        "description": "A line to cross (2 points) or a zone to enter (3 to 32 points), in normalised image coordinates (0..1, origin top left), for `person`, `vehicle` or `any` object. Evaluated by the camera's smart-motion service.",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MotionRuleCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The rule.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MotionRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/motion-rules/{motion_rule_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MotionRuleId"
        }
      ],
      "get": {
        "operationId": "getMotionRule",
        "summary": "Get a smart-motion rule",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The rule.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MotionRule"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateMotionRule",
        "summary": "Update a smart-motion rule",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MotionRuleUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The rule.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MotionRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteMotionRule",
        "summary": "Delete a smart-motion rule",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/areas": {
      "get": {
        "operationId": "listAnalyticsAreas",
        "summary": "List analytics areas",
        "description": "Areas group counting lines and zones (possibly of several cameras) into one place, such as a shop or a car park, ordered by `sort_order` then id. An area is listed when you may view every camera of its lines and zones; areas without any line or zone are listed to admins only.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of areas.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsAreaPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createAnalyticsArea",
        "summary": "Create an analytics area",
        "description": "`lines` are the area's entrances (`sign` 1: the line's \"in\" enters the area, -1: it leaves it); `zones` are counted as being inside it. Needs operator permission on every camera of the lines and zones; only admins may create an area without any.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsAreaCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The area.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsArea"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/areas/{analytics_area_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AnalyticsAreaId"
        }
      ],
      "patch": {
        "operationId": "updateAnalyticsArea",
        "summary": "Update an analytics area",
        "description": "Given `lines` or `zones` replace the area's lines or zones as a set.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsAreaUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The area.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsArea"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteAnalyticsArea",
        "summary": "Delete an analytics area",
        "description": "Deletes the area with its manual occupancy settings and occupancy history; its lines and zones and their counts stay.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/areas/{analytics_area_id}/actions/set-occupancy": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AnalyticsAreaId"
        }
      ],
      "post": {
        "operationId": "setAnalyticsOccupancy",
        "summary": "Correct an area's occupancy",
        "description": "Sets how many are in the area now (for example 0 after closing, or a head count); counting continues from it until the next daily reset. Answers the area's occupancy after the correction.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsOccupancySet"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The area's occupancy.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsAreaOccupancy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/lines": {
      "get": {
        "operationId": "listAnalyticsLines",
        "summary": "List counting lines",
        "description": "The counting lines of the cameras you may view (or of `camera_id`), by id.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/AnalyticsCameraFilter"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of lines.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsLinePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createAnalyticsLine",
        "summary": "Create a counting line",
        "description": "A line from `a` to `b` in normalised image coordinates (0..1, origin top left). Crossing it from the right of a→b to its left counts \"in\", the opposite \"out\". Needs operator permission on the camera.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsLineCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The line.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsLine"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/lines/{analytics_line_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AnalyticsLineId"
        }
      ],
      "patch": {
        "operationId": "updateAnalyticsLine",
        "summary": "Update a counting line",
        "description": "A line cannot move to another camera.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsLineUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The line.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsLine"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteAnalyticsLine",
        "summary": "Delete a counting line",
        "description": "Deletes the line with its area memberships and all its counts and history (crossings and buckets). To keep the history, disable the line instead.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/zones": {
      "get": {
        "operationId": "listAnalyticsZones",
        "summary": "List analytics zones",
        "description": "The zones of the cameras you may view (or of `camera_id`), by id.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/AnalyticsCameraFilter"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of zones.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsZonePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createAnalyticsZone",
        "summary": "Create an analytics zone",
        "description": "A polygon (3 or more points, normalised 0..1, origin top left) where visits, dwell and stopped time are measured. Needs operator permission on the camera.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsZoneCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The zone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsZone"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/zones/{analytics_zone_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AnalyticsZoneId"
        }
      ],
      "patch": {
        "operationId": "updateAnalyticsZone",
        "summary": "Update an analytics zone",
        "description": "A zone cannot move to another camera.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsZoneUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The zone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsZone"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteAnalyticsZone",
        "summary": "Delete an analytics zone",
        "description": "Deletes the zone with its area memberships and all its statistics and history (visits and buckets). To keep the history, disable the zone instead.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/analytics": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraAnalytics",
        "summary": "Get a camera's analytics settings",
        "description": "Whether analytics runs on the camera, the classes it counts, and its lines and zones.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsCameraSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateCameraAnalytics",
        "summary": "Update a camera's analytics settings",
        "description": "Turning analytics on for more cameras than the licence of the Analytics add-on allows answers `402 limit_reached`.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsCameraUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsCameraSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/counts": {
      "get": {
        "operationId": "getAnalyticsCounts",
        "summary": "Count people or vehicles in and out",
        "description": "How many came in and went out through an area's entrance lines (`area_id`), one line (`line_id`) or every enabled line of a camera (`camera_id`; give exactly one) over a period: `from` and `to`, or a named `period`. For example \"how many customers came in between 9 and 12 today?\" is `from=<today>T09:00&to=<today>T12:00` with the shop's area. Local times without an offset are in the server's time zone. When `covered_pct` is below 100 the detector was not watching the whole period: say so when you report the numbers. Counts are kept in 15-minute buckets, so `from` is rounded down to a quarter hour. `step` adds a series (`15m` for up to 7 days; `1h` and `1d` follow local hours and days). `by_class` is \"in\" per class whatever `class` is.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "area_id",
            "in": "query",
            "description": "An analytics area.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "line_id",
            "in": "query",
            "description": "A counting line.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "camera_id",
            "in": "query",
            "description": "A camera (all its enabled lines).",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "$ref": "#/components/parameters/AnalyticsFrom"
          },
          {
            "$ref": "#/components/parameters/AnalyticsTo"
          },
          {
            "$ref": "#/components/parameters/AnalyticsPeriod"
          },
          {
            "$ref": "#/components/parameters/AnalyticsClass"
          },
          {
            "name": "step",
            "in": "query",
            "description": "Adds a series with one point per step.",
            "schema": {
              "type": "string",
              "enum": [
                "15m",
                "1h",
                "1d"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsCounts"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/occupancy": {
      "get": {
        "operationId": "getAnalyticsOccupancy",
        "summary": "Get how many are in each area now",
        "description": "The live occupancy of the areas you may view (or of `area_id`). Areas with entrance lines count in minus out since the daily reset or the last correction (it lags the doorway by up to about 20 seconds); areas with only zones count who is in their zones now; areas of parking bays only count the vehicles in their bays (`source: bays`, with the free and total bays in `bays`).",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "area_id",
            "in": "query",
            "description": "One analytics area.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The occupancy per area.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsOccupancy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/dwell": {
      "get": {
        "operationId": "getAnalyticsDwell",
        "summary": "Get how long people or vehicles stay in zones",
        "description": "Dwell statistics of the visits that started in the period, per zone: one zone (`zone_id`), an area's zones (`area_id`) or a camera's enabled zones (`camera_id`; give exactly one). Local times without an offset are in the server's time zone. Past the event retention (90 days by default) `median_ms` is null and `hist` empty.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "zone_id",
            "in": "query",
            "description": "An analytics zone.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "area_id",
            "in": "query",
            "description": "An analytics area (its zones).",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "camera_id",
            "in": "query",
            "description": "A camera (its enabled zones).",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "$ref": "#/components/parameters/AnalyticsFrom"
          },
          {
            "$ref": "#/components/parameters/AnalyticsTo"
          },
          {
            "$ref": "#/components/parameters/AnalyticsPeriod"
          },
          {
            "$ref": "#/components/parameters/AnalyticsClass"
          }
        ],
        "responses": {
          "200": {
            "description": "The dwell statistics.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsDwell"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/heatmap": {
      "get": {
        "operationId": "getAnalyticsHeatmap",
        "summary": "Get a camera's heatmap",
        "description": "Where people or vehicles went (`layer=pass`: track passes per cell) or stood still (`stop`: stopped tenths of a second per cell) on a camera's image, summed over the local days of the period, as a grid of `w` × `h` cells (row-major, x first, origin top left). Local times without an offset are in the server's time zone.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "camera_id",
            "in": "query",
            "required": true,
            "description": "The camera.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "$ref": "#/components/parameters/AnalyticsFrom"
          },
          {
            "$ref": "#/components/parameters/AnalyticsTo"
          },
          {
            "$ref": "#/components/parameters/AnalyticsPeriod"
          },
          {
            "name": "class",
            "in": "query",
            "description": "The class (default `person`).",
            "schema": {
              "type": "string",
              "enum": [
                "person",
                "car",
                "truck",
                "bus",
                "motorbike",
                "bicycle"
              ]
            }
          },
          {
            "name": "layer",
            "in": "query",
            "description": "`pass` (default) or `stop`.",
            "schema": {
              "type": "string",
              "enum": [
                "pass",
                "stop"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The grid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsHeatmap"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/queues": {
      "get": {
        "operationId": "getAnalyticsQueues",
        "summary": "Get queue waits",
        "description": "How long people waited in queue zones (zones of kind `queue`) for the queued visits that started in the period, all classes: one queue zone (`zone_id`), an area's enabled queue zones (`area_id`) or a camera's (`camera_id`; give exactly one), with how many are queued now. A visit counts as queued after `queue_min_wait_sec` in the zone. `service_level_pct` is the share that waited under 60 seconds. Local times without an offset are in the server's time zone. Past the event retention (90 days by default) the maximum, median and service level come from a histogram and are approximate. `step` adds a series (`15m` for up to 7 days; `1h` and `1d` follow local hours and days). API 1.30.0.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "zone_id",
            "in": "query",
            "description": "A queue zone.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "area_id",
            "in": "query",
            "description": "An analytics area (its enabled queue zones).",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "camera_id",
            "in": "query",
            "description": "A camera (its enabled queue zones).",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "$ref": "#/components/parameters/AnalyticsFrom"
          },
          {
            "$ref": "#/components/parameters/AnalyticsTo"
          },
          {
            "$ref": "#/components/parameters/AnalyticsPeriod"
          },
          {
            "$ref": "#/components/parameters/AnalyticsStep"
          }
        ],
        "responses": {
          "200": {
            "description": "The waits per queue zone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsQueues"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/busy-hours": {
      "get": {
        "operationId": "getAnalyticsBusyHours",
        "summary": "Get the busiest hours of the week",
        "description": "The average \"in\" per local weekday (Monday first) and hour over the period, through an area's entrance lines (`area_id`), one line (`line_id`) or every enabled line of a camera (`camera_id`; give exactly one): the sum of each hour of the week divided by the number of those weekdays the period touches. Use a few weeks (`from` 28 days back) for a typical week. Local times without an offset are in the server's time zone. API 1.30.0.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "area_id",
            "in": "query",
            "description": "An analytics area.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "line_id",
            "in": "query",
            "description": "A counting line.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "camera_id",
            "in": "query",
            "description": "A camera (all its enabled lines).",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "$ref": "#/components/parameters/AnalyticsFrom"
          },
          {
            "$ref": "#/components/parameters/AnalyticsTo"
          },
          {
            "$ref": "#/components/parameters/AnalyticsPeriod"
          },
          {
            "$ref": "#/components/parameters/AnalyticsClass"
          }
        ],
        "responses": {
          "200": {
            "description": "The weekly matrix.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsBusyHours"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/speed": {
      "get": {
        "operationId": "getAnalyticsSpeed",
        "summary": "Get crossing speeds",
        "description": "The speeds (metres per second) of the crossings of an area's entrance lines (`area_id`), one line (`line_id`) or every enabled line of a camera (`camera_id`; give exactly one) over the period. Speed is an estimate: it is measured only on cameras with a calibration (a known distance drawn on the image) and its accuracy depends on that calibration; `calibrated` false means no camera of the scope has one and nothing is measured. Say so when you report a speed. Multiply by 3.6 for km/h. `by_class` lists every class whatever `class` is. Local times without an offset are in the server's time zone. API 1.30.0.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "area_id",
            "in": "query",
            "description": "An analytics area.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "line_id",
            "in": "query",
            "description": "A counting line.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "camera_id",
            "in": "query",
            "description": "A camera (all its enabled lines).",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "$ref": "#/components/parameters/AnalyticsFrom"
          },
          {
            "$ref": "#/components/parameters/AnalyticsTo"
          },
          {
            "$ref": "#/components/parameters/AnalyticsPeriod"
          },
          {
            "$ref": "#/components/parameters/AnalyticsClass"
          },
          {
            "$ref": "#/components/parameters/AnalyticsStep"
          }
        ],
        "responses": {
          "200": {
            "description": "The speeds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsSpeed"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/paths": {
      "get": {
        "operationId": "getAnalyticsPaths",
        "summary": "Get the paths people or vehicles took",
        "description": "A camera's stored tracks that started in the period (within the raw track retention, 7 days by default), newest first, each simplified to a few foot points (normalised, origin top left), with the top 10 flows between its lines and zones. Too large for an AI assistant: not an MCP tool; agents use `getAnalyticsFlows`. Local times without an offset are in the server's time zone. API 1.30.0.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-mcp": false,
        "parameters": [
          {
            "name": "camera_id",
            "in": "query",
            "required": true,
            "description": "The camera.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "$ref": "#/components/parameters/AnalyticsFrom"
          },
          {
            "$ref": "#/components/parameters/AnalyticsTo"
          },
          {
            "$ref": "#/components/parameters/AnalyticsPeriod"
          },
          {
            "$ref": "#/components/parameters/AnalyticsClass"
          },
          {
            "$ref": "#/components/parameters/AnalyticsPathLimit"
          }
        ],
        "responses": {
          "200": {
            "description": "The paths and flows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsPaths"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/flows": {
      "get": {
        "operationId": "getAnalyticsFlows",
        "summary": "Get where people or vehicles went next",
        "description": "The top 10 flows on a camera: how many of its tracks that started in the period went from one line or zone straight to another (`from` and `to` are `line:<id>` or `zone:<id>`, with their names), counted over the newest `limit` tracks within the raw track retention (7 days by default). `truncated` means more tracks started in the period than were counted. The paths themselves are `getAnalyticsPaths`. Local times without an offset are in the server's time zone. API 1.30.0.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "camera_id",
            "in": "query",
            "required": true,
            "description": "The camera.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "$ref": "#/components/parameters/AnalyticsFrom"
          },
          {
            "$ref": "#/components/parameters/AnalyticsTo"
          },
          {
            "$ref": "#/components/parameters/AnalyticsPeriod"
          },
          {
            "$ref": "#/components/parameters/AnalyticsClass"
          },
          {
            "$ref": "#/components/parameters/AnalyticsPathLimit"
          }
        ],
        "responses": {
          "200": {
            "description": "The flows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsFlows"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/bays": {
      "get": {
        "operationId": "getAnalyticsBays",
        "summary": "Get parking bays",
        "description": "The enabled parking bays (zones of kind `bay`) of an area (`area_id`) or a camera (`camera_id`; give exactly one): whether each is taken now, since when and by which vehicle class, the free and total bays, and over the period (default today) the finished stays with their average and median and the share of the watched time the bay was occupied. Local times without an offset are in the server's time zone. API 1.30.0.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "area_id",
            "in": "query",
            "description": "An analytics area (its bays).",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "camera_id",
            "in": "query",
            "description": "A camera (its bays).",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "$ref": "#/components/parameters/AnalyticsFrom"
          },
          {
            "$ref": "#/components/parameters/AnalyticsTo"
          },
          {
            "$ref": "#/components/parameters/AnalyticsPeriod"
          }
        ],
        "responses": {
          "200": {
            "description": "The bays.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsBays"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/alert-rules": {
      "get": {
        "operationId": "listAnalyticsAlertRules",
        "summary": "List analytics alert rules",
        "description": "The analytics alert rules whose target you may view (a zone's or line's camera, the camera, or every camera of the area), by id. API 1.30.0.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of rules.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsAlertRulePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createAnalyticsAlertRule",
        "summary": "Create an analytics alert rule",
        "description": "A rule watches one target and raises an alert when its condition holds. Kinds, their target and `params`: `capacity` (area; `pct` 1–100, default 90: occupancy reaches that share of the capacity, again at 100 %), `queue_length` (queue zone; `max` people queued for `minutes`), `queue_wait` (queue zone; someone waited `seconds`), `loitering` (zone; someone stayed `seconds`), `wrong_direction` (line; a crossing in `direction` `in` or `out`), `tailgating` (line; two \"in\" crossings within `within_sec`), `speed` (line; a crossing at `limit_kmh` or more, only on calibrated cameras, and as accurate as the calibration), `no_bays_free` (area or camera; no bay free for `minutes`), `zone_empty` (zone; nobody in it for `minutes` while open), `line_below` (line; fewer than `expected` in over the last `hours`, checked every 15 minutes), `bay_reserved` (bay; taken during its `reserved_schedule`) and `bay_overstay` (bay; a stay of the zone's `max_stay_min`). A rule fires only inside its `schedule` (`null` = always) and at most once per `cooldown_sec` (default 300); conditions that stay true (`capacity`, `queue_length`, `no_bays_free`, `zone_empty`) fire again every cooldown. `zone_empty` with no `schedule` follows the opening hours (`open_hours`) of the zone's area, so with neither it never fires. `line_below` looks back over the last `hours`, so it can fire right when its schedule opens (the window then lies mostly outside the schedule). Alerts appear in `/alerts` with `source: \"analytics\"` and the label `analytics:<kind>` (`analytics:` labels are reserved: `POST /alerts` refuses them). Needs operator permission on every camera of the target. API 1.30.0.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsAlertRuleCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The rule.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsAlertRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/alert-rules/{analytics_alert_rule_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AnalyticsAlertRuleId"
        }
      ],
      "patch": {
        "operationId": "updateAnalyticsAlertRule",
        "summary": "Update an analytics alert rule",
        "description": "Changes only the fields sent; a new `kind` without `params` resets the params to the kind's defaults, and `channels` replaces all channels. Needs operator permission on every camera of the old and the new target. API 1.30.0.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsAlertRuleUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The rule.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsAlertRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteAnalyticsAlertRule",
        "summary": "Delete an analytics alert rule",
        "description": "Deletes the rule; its alert history stays (without the rule id). API 1.30.0.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-destructive": true,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/alert-events": {
      "get": {
        "operationId": "listAnalyticsAlertEvents",
        "summary": "List analytics alert firings",
        "description": "When analytics alert rules fired, newest first, over the period (default the last 7 days): of the rules you may view, and of deleted rules on cameras you may view. `limit` is 1–1000 (default 100). API 1.30.0.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "rule_id",
            "in": "query",
            "description": "Only this rule's firings.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "$ref": "#/components/parameters/AnalyticsFrom"
          },
          {
            "$ref": "#/components/parameters/AnalyticsTo"
          },
          {
            "$ref": "#/components/parameters/AnalyticsPeriod"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "At most this many (1–1000, default 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The firings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsAlertEvents"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/displays": {
      "get": {
        "operationId": "listAnalyticsDisplays",
        "summary": "List an area's door displays",
        "description": "The door displays of an area (revoked ones included), oldest first. A door display is a public full-screen page for a tablet or TV at the entrance that shows \"come in\" or \"please wait\" from the area's live occupancy against its capacity. Their tokens are never shown again. Needs operator permission on every camera of the area. API 1.30.0.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "area_id",
            "in": "query",
            "required": true,
            "description": "The analytics area.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of displays.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsDisplayPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createAnalyticsDisplay",
        "summary": "Create a door display",
        "description": "Creates a door display for an area and returns its secret token, the public page URL (`<base_url>/display/<token>`) and a QR code of it. The token is shown once, here only: only its hash is kept, so give the URL to the person now; a lost token means a new display. Anyone with the URL sees the area's occupancy state and the display's texts, nothing else (no video, no names); revoke it to stop it. `base_url` defaults to the server's public address while remote access is on. Needs operator permission on every camera of the area. API 1.30.0.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsDisplayCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The display with its token, URL and QR code (shown once).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsDisplayCreated"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analytics/displays/{analytics_display_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AnalyticsDisplayId"
        }
      ],
      "delete": {
        "operationId": "revokeAnalyticsDisplay",
        "summary": "Revoke a door display",
        "description": "Revokes the display at once: its page shows \"This display is not connected\". A revoked display stays listed and cannot be turned back on. API 1.30.0.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:write"
            ]
          },
          {
            "apiKeyHeader": [
              "analytics:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "analytics:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-destructive": true,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Revoked."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/available-streams": {
      "get": {
        "operationId": "listAvailableStreams",
        "summary": "List streams vigiora-clients offer",
        "description": "The camera streams and USB microphones online vigiora-clients publish, for `POST /cameras` with `client_id` (`remote_stream_name` = `stream`, or `audio_device` for a microphone). One page.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The streams.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailableStreamPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/catalog": {
      "get": {
        "operationId": "searchCameraCatalog",
        "summary": "Search the camera catalogue",
        "description": "API 1.31.0. Searches the embedded Vigiora camera catalogue for the \"pick the model\" box of the add-camera flow: `q` is a model, an alias, a brand or both (`Tapo C230`, `2047`, `ring doorbell`, `reolink`). Models match exactly (with or without the brand name), by prefix, then by substring of the model, alias or family; a brand name lists the brand (an entry with `model: null`) and its models. Best first, at most `limit`. Each entry says whether it streams locally (`rtsp`, `no` = app/cloud only), whether its facts were checked on the manufacturer's page (`verified`, `source`), the login advice, and its stream URL templates with `{host}` left for the camera's address (and `{user}` / `{pass}` in a query string; an rtsp URL carries no login: add it URL-encoded). One page. The catalogue's data is CC BY-SA 4.0.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "What to look for, 1-100 characters.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "At most this many entries (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The entries, best first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraCatalogEntryPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/catalog/brands": {
      "get": {
        "operationId": "listCameraCatalogBrands",
        "summary": "List the camera catalogue's brands",
        "description": "API 1.31.0. Every brand of the embedded camera catalogue with its local-stream support, default ports, login advice and model count. One page. Its version is `camera_catalog_version` of `GET /server`.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The brands.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraCatalogBrandPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/hardware-id": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraHardwareID",
        "summary": "Get a camera's hardware id",
        "description": "The MAC addresses learned for the camera's stream hosts and the latest thing camera following did (moved, not found, cleared, …). Change it with `PATCH /cameras/{camera_id}` `hardware_id` (user sessions).",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The hardware id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HardwareID"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ai-services": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listCameraAIServices",
        "summary": "List a camera's AI services",
        "description": "Every AI service the server has (Core AI, motion detection, speech-to-text, AI Live, scene alerts, counters, …) with whether it is on for the camera, its dependencies, its per-camera settings (`config`, and the settings it accepts in `config_fields`) and warnings: the `core-ai` entry carries `no_motion_trigger` when AI is on but motion detection is off (Guardian then never looks at the camera). API keys see only per-camera settings. One page.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The services.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIServicePage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ai-services/{ai_service_id}/actions/enable": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "$ref": "#/components/parameters/AiServiceId"
        }
      ],
      "post": {
        "operationId": "enableCameraAIService",
        "summary": "Switch an AI service on for a camera",
        "description": "Plan-limited services (`plan_limited`) count against the plan (`402 limit_reached`); a service whose `requires_any` is not on is `409 dependency_not_met`. `core-ai` behaves as `POST /cameras/{camera_id}/actions/enable-ai`.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIService"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ai-services/{ai_service_id}/actions/disable": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "$ref": "#/components/parameters/AiServiceId"
        }
      ],
      "post": {
        "operationId": "disableCameraAIService",
        "summary": "Switch an AI service off for a camera",
        "description": "Refused with `409 dependent_service_assigned` while another service on the camera needs it.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIService"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ai-services/{ai_service_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "$ref": "#/components/parameters/AiServiceId"
        }
      ],
      "patch": {
        "operationId": "updateCameraAIService",
        "summary": "Change a camera's AI service settings",
        "description": "Sets the service's per-camera settings: only the keys in its `config_fields`, within their bounds (`null` = back to the default). Free-form service configuration stays in the web app.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AIServiceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIService"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/ptz/actions/probe": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "probePTZ",
        "summary": "Detect PTZ again",
        "description": "Probes the camera now (ONVIF, ISAPI; no movement) and stores what it found.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "What was found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PTZProbeResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/reference-frame": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getReferenceFrame",
        "summary": "Get a camera's reference frame",
        "description": "The stored picture `compare` checks the live view against.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The JPEG.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteReferenceFrame",
        "summary": "Delete a reference frame",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/reference-frame/actions/capture": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "captureReferenceFrame",
        "summary": "Capture a reference frame",
        "description": "Stores the camera's current picture as its reference frame (replacing the previous one).",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Captured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferenceFrame"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/compare": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "compareReferenceFrame",
        "summary": "Compare with the reference frame",
        "description": "Asks the AI what changed between the reference frame and the live picture (uses AI credits; the per-credential AI limits apply). The answer is also written to the Guardian log. `409 conflict` without a reference frame.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The comparison.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferenceComparison"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/read-plates": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "readPlates",
        "summary": "Read licence plates",
        "description": "Reads the licence plates in the live picture (needs the plate-recognition add-on; uses AI credits and the per-credential AI limits). Each plate is also recorded as an alert (`plate:<number>`).",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The plates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlateReading"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/read-qr": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "readQRCodes",
        "summary": "Read QR codes now",
        "description": "Reads the QR codes in the camera's live picture now (API 1.84.0), looking harder than the motion reads (the quarters of the picture upscaled too), on the server CPU: no AI credits. Each code found is recorded like a motion read (an alert `qr:<payload>` and a QR code read; the same code is recorded once a minute per camera, `recorded: false` otherwise). With `image_base64` (a JPEG, PNG or WebP still, at most 10 MB; operator permission on the camera) that picture is read instead of the live one, as if the camera had seen it. 503 when the camera gives no picture.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "image_base64": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "A still to read instead of the live picture (base64, or a data URL)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The codes found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QRScanResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/read-weather": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "readWeather",
        "summary": "Read the weather",
        "description": "Reads the current outdoor weather from the camera's live picture (sky, precipitation, fog, day/night, wet ground) — only what the camera can see, never temperature or wind. Uses AI credits and the per-credential AI limits. The reading is also recorded in the camera's weather history.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The weather reading.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WeatherReadingV1"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/objects": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraObjects",
        "summary": "Get a camera's current object counts",
        "description": "People, vehicles, faces, plates and weapons the detectors see now.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/pipeline": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraPipeline",
        "summary": "Get a camera's stream pipeline health",
        "description": "Each hop of the camera's video (camera, client, mesh, server, recorder, viewers) with its state and bitrate, as the web app's pipeline panel shows it.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The pipeline.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/audio-status": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraAudioStatus",
        "summary": "Get a camera's audio capture health",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The audio status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraAudioStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/audio-level": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraAudioLevel",
        "summary": "Measure a camera's audio level",
        "description": "Listens to the stream for about 2 seconds and reports `mean_db` and `max_db` (per-credential limits as for AI operations).",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The level.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/repush": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "repushCamera",
        "summary": "Re-send a microphone to its client",
        "description": "Queues a USB microphone camera to its vigiora-client again, when the client lost it.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Queued"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/privacy-masks": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listPrivacyMasks",
        "summary": "List a camera's privacy masks",
        "description": "API 1.108.0. A camera's privacy masks, oldest first: up to 8 polygons in picture coordinates (0..1 from the top left). The server paints them black on every still picture of the camera it sends or gives an AI (snapshots, frames, alert, push and email pictures, Guardian and cloud AI frames, add-on frames, thumbnails), re-encodes clip exports, mosaics and public clip links of the camera with them burned in, and drops detections whose box centre is inside one. The web player draws them over live view and playback. NOT masked: the recording files on disk and the camera's stream read directly over RTSP or go2rtc (including add-ons and AI runners that read the stream); only a privacy mask set on the camera itself masks at the source. A camera without masks answers an empty list.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The masks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivacyMaskList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createPrivacyMask",
        "summary": "Add a privacy mask to a camera",
        "description": "API 1.108.0. Adds a black polygon (3 to 12 `points`, each `[x, y]` between 0 and 1 from the top left of the picture; an optional `name` of at most 64 characters). It applies at once to every picture and export the server makes (see `listPrivacyMasks` for what is and is not masked). At most 8 per camera: a ninth is `409 conflict`. Adding a mask only hides more, so it needs no confirmation.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrivacyMaskCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new mask.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivacyMask"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/privacy-masks/{mask_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "$ref": "#/components/parameters/PrivacyMaskId"
        }
      ],
      "get": {
        "operationId": "getPrivacyMask",
        "summary": "Get a privacy mask",
        "description": "API 1.108.0. One of the camera's privacy masks; a mask of another camera is `404`.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The mask.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivacyMask"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updatePrivacyMask",
        "summary": "Rename or reshape a privacy mask",
        "description": "API 1.108.0. Changes a mask's `name` and/or `points` (same rules as `createPrivacyMask`; at least one field). Reshaping can uncover part of the picture, so it asks for confirmation when human in the loop is on.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrivacyMaskUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The mask.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivacyMask"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deletePrivacyMask",
        "summary": "Remove a privacy mask",
        "description": "API 1.108.0. Removes a mask: the part of the picture it hid shows again in every picture, export and the player from then on (pictures and exports made before keep it).",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/motion-zones": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listMotionZones",
        "summary": "List a camera's motion zones",
        "description": "API 1.119.0. A camera's motion zones, oldest first (up to 8 polygons in picture coordinates, 0..1 from the top left), and its `mode`. In mode `ignore` (the default) movement inside the zones does not count as motion; in mode `only` only movement inside them counts. Movement that does not count starts nothing that motion starts: no motion event (`motion.started`), no Guardian analysis, no motion or HD-on-motion recording, no AI Live tick, no patrol hold or follow. The motion detector leaves the pixels out before it looks for a moving area; a person, vehicle or animal detection that would start a Guardian analysis is judged by its box centre. Zones never hide or change the picture, recordings, snapshots or streams (that is `listPrivacyMasks`). NOT affected: the camera's own ONVIF motion events (they carry no position), object detections as such (still stored, label alert rules still apply), audio and alerts sent in through `createAlert`. A camera without zones answers an empty list and behaves as before.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The zones and the mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MotionZoneList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createMotionZone",
        "summary": "Add a motion zone to a camera",
        "description": "API 1.119.0. Adds a polygon (3 to 12 `points`, each `[x, y]` between 0 and 1 from the top left of the picture; an optional `name` of at most 64 characters). It applies to motion within seconds (see `listMotionZones`). At most 8 per camera: a ninth is `409 conflict`. A zone can stop motion from starting recordings, alerts and AI, so it asks for confirmation when human in the loop is on.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MotionZoneCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new zone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MotionZone"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/motion-zones/{zone_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        },
        {
          "$ref": "#/components/parameters/MotionZoneId"
        }
      ],
      "get": {
        "operationId": "getMotionZone",
        "summary": "Get a motion zone",
        "description": "API 1.119.0. One of the camera's motion zones; a zone of another camera is `404`.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The zone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MotionZone"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateMotionZone",
        "summary": "Rename or reshape a motion zone",
        "description": "API 1.119.0. Changes a zone's `name` and/or `points` (same rules as `createMotionZone`; at least one field). Reshaping changes which motion counts, so it asks for confirmation when human in the loop is on.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MotionZoneUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The zone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MotionZone"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteMotionZone",
        "summary": "Remove a motion zone",
        "description": "API 1.119.0. Removes a zone. Without zones left the camera counts all movement again, as before.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/motion-zone-settings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getMotionZoneSettings",
        "summary": "Get a camera's motion zone mode",
        "description": "API 1.119.0. The camera's motion zone `mode`: `ignore` (default; movement inside the zones does not count) or `only` (only movement inside the zones counts). It does nothing while the camera has no zones.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MotionZoneSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "patchMotionZoneSettings",
        "summary": "Set a camera's motion zone mode",
        "description": "API 1.119.0. Sets `mode` to `ignore` or `only`. Switching changes which motion counts, so it asks for confirmation when human in the loop is on.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MotionZoneSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MotionZoneSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/clock": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraClock",
        "summary": "Get a camera's clock check",
        "description": "API 1.45.0. A camera keeps its own clock: one that is hours off, or back in 1970 because it has no time server, burns the wrong time into its picture and stamps its events wrongly. This is the latest check of the camera's own date, time, time zone and time sync against the server's: `status` `ok`, `drift` (more than 60 s from the server's UTC; `offset_seconds` is the camera's UTC minus the server's, negative = behind), `timezone` (the camera's local offset differs from the server's zone), `no_ntp` (right now, but the camera does not sync with a time server) or `unknown` (the clock could not be read; `message` says why), with a plain `message` (\"Camera clock is 15 h behind the server\"). The camera is read over ONVIF `GetSystemDateAndTime` (anonymous first, then with the camera login from its stream address) or, when ONVIF does not answer, Hikvision/EZVIZ ISAPI `/ISAPI/System/time`. A Reolink camera (API 1.48.0; known by its stream path or its ONVIF maker) is read over Reolink's own API instead (`method: reolink`: its HTTP API, else the Reolink app port 9000), because over ONVIF it reports time sync off while it is on. The camera is compared with its site zone (API 1.50.0, `site_timezone`: the camera's own setting, its client's, or the server's). A camera behind a vigiora-client is read through the client (client 1.16.0 or newer on the Vigiora network; an older client answers `unknown` with \"needs client 1.16.0\" in `message`). Cameras are checked when added, every 6 hours, and every 10 minutes while their clock cannot be read; with `camera_clock_autofix_enabled` a bad clock is then fixed automatically (`auto_fix`). When the camera was never checked, or with `refresh=true`, it is checked now (a check younger than 20 seconds is reused). A camera that is not an IP camera (a microphone) is `409 conflict`. Fix a bad clock with `POST /cameras/{camera_id}/actions/set-clock`.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "refresh",
            "in": "query",
            "description": "`true`: read the camera now instead of answering the stored check.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The clock check.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraClock"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateCameraClock",
        "summary": "Set the time zone a camera's clock should be in",
        "description": "API 1.50.0. Sets (`null` clears) the camera's own site zone: the zone its clock is compared with and set to. Without it a camera behind a vigiora-client uses its client's zone (`PATCH /clients/{client_id}`, else the one the client reports) and other cameras the server's. The camera is then read again (and, with `camera_clock_autofix_enabled`, fixed in the background); the answer is the new check. Audited (`camera.clock.timezone`).",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CameraClockZoneUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The clock check against the new zone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraClock"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/set-clock": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "setCameraClock",
        "summary": "Set a camera's clock to the server's",
        "description": "API 1.45.0. Sets the camera's clock to the server's UTC now and, when the camera takes them, its time zone to the camera's site zone (API 1.50.0: `site_timezone` of the clock check; before, always the server's) (as a POSIX TZ string) and time sync (NTP) on, keeping a time server the camera already has, else `pool.ntp.org`. Uses ONVIF `SetSystemDateAndTime` / `SetNTP` (WS-Security with the camera login, dated on the camera's own clock however wrong it is) or Hikvision ISAPI; on a Reolink camera (API 1.48.0) Reolink's own API, which also sets its time zone, daylight-saving rule and time sync (Reolink ignores them over ONVIF). It never leaves the camera worse: a refused time zone is retried without it, a refused time sync leaves the manual time, and a time sync that leaves the clock wrong (the camera cannot reach a time server) is undone back to the manual time. Then the clock is read again: `ok` says whether it is right now, `before` and `after` are the checks, `notes` what the camera refused. What the camera reports afterwards decides: some firmwares (Reolink over ONVIF) accept a time zone or time sync and keep their own, which `timezone_set` / `ntp_enabled` false and `notes` say. A camera that refuses the new time, or keeps its own time zone, answers `200` with `ok: false` and the reason in `message`. The camera login must be in the camera's stream address. `409 conflict` for a camera not on this server's network, or while a set is already running for it.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "manager",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "What was set (look at `ok`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraClockFix"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/actions/check-clock": {
      "post": {
        "operationId": "checkDetectedCameraClock",
        "summary": "Check the clock of a camera being added",
        "description": "API 1.45.0. The clock check of `GET /cameras/{camera_id}/clock` for a camera found by `POST /cameras/actions/detect` and not added yet (`detection_id`, yours and unexpired; `404` otherwise). Reads the camera now; nothing is stored or changed.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CameraClockDetectionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The clock check.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraClock"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/actions/set-clock": {
      "post": {
        "operationId": "setDetectedCameraClock",
        "summary": "Set the clock of a camera being added",
        "description": "API 1.45.0. `POST /cameras/{camera_id}/actions/set-clock` for a camera found by `POST /cameras/actions/detect` and not added yet (`detection_id`, yours and unexpired; `404` otherwise): the Add camera flow's \"Fix\". Same rules: time, then zone and time sync when the camera takes them, verified, never left worse.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CameraClockDetectionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was set (look at `ok`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraClockFix"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/frame": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraFrame",
        "summary": "Get a frame from the recordings",
        "description": "Extracts the picture closest to `at` from the camera's recorded footage (the finished segment covering that moment, decoded at the exact time). `at` needs an explicit offset and may not be in the future. No footage at that time is `404 no_recording` with `details.nearest_before` and `details.nearest_after` (the closest recorded moments, or `null`); the segment being written becomes available when it closes. `stream` other than the one the camera records is `404 no_recording` (`details.recorded_stream`). `X-Vigiora-Frame-Time` is the frame's time; `download=true` adds a `Content-Disposition` attachment named after the camera and time. Extraction runs ffmpeg: at most 30 a minute per credential (sharing the AI operations' concurrency cap; `429 rate_limited`). Through the cloud gateway a frame is a still image like a snapshot: it does not count against the free remote-video allowance.",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "at",
            "in": "query",
            "required": true,
            "description": "The moment (RFC 3339 with an offset).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "jpeg",
                "png"
              ],
              "default": "jpeg"
            }
          },
          {
            "name": "width",
            "in": "query",
            "description": "Scale down to this width (aspect kept; never up).",
            "schema": {
              "type": "integer",
              "minimum": 16,
              "maximum": 3840
            }
          },
          {
            "name": "quality",
            "in": "query",
            "description": "JPEG quality.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 85
            }
          },
          {
            "name": "stream",
            "in": "query",
            "description": "The recorded stream (`main` or `sub`); default the one the camera records.",
            "schema": {
              "type": "string",
              "enum": [
                "main",
                "sub"
              ]
            }
          },
          {
            "name": "download",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false",
                "1",
                "0"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The frame.",
            "headers": {
              "X-Vigiora-Frame-Time": {
                "$ref": "#/components/headers/FrameTime"
              },
              "Content-Disposition": {
                "$ref": "#/components/headers/FrameDisposition"
              }
            },
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/entries/{entry_id}/frame": {
      "parameters": [
        {
          "$ref": "#/components/parameters/EntryId"
        }
      ],
      "get": {
        "operationId": "getGuardianEntryFrame",
        "summary": "Get a Guardian entry's frame",
        "description": "The picture Guardian stored with the entry (`has_frame`): the moment of the analysed clip that shows the event best.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The JPEG.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/entries/{entry_id}/clip": {
      "parameters": [
        {
          "$ref": "#/components/parameters/EntryId"
        }
      ],
      "get": {
        "operationId": "getGuardianEntryClip",
        "summary": "Get a Guardian entry's clip",
        "description": "The short clip Guardian analysed (`has_clip`), as MP4. Through the cloud gateway of a free plan, a used-up remote-video allowance answers `429 relay_limit`. When the camera kept the clip's whole window in HD (`record_hd_on_motion`), the same window is served from the HD footage; what Guardian analysed is the low-quality recording (API 1.100.0).",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "MP4 video.",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/entries/actions/recompute-frames": {
      "post": {
        "operationId": "recomputeGuardianFrames",
        "summary": "Recompute the pictures of recent Guardian entries",
        "description": "One-off backfill of the best-frame choice (API 1.20.0): for the entries of the last `days` days (optionally one camera's, or the listed entries) whose clip has object-detector evidence, re-chooses the picture (see `frame_reason` on a Guardian entry), cuts it from the clip (or from the recording, for a moment just outside the clip), replaces the stored picture and its cached thumbnails, and records `frame_time`, `frame_reason` and `frame_box`. Entries without evidence, or whose picture already is the choice, are left as they are, so a second run changes nothing. `dry_run: true` reports the choices without changing anything. Never runs on its own.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecomputeFramesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What the run examined and changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecomputeFramesReport"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/entries/actions/recompute-clips": {
      "post": {
        "operationId": "recomputeGuardianClips",
        "summary": "Re-cut the clips of recent Guardian entries",
        "description": "One-off backfill of the clip pre-roll (API 1.24.0): for the entries of the last `days` days (optionally one camera's, or the listed entries) whose clip was recorded live, re-cuts the clip from the camera's recording by the rule live clips follow: from the motion trigger minus the camera's pre-roll to 10 s after it, widened by up to 5 s on either side (20 s in all) to cover what the object detectors saw. It replaces the clip file in place and records `clip_start`, `clip_end` and `clip_reason` (`extended` when detections widened it, else `preroll_recording`). Entries already cut with the pre-roll, whose old clip already holds the window, whose trigger time is unknown, or without a recording of the window are left as they are, so a second run changes nothing. `dry_run: true` reports the new windows without changing anything. Never runs on its own.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecomputeClipsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What the run examined and changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecomputeClipsReport"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/clips/settings": {
      "get": {
        "operationId": "getGuardianClipSettings",
        "summary": "Guardian clip settings",
        "description": "How many seconds before the motion that triggered it a Guardian clip starts (the server-wide pre-roll; a camera's `guardian_clip_preroll_sec` overrides it). API 1.24.0.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianClipSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateGuardianClipSettings",
        "summary": "Change the Guardian clip settings",
        "description": "Sets `preroll_seconds` (0–10) for new clips. Audited. API 1.24.0.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GuardianClipSettings"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardianClipSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/groups/{group_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/GroupId"
        }
      ],
      "get": {
        "operationId": "getGroup",
        "summary": "Get a group",
        "tags": [
          "Users"
        ],
        "security": [
          {
            "apiKey": [
              "users:read"
            ]
          },
          {
            "apiKeyHeader": [
              "users:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "users:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The group.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Group"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateGroup",
        "summary": "Update a group",
        "description": "Changes only the fields sent; `user_ids`, `camera_grants` and `site_grants` replace the current lists. Audited.",
        "tags": [
          "Users"
        ],
        "security": [
          {
            "apiKey": [
              "users:write"
            ]
          },
          {
            "apiKeyHeader": [
              "users:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "users:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The group.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Group"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteGroup",
        "summary": "Delete a group",
        "description": "Its members lose the permissions it granted. Audited.",
        "tags": [
          "Users"
        ],
        "security": [
          {
            "apiKey": [
              "users:write"
            ]
          },
          {
            "apiKeyHeader": [
              "users:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "users:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/layout-sequences": {
      "get": {
        "operationId": "listLayoutSequences",
        "summary": "List layout sequences",
        "description": "The caller's rotations of layouts (the wall display cycles through them).",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of sequences.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LayoutSequencePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createLayoutSequence",
        "summary": "Create a layout sequence",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LayoutSequenceCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The sequence.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LayoutSequence"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/layout-sequences/{layout_sequence_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LayoutSequenceId"
        }
      ],
      "delete": {
        "operationId": "deleteLayoutSequence",
        "summary": "Delete a layout sequence",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/faces/{face_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/FaceId"
        }
      ],
      "patch": {
        "operationId": "renameFace",
        "summary": "Name a face",
        "description": "Names an enrolled face (biometric data: admins with the `admin` scope; audited). Its past alerts are relabelled (`face:<name>`). Pending faces (`det-…`) are enrolled by the camera's face service first (`409 conflict`).",
        "tags": [
          "Faces"
        ],
        "security": [
          {
            "apiKey": [
              "admin"
            ]
          },
          {
            "apiKeyHeader": [
              "admin"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "admin"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FaceRename"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The face.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Face"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteFace",
        "summary": "Delete a face",
        "description": "Deletes an enrolled face and its photo (biometric data: admins with the `admin` scope; audited). A pending face (`det-<alert id>`, API 1.33.2) is deleted with its alert and pictures; with `not_a_face=true` (\"Not a face\") the camera's face runner also ignores that spot of the picture for an hour.",
        "tags": [
          "Faces"
        ],
        "security": [
          {
            "apiKey": [
              "admin"
            ]
          },
          {
            "apiKeyHeader": [
              "admin"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "admin"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "name": "not_a_face",
            "in": "query",
            "description": "API 1.33.2. For a pending face, `true` also tells the camera's face runner to ignore that spot.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alerts/{alert_id}/face-photo": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AlertId"
        }
      ],
      "get": {
        "operationId": "getAlertFacePhoto",
        "summary": "Get an alert's face crop",
        "description": "The face crop of a face alert (a pending face).",
        "tags": [
          "Faces"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The JPEG.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/stt-providers": {
      "get": {
        "operationId": "listSTTProviders",
        "summary": "List speech-to-text providers",
        "description": "The `stt_provider` choices for rooms and whether each runs on this server. One page.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The providers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/STTProviderPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/inventory": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "get": {
        "operationId": "getRoomInventory",
        "summary": "Get a room's stock list",
        "description": "The products AI Live answers questions about (at most 5000).",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoomInventory"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteRoomInventory",
        "summary": "Clear a room's stock list",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Cleared."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/inventory/actions/replace": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "post": {
        "operationId": "replaceRoomInventory",
        "summary": "Replace a room's stock list",
        "description": "Needs the admin or operator role and operator permission on every camera of the room.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InventoryReplace"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoomInventory"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/outputs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "get": {
        "operationId": "listRoomOutputs",
        "summary": "List a room's speakers",
        "description": "The enabled speakers linked to the room, the default first. One page.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The speakers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutputPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateRoomOutputs",
        "summary": "Set a room's speakers",
        "description": "Replaces the room's speakers and its default. Needs the admin or operator role and operator permission on every camera of the room.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoomOutputsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The speakers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutputPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/actuations": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "get": {
        "operationId": "listRoomActuations",
        "summary": "List a room's actuations",
        "description": "The latest 50 PTZ and speak attempts in the room (AI Live and operators), newest first. One page.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The actuations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoomActuationPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/actions/speak": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "post": {
        "operationId": "speakInRoom",
        "summary": "Speak in a room",
        "description": "Says `text` aloud (text to speech) through the room's default speaker, `output_id`, or all of them. Needs the admin or operator role and operator permission on every camera of the room. A speaker that refused or did not answer is `502 ptz_failed`.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoomSpeak"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Spoken.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActuationResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/actions/play-audio": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "post": {
        "operationId": "playAudioInRoom",
        "summary": "Play audio in a room",
        "description": "Plays a short clip (base64; the request is at most 64 KB) through the room's speakers. Needs the admin or operator role and operator permission on every camera of the room.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoomPlayAudio"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Played.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActuationResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/actions/move-ptz": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "post": {
        "operationId": "movePTZInRoom",
        "summary": "Move a room camera",
        "description": "A bounded move of one of the room's PTZ cameras, logged as a room actuation. Needs the admin or operator role and operator permission on every camera of the room.",
        "tags": [
          "PTZ"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoomPTZMove"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Moved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActuationResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/ai-live/actions/start": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "post": {
        "operationId": "startRoomAILive",
        "summary": "Start AI Live in a room",
        "description": "Starts (or reuses) the room's AI Live session: the AI watches and listens to the room's cameras and answers on its cards (uses AI credits while a viewer polls the messages). Admins and operators with viewer permission on every camera of the room. A room whose `ai_mode` is `guardian` never runs AI Live: `409 conflict`. Omitted overrides use the room's settings; a value that is sent must be valid (the room validator: `mode` video, audio or both, `interval_seconds` 2–300), else `400 validation_error`, never a silent fallback.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoomAILiveStart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AILiveSession"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/ai-live/actions/stop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "post": {
        "operationId": "stopRoomAILive",
        "summary": "Stop AI Live in a room",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Stopped.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Stopped"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/ai-live/messages": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "get": {
        "operationId": "listRoomAILiveMessages",
        "summary": "Get a room's AI Live cards",
        "description": "The cards with an id above `since_id` (the last 12 hours on the first call), and the session status. Polling keeps a running session going (the viewer heartbeat), so it needs `guardian:write`.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-read-only": false,
        "parameters": [
          {
            "name": "since_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The cards.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AILiveMessages"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/ai-live/actions/feedback": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "post": {
        "operationId": "recordRoomAILiveFeedback",
        "summary": "Mark an AI Live suggestion",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AILiveFeedback"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackRecorded"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/ai-live/digest": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "get": {
        "operationId": "getRoomAILiveDigest",
        "summary": "Get a room's daily AI Live digest",
        "description": "One AI summary of what customers asked for that day (cached; the per-credential AI limits apply).",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-read-only": false,
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "YYYY-MM-DD (default today).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The digest.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AILiveDigest"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/alert-rules": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "get": {
        "operationId": "listRoomAlertRules",
        "summary": "List a room's Guardian alert rules",
        "description": "Rules of the room, by ascending id. While the room's `ai_mode` is `guardian` or `both` they are checked, with each camera's own rules, on every camera of the room (detector confirmation, cooldowns and severity as for camera rules; a room rule's cooldown is the rule's own, across the room's cameras). Viewer permission on every camera of the room. API 1.16.0.",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of rules.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoomAlertRulePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createRoomAlertRule",
        "summary": "Create a room Guardian alert rule",
        "description": "Same body and checks as `POST /cameras/{camera_id}/alert-rules`. The rule is checked on the room's cameras that have AI and a motion trigger while the room's `ai_mode` is `guardian` or `both`; otherwise `warnings` lists `room_not_guardian`. Admins and operators with operator permission on every camera of the room. API 1.16.0.",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertRuleCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The rule.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoomAlertRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/alert-rules/{alert_rule_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        },
        {
          "$ref": "#/components/parameters/AlertRuleId"
        }
      ],
      "get": {
        "operationId": "getRoomAlertRule",
        "summary": "Get a room Guardian alert rule",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The rule.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoomAlertRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateRoomAlertRule",
        "summary": "Update a room Guardian alert rule",
        "description": "Changes only the fields sent; same checks as `PATCH /alert-rules/{alert_rule_id}`.",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertRuleUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The rule.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoomAlertRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteRoomAlertRule",
        "summary": "Delete a room Guardian alert rule",
        "tags": [
          "Alert rules"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:write"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/rooms/{room_id}/guardian-entries": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "get": {
        "operationId": "listRoomGuardianEntries",
        "summary": "List a room's Guardian entries",
        "description": "The Guardian descriptions (`seen`), transcripts (`heard`) and alerts of the room's cameras, in the `GET /briefing/feed` shape: the first page is the newest items; call again with the returned `cursor` for the items after it. Viewer permission on every camera of the room. API 1.16.0.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "types",
            "in": "query",
            "description": "Comma-separated item types: `seen`, `heard`, `alerts`, `camera` (default `seen,heard,alerts`).",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "The entries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/output-devices": {
      "get": {
        "operationId": "listOutputDevices",
        "summary": "List output devices (tools)",
        "description": "API 1.54.0. Every physical device Vigiora can act with, in one list (the web app's Tools page): speakers (camera speakers, including the ones Vigiora added by itself, USB and Google Cast speakers; client speakers for admins), the cameras' own sirens, and the Home Assistant / Zigbee devices shared with Vigiora for control (lights, switches, locks, covers, …) with their live state. Cameras the caller cannot view are left out. Change speakers with the outputs operations, devices with setIoTDeviceEntity.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The devices.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutputDeviceList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alert-speaker/settings": {
      "get": {
        "operationId": "getAlertSpeakerSettings",
        "summary": "Camera speaker alert settings",
        "description": "API 1.54.0. The server-wide setting for alerts on camera speakers (see AlertSpeakerSettings), with the alarm panels shared with Vigiora, their state, whether announcements are available, and the built-in announcement per language.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The setting.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertSpeakerSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateAlertSpeakerSettings",
        "summary": "Change camera speaker alert settings",
        "description": "API 1.54.0. Admins. Only the fields sent change. Turning alerts on camera speakers on, or the camera's own siren, makes cameras sound in the real world: agents confirm first. Emits settings.changed (resource alert_speaker).",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertSpeakerSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The setting.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertSpeakerSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alert-speaker/cameras": {
      "get": {
        "operationId": "listSpeakerCameras",
        "summary": "Cameras with a speaker",
        "description": "API 1.54.0. The cameras this server streams that have a speaker Vigiora can use: `voice` (announcements, chime, siren sound) or `siren` (only the camera's own siren). Cameras the caller cannot view are left out.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The cameras.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeakerCameraList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alert-speaker/actions/test": {
      "post": {
        "operationId": "testAlertSpeaker",
        "summary": "Test a camera speaker",
        "description": "API 1.54.0. Plays `sound` on the camera now (no quiet hours, arm mode or cooldown; one play per camera at a time, an operator's live talk wins). Tests are short: one play, a siren 3 s. Without `message` the announcement is a built-in test sentence. Needs operator permission on the camera; a camera without a speaker Vigiora can use is 409. The outcome is recorded and audit-logged like an alert's.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertSpeakerTest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The outcome (also when skipped or failed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertSpeakerPlayResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alert-speaker/plays": {
      "get": {
        "operationId": "listAlertSpeakerPlays",
        "summary": "Camera speaker plays",
        "description": "API 1.54.0. Every play on a camera speaker, skipped or failed one (alerts and tests), newest first. Only the caller's cameras.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "alert_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of plays.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertSpeakerPlayPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/sounds/active": {
      "get": {
        "operationId": "listActiveSounds",
        "summary": "Sounds playing now",
        "description": "API 1.105.0. Every siren Vigiora started that may still be sounding or is being switched off: camera sirens and Home Assistant sirens. `state`: `starting` (the \"on\" was sent, no answer yet), `sounding` (its off is due at `stop_by`), `self_ending` (the device stops by itself at about `stop_by`), `stopping` (an off was sent and not confirmed; it may still be sounding and Vigiora keeps retrying on a new login: 2, 5, 10, 30 s, then every minute for 24 hours), `stop_failed` (no confirmed off in 24 hours; shown for 48 hours until dismissed). `hushed_until`: Stop all sounds was used by an admin or operator and automatic sounds (alert rules) stay off until then. `length_set_by_device`: a self-ending play of one cycle, whose length the device decides (`stop_by` is an estimate). The web app shows its red Stop button while this list has a run in `starting`, `sounding`, `self_ending`, `stopping` or `stop_failed`. Only the caller's cameras; Home Assistant sirens and runs of deleted cameras only for admins and operators.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "What may be sounding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActiveSounds"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/sounds/actions/stop-all": {
      "post": {
        "operationId": "stopAllSounds",
        "summary": "Stop all sounds",
        "description": "API 1.105.0. Makes everything quiet at once. Every role that can see alerts may call it; what it reaches depends on who calls. Everyone: every camera siren Vigiora started on a camera the caller can see gets its off now (on a new login), every other Reolink siren camera the caller can see gets one off too (an off is harmless), and announcements and chimes in progress on those cameras stop within half a second. Admins and operators (an API key also needs `cameras:control`) reach the whole house: also Home Assistant sirens (the ones Vigiora started and every siren shared for control), runs of deleted cameras and running light effects; and then automatic sounds (alert rules) stay off for 10 minutes, so the same alert does not start the noise again (`hushed_until`; null when this call did not start the pause). An explicit start by a person or an agent still works during the pause. Waits up to about 8 s for the first offs and answers the honest result: `stopped` were confirmed off (or ended by themselves), `stopping` are still being retried (they may be sounding; see GET /sounds/active). Always safe to call, also when nothing sounds (200 with zero counts); it never makes a sound. Needs no confirmation.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "What was stopped.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StopAllSoundsResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/sounds/{sound_id}/actions/dismiss": {
      "parameters": [
        {
          "name": "sound_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer",
            "minimum": 1
          }
        }
      ],
      "post": {
        "operationId": "dismissSound",
        "summary": "Dismiss a siren that could not be switched off",
        "description": "API 1.105.0. A person says a siren Vigiora could not switch off is quiet now (unplugged, silenced in the maker's app): Vigiora stops retrying the off and stops the \"could not silence\" notifications. Only for a sound in state `sounding`, `stopping` or `stop_failed` (else 409). Admins and operators with operator permission on the camera; asks for confirmation while human in the loop is on, because a wrong dismissal leaves a siren sounding with nobody trying to stop it.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "200": {
            "description": "The sound, now dismissed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SoundRun"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/siren": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "startCameraSiren",
        "summary": "Sound a camera's siren",
        "description": "API 1.105.0. Sounds the camera's own built-in siren now. THIS MAKES A LOUD NOISE IN A REAL BUILDING: people nearby will hear it. Use it only when the user asked for the siren. `seconds` (default 10) is the wanted length; Vigiora limits it centrally: at most 15 s per run and at most 60 s of siren per camera in any 10 minutes (more is `429 rate_limited`). The camera's self-ending mode (it plays a few cycles and stops by itself) is always tried first; a camera that only knows on/off is switched off by Vigiora at the end, retried on a new login until the camera confirms. The siren is stored before it sounds, so a restart does not leave it on. Answers as soon as the siren is on; the result has `run_id` and `stop_state` (see GET /sounds/active). Stop it any time with POST /cameras/{camera_id}/actions/stop-siren or POST /sounds/actions/stop-all (always safe). Works for Reolink and Hikvision cameras on the local network with a built-in siren; any other camera is `422 speaker_not_supported`; a camera already playing a sound is `409 conflict`; a camera whose last siren was not confirmed off yet is `409 conflict` with `reason: siren_not_off` (stop or dismiss that one first). The self-ending play is one cycle, whose length the camera decides (`length_set_by_device` in GET /sounds/active). Not blocked by the 10-minute pause after Stop all sounds (that pause holds automatic alert sounds only). The same safe path serves POST /alert-speaker/actions/test with `sound: siren` (a 3 s test). Admins and operators with operator permission on the camera; asks for confirmation while human in the loop is on. Audited.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CameraSirenStart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The outcome (`result` failed when the camera did not take the siren).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertSpeakerPlayResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/stop-siren": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "stopCameraSiren",
        "summary": "Switch a camera's siren off",
        "description": "API 1.105.0. Switches the camera's siren off now: every siren run Vigiora started on it gets its off on a new login (retried until the camera confirms); with none, a Reolink siren still gets one off (the camera's own alarm may be sounding). `confirmed` tells whether the camera confirmed it. Always safe to call, also when nothing sounds or the camera has no siren (200); it never makes a sound. Open to every role that can see the camera. Needs no confirmation.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "What was stopped.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraSirenStopResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/check-speaker": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "checkCameraSpeaker",
        "summary": "Check a camera's speaker now",
        "description": "API 1.54.0. Checks the camera's speaker now (its audio backchannel, then the camera's own API for a siren) and stores the result, as the background check does; a camera with a voice speaker gets its automatic speaker output. Contacts the camera; plays nothing. Operator permission on the camera.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The camera's speaker.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraSpeaker"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/outputs": {
      "get": {
        "operationId": "listOutputs",
        "summary": "List speakers",
        "description": "Audio outputs: camera speakers (cameras the caller may view) and vigiora-client USB and Cast speakers.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of speakers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutputPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createOutput",
        "summary": "Add a speaker",
        "description": "`camera_backchannel` (a camera's own speaker, `camera_id`: operator permission), `usb` (`client_id` and `device`) or `cast` (`client_id`, `device` = host:port). Client speakers are admins' (`GET /clients/{client_id}/audio-outputs` lists a client's devices). A camera speaker's `client_id` is optional (API 1.12): when the camera has no vigiora-client, this server plays the audio through its own go2rtc (the camera's ONVIF two-way audio), whatever `client_id` says.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OutputCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The speaker.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Output"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/outputs/{output_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OutputId"
        }
      ],
      "patch": {
        "operationId": "updateOutput",
        "summary": "Update a speaker",
        "description": "`kind` and `camera_id` never change. A camera speaker's `client_id` can (API 1.12): a vigiora-client, or `null` for this server; a USB or Cast speaker's cannot (400).",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OutputUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The speaker.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Output"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteOutput",
        "summary": "Delete a speaker",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/outputs/{output_id}/actions/test": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OutputId"
        }
      ],
      "post": {
        "operationId": "testOutput",
        "summary": "Test a speaker",
        "description": "Says a short test message aloud through the speaker.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OutputTest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Played.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutputTested"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clients/{client_id}/audio-outputs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClientId"
        }
      ],
      "get": {
        "operationId": "listClientAudioOutputs",
        "summary": "List a client's audio devices",
        "description": "The USB speakers and Cast devices a vigiora-client offers (asked live; `502` when it does not answer).",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The devices.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientAudioOutputs"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/briefing": {
      "get": {
        "operationId": "getBriefing",
        "summary": "Get the Briefing",
        "description": "What needs attention on the caller's cameras (alerts, Guardian events, health, setup), as the dashboard shows it. For admins and operators, `health` (API 1.55.0) is the latest daily health check as one line (`report_id`, `status`, `summary`, `checked_at`, `warn`, `fail`); see `GET /system/health/reports/latest`.",
        "tags": [
          "Briefing"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "`today`, `24h`, `7d`, … (default `today`).",
            "schema": {
              "type": "string",
              "maxLength": 16
            }
          },
          {
            "name": "camera_ids",
            "in": "query",
            "description": "Comma-separated camera ids (default every camera the caller may view).",
            "schema": {
              "type": "string",
              "maxLength": 1000
            }
          },
          {
            "name": "types",
            "in": "query",
            "description": "Comma-separated item types.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "The Briefing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/briefing/recap": {
      "get": {
        "operationId": "getBriefingRecap",
        "summary": "Get the Briefing recap",
        "description": "The AI-written summary of the period (cached; an API key never triggers a new one).",
        "tags": [
          "Briefing"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "`today`, `24h`, `7d`, … (default `today`).",
            "schema": {
              "type": "string",
              "maxLength": 16
            }
          },
          {
            "name": "camera_ids",
            "in": "query",
            "description": "Comma-separated camera ids (default every camera the caller may view).",
            "schema": {
              "type": "string",
              "maxLength": 1000
            }
          },
          {
            "name": "types",
            "in": "query",
            "description": "Comma-separated item types.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "description": "The recap.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/briefing/recap/actions/refresh": {
      "post": {
        "operationId": "refreshBriefingRecap",
        "summary": "Refresh the Briefing recap",
        "description": "Writes a new AI recap now (uses AI credits; the per-credential AI limits apply).",
        "tags": [
          "Briefing"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "`today`, `24h`, `7d`, … (default `today`).",
            "schema": {
              "type": "string",
              "maxLength": 16
            }
          },
          {
            "name": "camera_ids",
            "in": "query",
            "description": "Comma-separated camera ids (default every camera the caller may view).",
            "schema": {
              "type": "string",
              "maxLength": 1000
            }
          },
          {
            "name": "types",
            "in": "query",
            "description": "Comma-separated item types.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The recap.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/briefing/feed": {
      "get": {
        "operationId": "getBriefingFeed",
        "summary": "Get the Briefing activity feed",
        "tags": [
          "Briefing"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "camera_ids",
            "in": "query",
            "description": "Comma-separated camera ids (default every camera the caller may view).",
            "schema": {
              "type": "string",
              "maxLength": 1000
            }
          },
          {
            "name": "types",
            "in": "query",
            "description": "Comma-separated item types.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "The feed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/briefing/items/{briefing_item_token}/actions/mark-reviewed": {
      "parameters": [
        {
          "$ref": "#/components/parameters/BriefingItemToken"
        }
      ],
      "post": {
        "operationId": "markBriefingReviewed",
        "summary": "Mark a Briefing item reviewed",
        "description": "For the caller; an alert item is also acknowledged when the caller is an admin or operator with operator permission.",
        "tags": [
          "Briefing"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Marked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BriefingReviewed"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/briefing/items/{briefing_item_token}/actions/unmark-reviewed": {
      "parameters": [
        {
          "$ref": "#/components/parameters/BriefingItemToken"
        }
      ],
      "post": {
        "operationId": "unmarkBriefingReviewed",
        "summary": "Mark a Briefing item unreviewed",
        "tags": [
          "Briefing"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Unmarked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BriefingReviewed"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/conversations": {
      "get": {
        "operationId": "listGuardianConversations",
        "summary": "List Guardian conversations",
        "description": "The caller's own chat conversations (newest first, at most 50): with `camera_id`, that camera's and the general ones. One page.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The conversations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createGuardianConversation",
        "summary": "Start a Guardian conversation",
        "description": "Pass its id as `conversation_id` to `POST /guardian/chat` to keep the exchange.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The conversation.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/conversations/{conversation_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ConversationId"
        }
      ],
      "patch": {
        "operationId": "updateGuardianConversation",
        "summary": "Rename a Guardian conversation",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The conversation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteGuardianConversation",
        "summary": "Delete a Guardian conversation",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/conversations/{conversation_id}/messages": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ConversationId"
        }
      ],
      "get": {
        "operationId": "listGuardianConversationMessages",
        "summary": "Get a conversation's messages",
        "description": "Oldest first. One page.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The messages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagePage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/guardian/transcripts": {
      "get": {
        "operationId": "listTranscripts",
        "summary": "List speech transcripts",
        "description": "What the microphones of the cameras the caller may view heard (speech to text), newest first.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Started at or after.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Started before.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of transcripts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/ai-live/sessions": {
      "get": {
        "operationId": "listCameraAILiveSessions",
        "summary": "List AI Live sessions",
        "tags": [
          "AI Live"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "active",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sessions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraAILiveSessionPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "startCameraAILiveSession",
        "summary": "Start AI Live on a camera",
        "description": "The AI watches (and listens to) the camera and answers `instruction` on its cards while someone polls the messages (uses AI credits). Needs the `hal-live` service on the camera; an identical running session is reused. At most 3 active sessions per user (`429`).",
        "tags": [
          "AI Live"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CameraAILiveStart"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The session.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraAILiveSession"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/ai-live/sessions/{ai_live_session_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AiLiveSessionId"
        }
      ],
      "delete": {
        "operationId": "deleteCameraAILiveSession",
        "summary": "Delete an AI Live session",
        "description": "Deletes the session and its cards: operator permission unless the caller started it.",
        "tags": [
          "AI Live"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/ai-live/sessions/{ai_live_session_id}/actions/stop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AiLiveSessionId"
        }
      ],
      "post": {
        "operationId": "stopCameraAILiveSession",
        "summary": "Stop an AI Live session",
        "tags": [
          "AI Live"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Stopped.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AILiveStopped"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/ai-live/sessions/{ai_live_session_id}/actions/set-mode": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AiLiveSessionId"
        }
      ],
      "post": {
        "operationId": "setCameraAILiveSessionMode",
        "summary": "Change what AI Live watches",
        "tags": [
          "AI Live"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AILiveModeSet"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AILiveModeResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/ai-live/sessions/{ai_live_session_id}/messages": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AiLiveSessionId"
        }
      ],
      "get": {
        "operationId": "listCameraAILiveSessionMessages",
        "summary": "Get an AI Live session's cards",
        "description": "Cards with an id above `since_id`. Polling keeps the session running (the viewer heartbeat), so it needs `guardian:write`.",
        "tags": [
          "AI Live"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-read-only": false,
        "parameters": [
          {
            "name": "since_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The cards.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AILiveMessages"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/ai-live/history": {
      "get": {
        "operationId": "getAILiveHistory",
        "summary": "Get a camera's AI Live history",
        "description": "The AI Live cards of a camera in a time window (both `from` and `to`; default the last 24 hours), newest first, at most 500.",
        "tags": [
          "AI Live"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "camera_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The cards.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AILiveMessagePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/detection-events": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listCameraDetectionEvents",
        "summary": "List a camera's detection events",
        "description": "One feed of what was detected on the camera, oldest first: this server's detections grouped into events (one per tracked object, plus single detections; `source` `core-ai`, `alert_id` its latest alert) and the reports of the Vision Engine services attached to the camera (enrolled for it or assigned to it; `source` and `service` = the service, e.g. `hal-objects`, `hal-face`; `confidence` and `bbox` read from the report, the raw report in `attributes` when at most 2 KB). Vision Engine reports are kept 30 days (server setting `hal_events_retention_days`). Filter with `source` (repeatable or comma-separated) and `label`.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "`core-ai`, or a Vision Engine service name; repeatable or comma-separated (default all).",
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "label",
            "in": "query",
            "description": "Exact label (`person`, `face`, `car`, …).",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of events.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DetectionEventPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/detection-tracks": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listCameraDetectionTracks",
        "summary": "List a camera's object tracks",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "label",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The tracks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/detection-boxes": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listCameraDetectionBoxes",
        "summary": "List the boxes around a camera's detected objects in a time window",
        "description": "API 1.110.0. What Playback draws over a recording: where detectors saw objects, as rectangles normalised to the frame (`x`, `y` = top-left corner, 0 to 1), for a window of at most 5 minutes; ask for the next window as the recording plays. Two sources: tracks of a camera with Analytics on (`source` is `track`: every observation of the object, 3 to 5 per second, kept for the Analytics raw-track retention, 7 days by default; person and vehicle classes only) and detections of the Vision Engine services and add-ons (`source` is the service: one box when the object is first seen, kept as long as the detection). A detection a track already shows is left out. `label` is as stored: a class, `face:<name>` or `plate:<text>`. `track_id` is the detector's id for the object, null when it sent none; ids of different sources are separate. The boxes are never part of a recording or an export. A box whose centre lies inside one of the camera's privacy masks is never returned (503 when the masks cannot be read).",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "After `from`, at most 5 minutes later.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The boxes, oldest first (at most 5000; `truncated` says more were cut).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DetectionBoxes"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alerts/{alert_id}/recording": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AlertId"
        }
      ],
      "get": {
        "operationId": "getAlertRecording",
        "summary": "Find the recording of an alert",
        "description": "The recording segment containing the alert's moment and the offset into it (`GET /recordings/{recording_id}/media`), `pending` while that moment is in the segment still being recorded, and the Guardian entry whose clip shows it (`guardian_clip_start` to seek in the clip).",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "Where to play it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRecording"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/recording-days": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "listCameraRecordingDays",
        "summary": "List the days with recordings",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "month",
            "in": "query",
            "required": true,
            "description": "YYYY-MM.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}$"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "description": "IANA zone the days are counted in (default UTC).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The days.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingDays"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/recordings/cameras": {
      "get": {
        "operationId": "listCamerasWithRecordings",
        "summary": "List cameras with recordings",
        "tags": [
          "Recordings"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The cameras.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CamerasWithRecordings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/shares/{share_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareId"
        }
      ],
      "delete": {
        "operationId": "revokeShare",
        "summary": "Revoke a share link of either kind",
        "description": "Revokes a clip link or a picture link (1.27.0) by its id: one the caller created, or any for an admin (a picture link made for a chat alert has no creator, so only an admin revokes it).",
        "tags": [
          "Clips"
        ],
        "security": [
          {
            "apiKey": [
              "clips:share"
            ]
          },
          {
            "apiKeyHeader": [
              "clips:share"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "clips:share"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "204": {
            "description": "Revoked."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/shares": {
      "get": {
        "operationId": "listAllClipShares",
        "summary": "List share links",
        "description": "Every public link the caller created (admins: everyone's, picture links made for chat alerts included). One page.",
        "tags": [
          "Clips"
        ],
        "security": [
          {
            "apiKey": [
              "clips:share"
            ]
          },
          {
            "apiKeyHeader": [
              "clips:share"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "clips:share"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The links.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharePage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clips/actions/preflight": {
      "post": {
        "operationId": "preflightClips",
        "summary": "Check clips before exporting",
        "description": "For each camera: whether footage covers the window and the expected size, against the caller's clip limits. With `kind: mosaic` (1.43.0) the set is checked as one mosaic clip.",
        "tags": [
          "Clips"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClipPreflight"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The check.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/weather/current": {
      "get": {
        "operationId": "getCurrentWeather",
        "summary": "Get the current weather",
        "description": "The server's current weather for the dashboard: the freshest recent camera-vision reading (sky, precipitation, fog, day/night, wet ground — what a camera can actually see) blended with an outdoor temperature and a place name that Vigiora resolves automatically. No AI credits (the background sampler owns the vision reads). source=none means nothing is available yet.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The current weather summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WeatherSummaryV1"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/counts": {
      "get": {
        "operationId": "listPeopleCounts",
        "summary": "List people counts",
        "description": "Per-minute people counts (peak and unique) of the cameras with a counter, newest first (at most 1000 rows).",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "hours",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 168,
              "default": 24
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/counts/latest": {
      "get": {
        "operationId": "getLatestPeopleCounts",
        "summary": "Get the latest people counts",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The latest counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/motion": {
      "get": {
        "operationId": "listMotionLevels",
        "summary": "List motion levels",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "hours",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 168,
              "default": 24
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The motion samples.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/motion/latest": {
      "get": {
        "operationId": "getLatestMotionLevels",
        "summary": "Get the latest motion levels",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The latest motion.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/dashboard": {
      "get": {
        "operationId": "getSystemDashboard",
        "summary": "Get the dashboard summary",
        "description": "The web app dashboard's aggregated view of the caller's cameras.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The dashboard.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/objects": {
      "get": {
        "operationId": "getSystemObjects",
        "summary": "Get current object counts",
        "description": "People, vehicles and other objects the detectors see now, over the caller's cameras.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/object-history": {
      "get": {
        "operationId": "getSystemObjectHistory",
        "summary": "Get object count history",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "hours",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 720,
              "default": 24
            }
          },
          {
            "name": "bucket_minutes",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1440
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The history.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/ai-status": {
      "get": {
        "operationId": "getSystemAIStatus",
        "summary": "Get the AI status",
        "description": "Whether the AI gateway is reachable and which AI features are paused or limited. `ai` is the AI availability (as in `getServer`, see `AIAvailability`): `ai.reason` `allowance_used` with `ai.resumes_at` when this month's Vigiora AI allowance is used up; `descriptions_paused` is true while only the automatic descriptions stop (`auto_reserved`, 70% of the allowance used).",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/ai-status/actions/retry": {
      "post": {
        "operationId": "retrySystemAI",
        "summary": "Retry the paused AI now",
        "description": "\"Retry now\" on the AI-paused banner. While the AI provider is paused (for example out of credit, `ai.reason` `provider_402`), Vigiora asks it again only every few minutes; this asks at once with one minimal call, so AI resumes right after a credit top-up without a restart. When AI is not paused, or is paused because the monthly AI allowance is used up (`allowance_used`: the server checks it every 15 minutes by itself), nothing is called. Answers the same body as `GET /system/ai-status`, read after the attempt (`ai.status` `ok` when the provider accepted). Changes no setting. API 1.86.0. Admins and operators.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": false,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The AI status after the attempt.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/plan": {
      "get": {
        "operationId": "getSystemPlan",
        "summary": "Get this server's entitlements",
        "description": "The licence's limits (cameras, AI cameras, add-ons) and their use.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The plan.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/cloud-plan": {
      "get": {
        "operationId": "getSystemCloudPlan",
        "summary": "Get the Vigiora cloud plan",
        "description": "This server's Vigiora cloud plan. Since 1.87.0 also `catalog` (the cloud's priced lines, null until one is stored), `cameras` (each enabled camera's Core AI / add-on state and whether it holds a free Core AI slot) and `monthly_cents` (the plan's current monthly total; 0 without a catalog).",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The plan.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/plan/cart": {
      "get": {
        "operationId": "getPlanCart",
        "summary": "Get the open plan cart",
        "description": "The open upgrade cart: the services and cameras the user wants to add to the plan. Nothing is charged here; payment happens on vigiora.com through the checkout link. API 1.88.0. Admins and operators. `cart` is null when none is open.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The open cart, or null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeCartResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/plan/cart/actions/add-items": {
      "post": {
        "operationId": "addPlanCartItems",
        "summary": "Add cameras to the plan cart",
        "description": "Adds the cameras to a service in the open cart (creating the cart if none is open). Cameras that do not exist, are disabled or already have the service are not added (never an error): `skipped` lists them with the reason, and the checkout link never charges for them. Unknown or coming-soon services and an empty camera list answer 400; a camera the caller may not operate answers 403 naming it. Once the cart's checkout link was issued, an add starts a new open cart (the checked-out one stays for the return trip). Nothing is charged. API 1.88.0; `skipped` and the per-camera check since 1.89.1.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": false,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradeCartItemsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The cart after the change, and the cameras that were not added.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeCartAddResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/plan/cart/actions/remove-items": {
      "post": {
        "operationId": "removePlanCartItems",
        "summary": "Remove cameras from the plan cart",
        "description": "Takes the cameras off a service in the open cart; the cart is closed when it empties (`cart` null). A camera the caller may not operate answers 403. Once the cart's checkout link was issued, a removal starts a new open cart (the checked-out one stays for the return trip). Nothing is charged. API 1.88.0.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": false,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradeCartItemsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The cart after the change, or null when it emptied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeCartResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/plan/cart/actions/checkout-url": {
      "post": {
        "operationId": "planCartCheckoutUrl",
        "summary": "Get the cart checkout link",
        "description": "Returns the vigiora.com link, prefilled with the cart and what the site has today, where the user pays; only cameras that would gain a service are counted. The cart is stamped `checked_out_at`. Nothing is charged here. Answers 409 `no_cart` when no cart is open. API 1.88.0.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": false,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The checkout link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutUrlResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/plan/cart/{cart_id}": {
      "get": {
        "operationId": "getPlanCartById",
        "summary": "Get a plan cart by id",
        "description": "Returns the cart in any status (open, checkout, paid, applied, partial, timeout). `applied` lists what is switched on, `items` what is still waiting for the licence, `skipped` what was not switched on and why (`reason`, `error`). A paid or partial cart still waiting 10 minutes after payment is timed out when read. Answers 404 for an unknown id. API 1.89.0.",
        "tags": [
          "System"
        ],
        "parameters": [
          {
            "name": "cart_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": false,
        "x-vigiora-destructive": false,
        "responses": {
          "200": {
            "description": "The cart.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeCartResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/plan/cart/{cart_id}/actions/paid": {
      "post": {
        "operationId": "markPlanCartPaid",
        "summary": "Mark a plan cart paid",
        "x-vigiora-mcp": false,
        "description": "Records that the user came back from vigiora.com having paid: an open (or checked-out) cart becomes paid, the licence is pulled at once and whatever the licence already covers is switched on. Calling it again returns the cart unchanged. Answers 404 for an unknown id. Not an MCP tool: only the return-trip page calls it (every licence pull also applies paid carts and carts the licence covers in full). API 1.89.0.",
        "tags": [
          "System"
        ],
        "parameters": [
          {
            "name": "cart_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": false,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The cart.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeCartResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/mesh": {
      "get": {
        "operationId": "getSystemMesh",
        "summary": "Get the mesh status",
        "description": "The Vigiora mesh (how vigiora-clients and remote access reach this server).",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/update": {
      "get": {
        "operationId": "getSystemUpdate",
        "summary": "Get the update status",
        "description": "The self-update status. `auto_install` reflects the \"Install updates automatically\" setting (`auto_update_enabled` of `GET /settings`): when it is false (the default) a newer signed release is downloaded and staged (state `ready`, with the version in `available`) and waits for `POST /system/update/actions/install`; when true the server restarts into it automatically.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/update/actions/check": {
      "post": {
        "operationId": "checkSystemUpdate",
        "summary": "Check for an update",
        "description": "Checks for a newer signed release now; the self-updater downloads and applies it as configured. Audited.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/update/actions/install": {
      "post": {
        "operationId": "installSystemUpdate",
        "summary": "Install the staged update",
        "description": "Installs the already-downloaded, staged update now: the server restarts into it. Used when \"Install updates automatically\" is off (`auto_update_enabled` false) and `GET /system/update` reports `ready` with a version in `available`. Idempotent and safe when nothing is staged — it then returns the current status rather than an error. Audited.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/edge": {
      "get": {
        "operationId": "getSystemEdge",
        "summary": "Get the edge status",
        "description": "The local HTTPS edge (certificates, listeners).",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/remote-access": {
      "get": {
        "operationId": "getRemoteAccess",
        "summary": "Get remote access",
        "description": "Whether the server is reachable from the internet through Vigiora cloud (`https://<site>.vigiora.com`).",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "Remote access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateRemoteAccess",
        "summary": "Switch remote access",
        "description": "Turns internet access through Vigiora cloud on or off: it changes the site's exposure. Audited. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoteAccessUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remote access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/health/inventory": {
      "get": {
        "operationId": "getHealthInventory",
        "summary": "Get the server's hardware inventory",
        "description": "What the server knows of its own hardware and software, collected at startup and with every health check: CPU, memory and swap, GPUs with their driver (and, for NVIDIA on Linux, the running kernel module, so a driver/module mismatch shows), disks with model, size, file system, mount and role (`os`, `recordings`, `db`, `data`), network interfaces with link speed, USB devices of interest (Zigbee coordinators, Bluetooth, audio, cameras), the OS, kernel and uptime, the Vigiora and PostgreSQL versions and the enrolled AI (Vision Engine) runners. `notes` says which probes could not run on this platform. Collected now when none is stored yet. API 1.55.0. Admins and operators.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The inventory.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthInventory"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/health/upgrades": {
      "get": {
        "operationId": "getHealthUpgrades",
        "summary": "Get the hardware upgrade suggestions",
        "description": "The hardware upgrade suggestions of the latest health report and the hardware they are fitted to. When the hardware holds the server back (memory nearly full or swapping, too little memory for the cameras, the CPU busy or slowing down for heat, no hardware video decoding, a disk filling up, failing or too slow), the daily check adds an `upgrade.<kind>` item; each suggestion has 2–3 options from the most convenient (cheapest, easiest) to the most \"pro\", each with a short why, an approximate price in US dollars and an Amazon search link built from the exact spec (no affiliate tag). Suggestions only: check compatibility before buying. Empty `upgrades` when nothing needs upgrading or before the first report. API 1.125.0. Admins and operators.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The suggestions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthUpgrades"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/health/disks": {
      "get": {
        "operationId": "getHealthDisks",
        "summary": "Get the disks' speed and space left",
        "description": "Every disk that holds the recordings, the database or the system: free space now, the last speed test (sequential write and read in MB/s, the latency of a small saved write), how busy the disk is right now (sampled for about a second: Linux /proc/diskstats, Windows performance counters, macOS iostat), what the cameras write (recordings disk), a speed verdict (`ok`, `warn` when too slow for the cameras or saturated, `unknown` before the first test) and the space forecast: the growth per day (measured on the disk, else what the cameras record), the date it is full, or — when retention deletes old footage first — the level it settles at. The speed test runs with the daily health check (at most once a day, never while the server is busy) and on demand. API 1.125.0. Admins and operators.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The disks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthDisks"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/health/disks/actions/benchmark": {
      "post": {
        "operationId": "benchmarkHealthDisks",
        "summary": "Test the disks' speed now",
        "description": "Runs the disk speed test now and answers with the disks (as `GET /system/health/disks`). Per recordings or data disk it writes a 32 MiB file in synced 1 MiB chunks, makes 20 small synced writes, reads the file back past the cache where the OS allows, and deletes it; at low I/O priority, a few seconds. When the server is busy (CPU load or a disk over half busy) the test does not run and `bench_skipped` says why; the last result stays. Changes nothing else. API 1.125.0. Admins and operators.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": false,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The disks with the new test.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthDisks"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/health/reports": {
      "get": {
        "operationId": "listHealthReports",
        "summary": "List health reports",
        "description": "The daily health checks (and the ones run on demand or at startup), newest first, kept 90 days. Each report has every check's status (`ok`, `warn`, `fail`, `skip`), a plain sentence and a fix hint, the one-line summary and the changes since the report before it. `since` keeps reports checked at or after it. API 1.55.0. Admins and operators.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "description": "Only reports checked at or after this time (RFC 3339).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of reports.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthReportPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/health/reports/latest": {
      "get": {
        "operationId": "getLatestHealthReport",
        "summary": "Get the latest health report",
        "description": "The newest report (`null` before the first), whether a check is running now (after `POST /system/health/actions/run`: poll until `running` is false) and when the next scheduled check runs (`null` when the daily check is turned off). API 1.55.0. Admins and operators.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The latest report and the schedule.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthLatest"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/health/reports/{health_report_id}": {
      "get": {
        "operationId": "getHealthReport",
        "summary": "Get a health report",
        "description": "One report. API 1.55.0. Admins and operators.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "health_report_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthReport"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/health/actions/run": {
      "post": {
        "operationId": "runHealthCheck",
        "summary": "Run the health check now",
        "description": "Starts a health check now (\"Run now\") and answers at once (`202`); it takes up to a minute (the disks' SMART reading waits for the root helper on Linux). Poll `GET /system/health/reports/latest` until `running` is false. The report is stored, notified and sent to Vigiora cloud like the daily one. One check runs at a time (`409 conflict`). Reads only: it changes nothing on the server. API 1.55.0. Admins and operators.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": false,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The check started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthRunResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/capacity": {
      "get": {
        "operationId": "getSystemCapacity",
        "summary": "How many more cameras the server can take",
        "description": "The last capacity check (`report`) and its answer (`verdict`); both are null before the first check. The server checks by itself about 10 minutes after it starts when the last check is older than a week, and `POST /system/capacity/actions/check` checks now. The check writes 256 MiB to the recordings disk (synced, then deleted) for its write speed and reads the free space, the CPU load per core, the memory, the network link speed and what the enabled cameras send (measured from their recordings, else estimated from their stream size). `verdict.more_cameras` is the smallest of the limits it could work out: disk write (half the measured speed), disk space (the free space less what the cameras will still add until their retention is full, over the cameras' retention), CPU (up to 70 % load per core) and network (half the link). A field the server could not measure is null and its limit is left out. With no cameras the figures are for a typical 1080p 15 fps camera. API 1.95.0. Feature `system_capacity`. Admins and operators.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The last check, or nulls before the first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemCapacity"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/capacity/actions/check": {
      "post": {
        "operationId": "checkSystemCapacity",
        "summary": "Check the server's capacity now",
        "description": "Runs the capacity check now and answers its result (synchronous, up to a minute; usually a few seconds). The result is stored and `GET /system/capacity` returns it from then on. One check runs at a time (`409 conflict`). It writes and deletes one temporary file and changes nothing else. API 1.95.0. Admins and operators.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": false,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new check.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemCapacity"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/health/settings": {
      "get": {
        "operationId": "getHealthSettings",
        "summary": "Get the health check settings",
        "description": "When the daily check runs (`time`, HH:MM in the server's time zone `time_zone`; default 07:00), whether it runs (`enabled`), when to notify through push and email (`notify`: `always`, `problems` — default, only when something is warn or fail — or `never`) and whether the summary goes to Vigiora cloud (`cloud`, default true). API 1.55.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateHealthSettings",
        "summary": "Change the health check settings",
        "description": "Changes any of `enabled`, `time` (HH:MM, 24-hour clock, the server's time zone), `notify` (`always`, `problems`, `never`) and `cloud` (send the summary to Vigiora cloud). The schedule follows at once. API 1.55.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HealthSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settings now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/client-errors": {
      "get": {
        "operationId": "listClientErrors",
        "summary": "List client error reports",
        "description": "The web app's uncaught errors (the \"Something went wrong\" page, window errors, unhandled promise rejections), as the browser reported them to `POST /api/client-errors`, grouped by fingerprint (message without numbers + top stack frames) and newest-seen first. Each report carries its count, when it was first and last seen, the page (`url`, path only), the web build and server version it happened on and the reporting user's id and role when signed in. `unresolved` (default true) hides reports marked resolved; `since` keeps reports last seen at or after it; `q` matches the message or url. API 1.41.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "unresolved",
            "in": "query",
            "description": "Only reports not marked resolved (default true).",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "since",
            "in": "query",
            "description": "Only reports last seen at or after this time (RFC 3339).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "A substring of the message or the page path (case-insensitive).",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of reports.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientErrorPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/client-errors/actions/resolve-all": {
      "post": {
        "operationId": "resolveAllClientErrors",
        "summary": "Resolve every client error report",
        "description": "Marks every unresolved report resolved, with an optional `note`. Reversible per report with unresolve. API 1.41.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientErrorResolve"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many reports were resolved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientErrorsResolved"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/client-errors/{client_error_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClientErrorId"
        }
      ],
      "get": {
        "operationId": "getClientError",
        "summary": "Get a client error report",
        "description": "One report with its full stack and component stack. API 1.41.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/client-errors/{client_error_id}/actions/resolve": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClientErrorId"
        }
      ],
      "post": {
        "operationId": "resolveClientError",
        "summary": "Resolve a client error report",
        "description": "Marks the report resolved now, with an optional `note` (what was fixed, in which version). A report that fires again after that comes back unresolved with its count going on. Audited. API 1.41.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientErrorResolve"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The report, resolved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientError"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/client-errors/{client_error_id}/actions/unresolve": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClientErrorId"
        }
      ],
      "post": {
        "operationId": "unresolveClientError",
        "summary": "Unresolve a client error report",
        "description": "Puts the report back on the unresolved list (the fix did not hold). API 1.41.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The report, unresolved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientError"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/branding": {
      "get": {
        "operationId": "getBranding",
        "summary": "Get the server's custom branding",
        "description": "API 1.120.0. The name, logo and accent colour this server shows instead of Vigiora, and what is applied now (`effective`). The name is free on every server; the logo, the accent colour and hiding the small \"Powered by Vigiora\" line need a plan with custom branding (`entitled`). Without it those values are kept but not applied. `logo_url` is the public picture at `/api/branding/logo` (a PNG this server made; the `v` query is the version, so it may be cached). The sign-in page reads only `effective` from the public `/api/branding/public`.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-read-only": true,
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The branding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Branding"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateBranding",
        "summary": "Change the server's name, accent colour or Powered by line",
        "description": "API 1.120.0. `name`: plain text shown instead of Vigiora, trimmed, at most 40 characters, no control characters; an empty string goes back to Vigiora (free). `accent_color`: `#rrggbb`, or an empty string for Vigiora's own colour. `hide_powered_by`: hide the \"Powered by Vigiora\" line on the sign-in page and in About. Setting a colour or hiding the line needs a plan with custom branding: without it `402 limit_reached` with `details.limit` `feature:branding` (clearing them is always allowed). At least one field. Audited. Admins only.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrandingUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The branding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Branding"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/branding/logo": {
      "put": {
        "operationId": "uploadBrandingLogo",
        "summary": "Upload the server's logo",
        "description": "API 1.120.0. Replaces the logo. Send the picture as the raw body (`Content-Type` `image/png`, `image/jpeg` or `image/webp`), or as JSON with it base64-encoded in `image_base64` (MCP clients). At most 512 KB. No SVG. The server decodes the picture and stores a new PNG of at most 512 pixels on the long side, so the uploaded bytes are never served. Needs a plan with custom branding (`402 limit_reached`, `details.limit` `feature:branding`). `413` too big, `415` another type, `400` not a readable picture. Audited. Admins only.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrandingLogoUpload"
              }
            },
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/webp": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The branding with the new logo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Branding"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteBrandingLogo",
        "summary": "Remove the server's logo",
        "description": "API 1.120.0. Goes back to the Vigiora logo. Always allowed, with or without the plan. Audited. Admins only.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": true,
        "responses": {
          "200": {
            "description": "The branding without a logo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Branding"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/error-reports": {
      "get": {
        "operationId": "listErrorReports",
        "summary": "List error reports for Vigiora",
        "description": "Reports of this server's own failures, kept to be sent to Vigiora so the problem can be fixed: `panic` (an internal error the server recovered from), `crash` (the server process stopped unexpectedly and was restarted) and `client_error` (a new error of the web app). One report per fingerprint, counted on repeats, pending first. Every text is redacted before it is stored: addresses, URLs, e-mails, tokens, file paths and camera, room, site and user names are removed, and no picture, video or request body is ever included. `wire` is exactly what is (or would be) sent. Nothing is sent unless an administrator agrees: `mode` `ask` (default: an admin sends each time), `always` or `never`. `can_send` is false on a server that is not connected to Vigiora cloud: its reports stay here. API 1.118.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The consent setting and the reports.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorReports"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/error-reports/settings": {
      "patch": {
        "operationId": "updateErrorReportSettings",
        "summary": "Change whether error reports are sent",
        "description": "`mode`: `ask` (default: reports wait until an admin sends them), `always` (sent by themselves, without asking) or `never` (every pending report is dismissed, and new ones are kept on this server only, as dismissed). Audited. API 1.118.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ErrorReportSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The setting.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorReportSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/error-reports/actions/send": {
      "post": {
        "operationId": "sendErrorReports",
        "summary": "Send error reports to Vigiora",
        "description": "Sends these pending `reports` to Vigiora cloud now: each with the `last_seen_at` it was shown with, so the text sent is the `wire` the admin read. 409 (`details.changed_ids`) when any of them changed since (fired again, or was sent or dismissed): nothing is sent; reload and ask again. Without `reports` every pending report is sent, which needs `mode` `always` (409 otherwise). Sent reports are marked `sent`; one that fires again later is pending again, its count still adding up. A report the cloud refuses is marked `rejected` (with `reject_reason`) and the others still go. 409 when this server is not connected to Vigiora cloud; 503 when the cloud could not be reached or did not accept them (they stay pending; `details.sent` counts those that went before). Audited. API 1.118.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ErrorReportSend"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many reports were sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorReportsSent"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/error-reports/actions/dismiss": {
      "post": {
        "operationId": "dismissErrorReports",
        "summary": "Dismiss error reports",
        "description": "Marks the pending reports with these `ids` (all pending reports when `ids` is omitted) `dismissed`: they are never sent, and stay on this server in the list. A dismissed problem that fires again stays dismissed. API 1.118.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ErrorReportIds"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many reports were dismissed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorReportsDismissed"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/program": {
      "get": {
        "operationId": "getProgram",
        "summary": "Get the Vigiora Feedback Program status",
        "description": "Whether this server is in the Vigiora Feedback Program and the settings the program uses: `update_channel` (`early` gets the program's early builds, which install by themselves only at night, 02:00-05:00 server time, and at most twice a week; `stable` is everyone's), automatic updates, the error reports consent and whether the daily health summary goes to the owner's Vigiora account. Read-only: the program is joined and left on vigiora.com (`leave_url`), and Vigiora cloud applies it to this server. A Docker install (`docker_install`) always stays on `stable`, since it has no automatic rollback. Every update, early or not, is rolled back by itself when the new version does not start, or when a camera that recorded before the update does not record again within 5 minutes. `feedback_ready` is false when this server is not connected to a Vigiora account (feedback cannot be sent). API 1.128.0.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The program status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgramStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/feedback": {
      "get": {
        "operationId": "listFeedback",
        "summary": "List sent feedback",
        "description": "The feedback sent to Vigiora from this server, newest first (at most 100): every user's for an admin, the caller's own otherwise. `feedback_ready` is false when this server is not connected to a Vigiora account; `member` is true in the Vigiora Feedback Program. API 1.128.0.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The sent feedback.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "sendFeedback",
        "summary": "Send feedback to Vigiora",
        "description": "Sends `text` (what the person wants to tell Vigiora, up to 4000 characters) with the web app `page` they are on (a path; any query string is dropped), this server's version and the web app build to Vigiora cloud, and keeps it in the list. No screenshot or other data is attached. Open to everyone; for members of the Vigiora Feedback Program it goes to the program's queue. 409 (`details.reason` `not_paired`) when this server is not connected to a Vigiora account; 429 after 20 in a day; 503 when Vigiora could not be reached (nothing is kept; try again). A person sends it from the web app: signed-in sessions only (no API keys, OAuth clients or agents). Audited. API 1.128.0.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The feedback was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Feedback"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/costs": {
      "get": {
        "operationId": "getCosts",
        "summary": "Get costs",
        "description": "This month's usage and bill estimate (Vigiora cloud, storage, relay). User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The costs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/billing/account": {
      "get": {
        "operationId": "getBillingAccount",
        "summary": "Get the billing account",
        "description": "Admins. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/billing/plans": {
      "get": {
        "operationId": "getBillingPlans",
        "summary": "List billing plans",
        "description": "Admins. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/billing/transactions": {
      "get": {
        "operationId": "getBillingTransactions",
        "summary": "List billing transactions",
        "description": "Admins. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/billing/usage": {
      "get": {
        "operationId": "getBillingUsage",
        "summary": "Get billing usage",
        "description": "Admins. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 366
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clients": {
      "get": {
        "operationId": "listClients",
        "summary": "List vigiora-clients",
        "description": "`camera_ids` lists the client's cameras the caller may view; `camera_count` all of them. One page.",
        "tags": [
          "Clients"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The clients.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clients/{client_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClientId"
        }
      ],
      "get": {
        "operationId": "getClient",
        "summary": "Get a vigiora-client",
        "tags": [
          "Clients"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Client"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateClient",
        "summary": "Update a vigiora-client",
        "description": "API 1.50.0. Sets the time zone this client's cameras' clocks are set to (`timezone_override`; `null` = the zone the client reports, client 1.16.0+). Its cameras are checked again in the background. Audited (`client.timezone`).",
        "tags": [
          "Clients"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Client"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteClient",
        "summary": "Remove a vigiora-client",
        "description": "Forgets the client (its cameras stop streaming until it enrols again). Audited.",
        "tags": [
          "Clients"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Removed."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clients/{client_id}/actions/restart": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClientId"
        }
      ],
      "post": {
        "operationId": "clientActionRestart",
        "summary": "Restart a vigiora-client",
        "description": "Queued for the client's next heartbeat (about a minute). Audited.",
        "tags": [
          "Clients"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientActionQueued"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clients/{client_id}/actions/update": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClientId"
        }
      ],
      "post": {
        "operationId": "clientActionUpdate",
        "summary": "Update a vigiora-client",
        "description": "Queued for the client's next heartbeat (about a minute). Audited.",
        "tags": [
          "Clients"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientActionQueued"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clients/{client_id}/actions/resync-cameras": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClientId"
        }
      ],
      "post": {
        "operationId": "clientActionResyncCameras",
        "summary": "Resync a client's cameras",
        "description": "Queued for the client's next heartbeat (about a minute). Audited.",
        "tags": [
          "Clients"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientActionQueued"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clients/{client_id}/actions/install-ffmpeg": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClientId"
        }
      ],
      "post": {
        "operationId": "clientActionInstallFfmpeg",
        "summary": "Install ffmpeg on a client",
        "description": "Queued for the client's next heartbeat (about a minute). Audited.",
        "tags": [
          "Clients"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientActionQueued"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clients/{client_id}/status-history": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClientId"
        }
      ],
      "get": {
        "operationId": "getClientStatusHistory",
        "summary": "Get a client's status history",
        "tags": [
          "Clients"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90,
              "default": 7
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The history.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/clients/{client_id}/cameras": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ClientId"
        }
      ],
      "post": {
        "operationId": "createClientCamera",
        "summary": "Add a camera on a client's network",
        "description": "The client connects to the camera (`stream_url`, and optionally `sub_stream_url`, on its own network; credentials allowed) and relays it; or a USB microphone (`source_type: usb_audio`, `audio_device`). The client receives the credentials, so admins only. Audited.",
        "tags": [
          "Clients"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:write"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientCameraCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The camera.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Camera"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/connected-apps": {
      "get": {
        "operationId": "listConnectedApps",
        "summary": "List connected apps",
        "description": "The AI apps the caller connected with OAuth (admins: `all=true` for every user's). User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "all",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The apps.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/connected-apps/{connected_app_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ConnectedAppId"
        }
      ],
      "patch": {
        "operationId": "updateConnectedApp",
        "summary": "Change a connected app's human in the loop",
        "description": "`human_in_the_loop`: `inherit`, `on` or `off` (see AI agents). User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectedAppUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "revokeConnectedApp",
        "summary": "Disconnect an app",
        "description": "User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "204": {
            "description": "Revoked."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/ai-service-instances": {
      "get": {
        "operationId": "listAIServiceInstances",
        "summary": "List AI service instances",
        "description": "The enrolled AI services (Vision Engine) and their cameras. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The instances.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/ai-service-instances/{ai_service_instance_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AiServiceInstanceId"
        }
      ],
      "get": {
        "operationId": "getAIServiceInstance",
        "summary": "Get an AI service instance",
        "description": "User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The instance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "revokeAIServiceInstance",
        "summary": "Revoke an AI service instance",
        "description": "Its enrolment token stops working. Audited. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Revoked."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/ai-service-instances/{ai_service_instance_id}/actions/start": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AiServiceInstanceId"
        }
      ],
      "post": {
        "operationId": "startAIServiceInstance",
        "summary": "Start an AI service instance",
        "description": "Audited. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/ai-service-instances/{ai_service_instance_id}/actions/stop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AiServiceInstanceId"
        }
      ],
      "post": {
        "operationId": "stopAIServiceInstance",
        "summary": "Stop an AI service instance",
        "description": "Audited. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/ai-service-instances/{ai_service_instance_id}/actions/restart": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AiServiceInstanceId"
        }
      ],
      "post": {
        "operationId": "restartAIServiceInstance",
        "summary": "Restart an AI service instance",
        "description": "Audited. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/tools": {
      "get": {
        "operationId": "listTools",
        "summary": "List external tools",
        "description": "HTTP tools Guardian chat may call (Home Assistant, …); stored credentials are never returned. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The tools.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createTool",
        "summary": "Add an external tool",
        "description": "Same body and URL checks as the web app. Audited. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The tool.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/tools/actions/test": {
      "post": {
        "operationId": "testTool",
        "summary": "Test an external tool",
        "description": "Calls the tool once. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/tools/log": {
      "get": {
        "operationId": "getToolLog",
        "summary": "Get the tool log",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "severity",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "info",
                "warning",
                "error"
              ]
            }
          },
          {
            "name": "tool",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The log.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/tools/search": {
      "get": {
        "operationId": "searchTools",
        "summary": "Search external tools",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The matches.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/tools/{tool_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ToolId"
        }
      ],
      "patch": {
        "operationId": "updateTool",
        "summary": "Update an external tool",
        "description": "Audited. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeForm"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteTool",
        "summary": "Delete an external tool",
        "description": "Audited. User sessions only (never an API key or an AI agent), as in the web app.",
        "tags": [
          "Admin"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant": {
      "get": {
        "operationId": "getHomeAssistant",
        "summary": "Home Assistant status",
        "description": "What Vigiora knows of Home Assistant on this server: `mode` (`none`, `managed` — the container Vigiora installed —, `external` — an existing Home Assistant connected with an API key), `state`, the installed and latest pinned versions, whether the container runs, the pre-checks of an install (OS, memory, disk, port 8123, Docker, the root helper) with the command a person runs once when one needs it, and the running or last job (`job`: install, update, restart or uninstall, with its steps and log). `access` is `lan_only`: Home Assistant is not exposed through the site address. API 1.21.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/discovered": {
      "get": {
        "operationId": "discoverHomeAssistant",
        "summary": "Find Home Assistant on the LAN",
        "description": "Looks for Home Assistant: one zeroconf (mDNS) query for `_home-assistant._tcp`, then port 8123 on this server and on the hosts the last LAN scan saw, each confirmed by Home Assistant's `/manifest.json`. Takes up to about 6 seconds. `managed` marks the instance Vigiora installed. Use an instance found here with `POST /integrations/home-assistant/actions/connect-existing` instead of installing a second one. API 1.21.0. Admins with `network:read`.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "network:read"
            ]
          },
          {
            "apiKeyHeader": [
              "network:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "network:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The instances found (may be empty).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantDiscovery"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/actions/install": {
      "post": {
        "operationId": "installHomeAssistant",
        "summary": "Install Home Assistant",
        "description": "Starts installing Home Assistant (Linux servers only for now) and answers `202` with the status, whose `job` to poll shows each step: pre-checks, the Vigiora integration files, downloading and starting the pinned `ghcr.io/home-assistant/home-assistant` image (several minutes), onboarding (an owner user with a generated password — shown once in the web app, never through an API key —, language, time zone, location and unit system), a restart, a scoped Vigiora API key \"Home Assistant (local)\" and the Vigiora config entry. `latitude`/`longitude` default to the cameras' map position; without either, `400 validation_error` (`details.reason: location_required`). A pre-check that stops the install is `409 conflict` with `details.reason: precheck_failed` and `details.check` (with the command to run, when a person must run one on the server); also `409` with `reason` `busy`, `already_installed`, `external_connected` or `unsupported_os`. Retrying after a failure continues where it can. API 1.21.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantInstallRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The install started; poll the status.",
            "headers": {
              "Location": {
                "description": "The status URL.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/actions/connect-existing": {
      "post": {
        "operationId": "connectExistingHomeAssistant",
        "summary": "Connect an existing Home Assistant",
        "description": "For a Home Assistant that already runs (found with `GET /integrations/home-assistant/discovered`, or elsewhere): creates the scoped Vigiora API key \"Home Assistant (local)\" (revoking the previous one) and answers it once with the Vigiora address and the steps to install the integration through HACS and add it. `url` (optional) records where that Home Assistant runs. `409 conflict` (`already_installed`) while Vigiora manages its own Home Assistant. The response holds a secret, so `Idempotency-Key` is refused. API 1.21.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantConnectRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The key (shown once) and the steps.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantConnection"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/actions/update": {
      "post": {
        "operationId": "updateHomeAssistant",
        "summary": "Update Home Assistant",
        "description": "Moves the Home Assistant Vigiora installed to `version` (default: the latest pinned one, `latest_version`; any of `available_versions`) and refreshes the Vigiora integration files when this server carries newer ones. The new image is downloaded before the container is replaced; the configuration stays. Answers `202` with the status and its job. `409 conflict` with `reason` `not_installed`, `not_newer` or `busy`. API 1.21.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The update started; poll the status.",
            "headers": {
              "Location": {
                "description": "The status URL.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/actions/update-integration": {
      "post": {
        "operationId": "updateHomeAssistantIntegration",
        "summary": "Update the Vigiora integration in Home Assistant",
        "description": "Writes this server's Vigiora integration (`integration.version`, pinned by commit and tree hash) into the Home Assistant Vigiora installed (`custom_components/vigiora`; the previous files move to a backup folder), checks the files on disk against the pin, restarts Home Assistant and waits until the Vigiora entry is loaded with the new version. The Home Assistant version does not change. Answers `202` with the status and its job (`action` `update_integration`). `409 conflict` with `reason` `not_installed`, `integration_current` (already this version) or `busy`; `503` with `reason` `no_integration` when this build carries no integration. API 1.22.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "202": {
            "description": "The update started; poll the status.",
            "headers": {
              "Location": {
                "description": "The status URL.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/actions/restart": {
      "post": {
        "operationId": "restartHomeAssistant",
        "summary": "Restart Home Assistant",
        "description": "Restarts the Home Assistant container Vigiora installed (about a minute without Home Assistant). Answers `202` with the status and its job. `409 conflict` (`not_installed`, `busy`). API 1.21.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "202": {
            "description": "The restart started; poll the status.",
            "headers": {
              "Location": {
                "description": "The status URL.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/actions/uninstall": {
      "post": {
        "operationId": "uninstallHomeAssistant",
        "summary": "Uninstall Home Assistant",
        "description": "Revokes the \"Home Assistant (local)\" API key and, for the Home Assistant Vigiora installed, removes its container and image and moves its configuration folder into a backup folder on the server (never deleted; `last_backup` names it). For a connected existing Home Assistant it only revokes the key and forgets it. Answers `202` with the status and its job. `409 conflict` (`not_installed`, `busy`). API 1.21.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "202": {
            "description": "The uninstall started; poll the status.",
            "headers": {
              "Location": {
                "description": "The status URL.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/actions/setup-zigbee": {
      "post": {
        "operationId": "setupHomeAssistantZigbee",
        "summary": "Set up Zigbee in Home Assistant",
        "description": "Sets up Home Assistant's Zigbee integration (ZHA) for the USB Zigbee coordinator passed into the Home Assistant Vigiora installed, through Home Assistant's own config-flow API: the serial port is chosen (`/dev/serial/by-id/…`), the radio type detected or taken from the stick's name (EZSP for SONOFF Dongle Plus V2 / Dongle-E and SkyConnect, ZNP for Dongle-P and CC2652 sticks, deCONZ for ConBee), a network already on the stick is kept, else a new Zigbee network is formed. Vigiora runs this itself after an install, update or restart and when a known Zigbee stick is plugged in (one attempt per stick set; the outcome is `zigbee` in the status). This operation runs it on request, for instance after a failed attempt. Answers `202` with the status and its job (`setup_zigbee`: `checks`, `configure`, `verify`); \"configured\" at once when ZHA is already set up. `409 conflict` (`not_installed`, `no_zigbee_dongle`, `busy`). Pairing a device: `…/actions/zigbee-permit-join`. API 1.37.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "202": {
            "description": "The Zigbee setup started; poll the status.",
            "headers": {
              "Location": {
                "description": "The status URL.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/actions/zigbee-permit-join": {
      "post": {
        "operationId": "permitHomeAssistantZigbeeJoin",
        "summary": "Let a new Zigbee device join",
        "description": "Opens the Zigbee network of the Home Assistant Vigiora installed for new devices for `duration_seconds` (Home Assistant's `zha.permit`): put the device in pairing mode within that time; it then appears in Home Assistant (Settings → Devices & services → Zigbee Home Automation). `409 conflict` (`not_installed`, `zigbee_not_configured`). API 1.37.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Pairing is open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantZigbeePermit"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/zigbee/devices": {
      "get": {
        "operationId": "listHomeAssistantZigbeeDevices",
        "summary": "List the Zigbee devices",
        "description": "The devices on the Zigbee network of the Home Assistant Vigiora installed (ZHA), fresh from Home Assistant: name, manufacturer, model, address (`ieee`), power source, signal (`lqi`, `rssi`), `last_seen`, `available`, the coordinator flag and each device's entities with the access Vigiora has to them. A device listed for the first time has its useful entities (door, motion, occupancy and vibration sensors, temperature, humidity, illuminance and battery readings, switches, lights, buttons) shared with Vigiora through the Home Assistant bridge, once (`auto_exposed`); a device an admin hid stays hidden (`hidden`). `permit` is the pairing window with its countdown. `409 conflict` (`not_installed`, `zigbee_not_configured`). API 1.39.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The devices and the pairing window.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantZigbeeDevices"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/zigbee/devices/{zigbee_device_id}/actions/rename": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ZigbeeIEEE"
        }
      ],
      "post": {
        "operationId": "renameHomeAssistantZigbeeDevice",
        "summary": "Rename a Zigbee device",
        "description": "Names the device in Home Assistant's device registry (its entities' names follow) and in Vigiora's bridge names (\"<name> – <kind>\"). API 1.39.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantZigbeeRename"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The device.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantZigbeeDevice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/zigbee/devices/{zigbee_device_id}/actions/remove": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ZigbeeIEEE"
        }
      ],
      "post": {
        "operationId": "removeHomeAssistantZigbeeDevice",
        "summary": "Remove a Zigbee device",
        "description": "Removes the device from the Zigbee network (Home Assistant tells it to leave), hides its entities from Vigiora and forgets it: pairing it again starts over. The coordinator cannot be removed (`409 coordinator`). API 1.39.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/zigbee/devices/{zigbee_device_id}/actions/reconfigure": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ZigbeeIEEE"
        }
      ],
      "post": {
        "operationId": "reconfigureHomeAssistantZigbeeDevice",
        "summary": "Reconfigure a Zigbee device",
        "description": "Re-interviews and re-binds the device (ZHA's reconfigure); a battery device must be awake (press its button). Answers the device at once; the work runs in Home Assistant. API 1.39.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The device.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantZigbeeDevice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/zigbee/devices/{zigbee_device_id}/actions/identify": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ZigbeeIEEE"
        }
      ],
      "post": {
        "operationId": "identifyHomeAssistantZigbeeDevice",
        "summary": "Make a Zigbee device blink",
        "description": "Presses the device's identify button so it blinks (find it in the house). `409 no_identify` when the device has none (`can_identify`). API 1.39.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The device.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantZigbeeDevice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/zigbee/devices/{zigbee_device_id}/actions/expose": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ZigbeeIEEE"
        }
      ],
      "post": {
        "operationId": "exposeHomeAssistantZigbeeDevice",
        "summary": "Share a Zigbee device with Vigiora",
        "description": "Exposes the device's useful entities through the Home Assistant bridge (control where possible, read-only for a lock or an alarm panel) and lifts a `hidden` mark. `409 bridge_not_connected` while the bridge does not report the device's entities. API 1.39.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The device.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantZigbeeDevice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/zigbee/devices/{zigbee_device_id}/actions/unexpose": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ZigbeeIEEE"
        }
      ],
      "post": {
        "operationId": "unexposeHomeAssistantZigbeeDevice",
        "summary": "Hide a Zigbee device from Vigiora",
        "description": "Hides every entity of the device from Vigiora (its links, triggers and rule actions go with them) and marks it `hidden`: the automatic sharing never touches it again. API 1.39.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The device.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantZigbeeDevice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/actions/reveal-owner-password": {
      "post": {
        "operationId": "revealHomeAssistantOwnerPassword",
        "summary": "Show the Home Assistant owner password once",
        "description": "Answers the generated Home Assistant owner sign-in once and forgets the password (`404 not_found` afterwards; change it in Home Assistant if it is lost). User sessions only (never an API key or an AI agent), as in the web app. API 1.21.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The sign-in.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantOwnerCredentials"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/runners": {
      "get": {
        "operationId": "listRunners",
        "summary": "GPU runners",
        "description": "The installable runners (`runner-objects`, `runner-plates`, `runner-face`, `runner-vision`, `runner-robotnav`; on the wire `hal-objects`, `hal-license-plate`, `hal-face`, `hal-vision`, `hal-robotnav`) with `gated` (plates and faces are privacy gated), their `on_device` install state (null when this server's Docker is not reachable; `state` absent, starting, running, crashed or enrolled) and the runners that `enrolled` (hostname, when it enrolled and was last seen). `on_device` at the top says whether this host can install a runner itself (Docker, Compose and the NVIDIA runtime). API 1.60.0. Admins only.",
        "tags": [
          "Runners"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The runners.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunnerList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/runners/install-token": {
      "post": {
        "operationId": "createRunnerInstallToken",
        "summary": "Mint a runner install token",
        "description": "Mints a one-time install token (valid 30 minutes, single use) for `service` and returns it once with the copyable `command` (`curl -fsSL <server>/hal/install.sh | sh -s -- --url … --token … --service …`) to run on the GPU machine. The token only lets a runner of that service enrol; the runner then keeps its own long-lived token. It is a credential: the request is not idempotent-replayable (`Idempotency-Key` refused) and needs approval when human-in-the-loop is on. API 1.60.0. Admins only.",
        "tags": [
          "Runners"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunnerInstallTokenCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The token and the install command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunnerInstallToken"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/addons": {
      "get": {
        "operationId": "listAddons",
        "summary": "Installed community add-ons",
        "description": "The community add-ons installed on this server (from the catalogue, or from a git address in developer mode), each with its `version`, `commit`, `source` (`community`, `vigiora` or `developer`), the `machine` it runs on (`local` or `host:<id>`, a remembered SSH machine), its install `state` (queued, fetching, building, pulling, starting, running, failed, removing, or suspended: Vigiora suspended it, so it is stopped and its token revoked) with the `step` it is on and the `error` when it failed, the `scopes` it was given, whether it `enrolled`, `suspended_reason` when Vigiora suspended it, and `update_version` when a newer approved version is listed (updates are never automatic). `developer_mode` says whether developer mode is on. Vigiora's four built-in runners are listed by `GET /runners`. API 1.104.0. Admins only.",
        "tags": [
          "Add-ons"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The installed add-ons.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddonList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/addons/catalog": {
      "get": {
        "operationId": "listAddonCatalog",
        "summary": "Add-on catalogue",
        "description": "The add-ons that can be installed: Vigiora's own first (the four built-in runners, `builtin: true`, installed with `POST /runners/install-token` or the web app; they appear even when the Vigiora cloud does not list them), then the community's. Each carries its price (`free`; paid community add-ons are listed but cannot be installed yet), its hardware block and `hardware_check` against this server (exact sentences such as \"needs a GPU with 6 GB; this server has none\"), and `installed_state`. The list comes from the server's cache and never waits long on the cloud: when the cloud cannot be reached the last list answers with `stale: true` and `updated_at`, the time it was fetched. `suspended` lists add-ons Vigiora suspended, with the reason when the cloud gives one. Icons are served by the web app's session routes. API 1.104.0. Admins only.",
        "tags": [
          "Add-ons"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The catalogue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddonCatalog"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/addons/catalog/{addon_id}": {
      "get": {
        "operationId": "getAddonCatalogEntry",
        "summary": "One add-on of the catalogue",
        "description": "One add-on with its manifest as the server's validator read it (`manifest` null and `problems` when the server refuses it: such an add-on is shown but cannot be installed), README and how-to (Markdown, to be shown without HTML), screenshots, repository and the reviewed commit, author, licence, permissions, `scopes_enforced` (which of the manifest's scopes this server enforces today), `warnings` (how it will run: privileged, host network, no network), `hardware_check` against this server, `installed` and `suspended_reason`. `reviewed` is true for every catalogue add-on (reviewed by Vigiora); an add-on installed in developer mode is not. `404 not_found` when the cloud does not list it (not approved, or suspended). API 1.104.0. Admins only.",
        "tags": [
          "Add-ons"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/AddonId"
          }
        ],
        "responses": {
          "200": {
            "description": "The add-on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddonDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/addons/{addon_id}/install": {
      "post": {
        "operationId": "installAddon",
        "summary": "Install a catalogue add-on",
        "description": "Installs a community add-on from the catalogue at the commit Vigiora reviewed, on `machine` (`local`, or `host:<id>` of a remembered SSH machine; empty = this server when Docker is usable and the hardware fits, else the first SSH machine that fits). The server fetches the commit, checks the manifest equals the reviewed one and checks the compose file again, then pulls (`run.source: image`) or builds (`build`) and starts it with an override it writes (the author's file is never edited). The add-on enrols with a single-use token limited to its `permissions.scopes`. Answers `202` at once; follow `GET /addons` for the progress and the failure reason. `409 conflict` when it is paid (`reason: paid`; paid community add-ons are not available yet), suspended, does not fit the hardware (the sentence says what is missing), is already installed, or is one of Vigiora's built-in runners. Add-ons asking for elevated access (privileged, host network or the graphics card) are installed from the web app, which asks for the password again (`403 forbidden`, `reason: elevated_access`). Needs approval when human-in-the-loop is on. API 1.104.0. Admins only.",
        "tags": [
          "Add-ons"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/AddonId"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddonInstallCreate"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Installing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddonInstall"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/addons/{addon_id}/update": {
      "post": {
        "operationId": "updateAddon",
        "summary": "Update an add-on",
        "description": "Installs the newer approved version of an installed catalogue add-on (offered as `update_version` by `GET /addons`; never automatic), on the machine it runs on, with the same checks as an install. `409 conflict` when no newer approved version is listed, when it is suspended, or for a developer-mode add-on (install it again from its git address). Answers `202`; follow `GET /addons`. Needs approval when human-in-the-loop is on. API 1.104.0. Admins only.",
        "tags": [
          "Add-ons"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/AddonId"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "202": {
            "description": "Updating.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddonInstall"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/addons/{addon_id}": {
      "delete": {
        "operationId": "removeAddon",
        "summary": "Remove an add-on",
        "description": "Stops and deletes an installed community add-on: its containers and volumes (its data), its folder, and its tokens (it can no longer reach the server). Needs approval when human-in-the-loop is on. API 1.104.0. Admins only.",
        "tags": [
          "Add-ons"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/AddonId"
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/bridge": {
      "get": {
        "operationId": "getHomeAssistantBridge",
        "summary": "Home Assistant device connection status",
        "description": "Of instance 1 (several instances: `GET …/instances`, API 1.29.0; `instance_count` says how many exist): whether Vigiora is connected to Home Assistant to use its devices (`state`: `not_configured`, `connecting`, `connected`, `auth_failed`, `error`, `no_secret_key`), with the connection's `source` (`managed`: the token of the Home Assistant Vigiora installed; `manual`: a URL and long-lived token an admin pasted; `none`), Home Assistant's version, the last error and the next retry, how many entities Home Assistant reports and how many are exposed to Vigiora. The token is never returned. `managed_available`: a Home Assistant installed by Vigiora can be used; `human_in_the_loop`: the server's setting that makes agents' device actions wait for approval. API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantBridgeStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/bridge/actions/connect": {
      "post": {
        "operationId": "connectHomeAssistantBridge",
        "summary": "Connect Home Assistant's devices",
        "description": "Connects Vigiora to Home Assistant's WebSocket API to use its devices: `source: managed` uses the token of the Home Assistant Vigiora installed; `source: manual` takes the Home Assistant `url` (http or https) and a long-lived access `token` (Home Assistant: your profile → Security → Long-lived access tokens). The token is checked by connecting first (`400 validation_error` on `token` when Home Assistant refuses it; `502 device_failed` when it cannot be reached), then stored sealed with the server's secret key; it is never logged or returned, and the request is not idempotent-replayable (`Idempotency-Key` refused). Nothing is exposed until an admin selects devices. Acts on instance 1 and creates it (\"Home Assistant\") if needed (API 1.29.0). `409 conflict` (`no_managed`, `no_secret_key`, `managed_in_use`: another instance uses the Home Assistant Vigiora installed). API 1.25.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantBridgeConnect"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantBridgeStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/bridge/actions/disconnect": {
      "post": {
        "operationId": "disconnectHomeAssistantBridge",
        "summary": "Disconnect Home Assistant's devices",
        "description": "Forgets the connection (and a pasted token). The selection, links, triggers and rule actions stay for a later connection; devices stop updating and cannot be controlled meanwhile. API 1.25.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantBridgeStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/instances": {
      "get": {
        "operationId": "listHomeAssistantInstances",
        "summary": "List the Home Assistant instances",
        "description": "Every Home Assistant this server uses (one per site, e.g. home and shop), by id, with its name, whether it is enabled and its connection status (as `GET …/bridge`). Tokens are never returned. API 1.29.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "Every instance (one page).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantBridgeInstancePage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createHomeAssistantInstance",
        "summary": "Add a Home Assistant instance",
        "description": "Adds a Home Assistant with a unique `name` and its connection (`source` and, for `manual`, `url` and a long-lived `token`, checked by connecting first, then stored sealed; never logged or returned; `Idempotency-Key` refused). At most one instance uses `source: managed` (`409 conflict`, `reason: managed_in_use`). Its selection starts empty. API 1.29.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantBridgeInstanceCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The instance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantBridgeInstance"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/instances/{instance_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/InstanceId"
        }
      ],
      "get": {
        "operationId": "getHomeAssistantInstance",
        "summary": "A Home Assistant instance",
        "description": "API 1.29.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The instance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantBridgeInstance"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateHomeAssistantInstance",
        "summary": "Rename, enable or disable a Home Assistant instance",
        "description": "`name` (unique) and `enabled` (a disabled instance does not connect; its devices stay selected but are offline). API 1.29.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantBridgeInstanceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The instance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantBridgeInstance"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteHomeAssistantInstance",
        "summary": "Remove a Home Assistant instance",
        "description": "Removes the instance with its token, selection, links, triggers and rule actions. The action log keeps its entries. API 1.29.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/instances/{instance_id}/actions/connect": {
      "parameters": [
        {
          "$ref": "#/components/parameters/InstanceId"
        }
      ],
      "post": {
        "operationId": "connectHomeAssistantInstance",
        "summary": "Connect a Home Assistant instance",
        "description": "Sets the instance's connection, as `…/bridge/actions/connect` does for instance 1 (the token is checked first, stored sealed and never returned; `Idempotency-Key` refused). API 1.29.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantBridgeConnect"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The instance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantBridgeInstance"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/instances/{instance_id}/actions/disconnect": {
      "parameters": [
        {
          "$ref": "#/components/parameters/InstanceId"
        }
      ],
      "post": {
        "operationId": "disconnectHomeAssistantInstance",
        "summary": "Disconnect a Home Assistant instance",
        "description": "Forgets the instance's connection (and a pasted token); the instance, its selection, links, triggers and rule actions stay. API 1.29.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The instance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantBridgeInstance"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/instances/{instance_id}/actions/test": {
      "parameters": [
        {
          "$ref": "#/components/parameters/InstanceId"
        }
      ],
      "post": {
        "operationId": "testHomeAssistantInstance",
        "summary": "Test a Home Assistant connection",
        "description": "Connects to the instance's Home Assistant now, with the stored connection or with the given `url` and `token`, and changes nothing: `ok` with Home Assistant's version, or the `error` (never containing the token). `Idempotency-Key` refused. API 1.29.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantBridgeTest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantBridgeTestResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/instances/{instance_id}/entities": {
      "parameters": [
        {
          "$ref": "#/components/parameters/InstanceId"
        }
      ],
      "get": {
        "operationId": "listHomeAssistantInstanceEntities",
        "summary": "List an instance's entities to expose",
        "description": "As `GET …/entities`, for this instance. API 1.29.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "Every entity (one page).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantEntityPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/instances/{instance_id}/entities/{entity_id}/actions/set-access": {
      "parameters": [
        {
          "$ref": "#/components/parameters/InstanceId"
        },
        {
          "$ref": "#/components/parameters/BridgeEntityId"
        }
      ],
      "post": {
        "operationId": "setHomeAssistantInstanceEntityAccess",
        "summary": "Expose an instance's entity",
        "description": "As `POST …/entities/{entity_id}/actions/set-access`, for this instance's entity. API 1.29.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantSetAccess"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The entity.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantEntity"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/entities": {
      "get": {
        "operationId": "listHomeAssistantEntities",
        "summary": "List Home Assistant entities to expose",
        "description": "Of instance 1, or of `instance_id` (API 1.29.0; also `GET …/instances/{instance_id}/entities`): every entity Home Assistant reports that Vigiora supports (binary sensors, lights, switches, input booleans, locks, alarm panels, sirens, sensors) and its notify services (`notify.<service>`), by area and domain, with the current state, the mapped capability, whether it can be controlled, whether it is sensitive (locks, alarm panels, sirens) and its `access` (`none`, `read`, `control`). Exposed entities Home Assistant no longer reports have `present: false`. Nothing is exposed by default. API 1.25.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "instance_id",
            "in": "query",
            "description": "The Home Assistant instance (default 1). API 1.29.0.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every entity (one page).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantEntityPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/entities/{entity_id}/actions/set-access": {
      "parameters": [
        {
          "$ref": "#/components/parameters/EntityId"
        }
      ],
      "post": {
        "operationId": "setHomeAssistantEntityAccess",
        "summary": "Expose a Home Assistant entity",
        "description": "Sets what Vigiora may do with an entity: `none` (hidden: its links, triggers and rule actions are removed), `read` or `control` (read and run the commands of its capabilities). Control of a sensitive entity (lock, alarm panel, siren) needs `confirm_sensitive: true` (else `409 conflict`, `reason: sensitive_confirmation_required`); every action on it must then be confirmed again. `400` for an entity Vigiora does not support or with nothing to control; `503` while Home Assistant does not report it. API 1.25.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantSetAccess"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The entity.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantEntity"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/devices": {
      "get": {
        "operationId": "listHomeAssistantDevices",
        "summary": "List the exposed Home Assistant devices",
        "description": "The exposed entities with their live state per capability, the commands allowed (none for read-only devices, and none for a sensitive one before its control is confirmed), the cameras and rooms they are linked to and their recent changes. The same devices are things (`GET /things?kind=external`, `source: home-assistant`). Every instance's devices, or those of `instance_id` (API 1.29.0). API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "instance_id",
            "in": "query",
            "description": "Only this Home Assistant instance (API 1.29.0).",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every exposed device (one page).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantDevicePage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/devices/{entity_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/EntityId"
        }
      ],
      "patch": {
        "operationId": "updateHomeAssistantDevice",
        "summary": "Link a device to cameras and rooms",
        "description": "Replaces the cameras (`camera_ids`, operator permission on each) and rooms (`room_ids`) a device is linked to. A camera's Guardian descriptions and alert rules get its linked devices (and those of its rooms) as quoted sensor data; a room's AI Live and Guardian get its devices as signals. API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantDeviceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The device.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantDevice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/devices/{entity_id}/actions/command": {
      "parameters": [
        {
          "$ref": "#/components/parameters/EntityId"
        }
      ],
      "post": {
        "operationId": "commandHomeAssistantDevice",
        "summary": "Run a command on a device",
        "description": "Runs one command of the device's capabilities (`<capability>.<command>`: `onoff.turn_on`, `onoff.turn_off`, `brightness.set {level}`, (API 1.47.0) `light.set {on, brightness_pct, rgb, hs, color_name, color_temp_kelvin}`, `light.set_color {rgb|hs|color_name}`, `light.set_temperature {kelvin}`, `cover.open`, `cover.close`, `cover.stop`, `cover.set_position {position}`, `number.set {value}`, `select.select {option}`, `button.press`, `lock.lock`, `lock.unlock`, `alarm_mode.set {mode}`, `siren.turn_on {duration}`, `siren.turn_off`, `notify.send {message, title}`), which calls exactly one Home Assistant service; nothing else can be called. The device must be exposed for control (`403 forbidden`, `reason: read_only`). A sensitive device (lock, alarm panel, siren) needs its control confirmed by an admin (`403`, `reason: sensitive_not_enabled`) and `acknowledge_sensitive: true` (`409 conflict`, `reason: sensitive_confirmation_required`); through MCP it always asks the person, human in the loop on or off. Rate limited (10 a minute per device, 30 per credential, 60 in all: `429`); every action, refused or not, is in the action log. `502 device_failed` when Home Assistant refuses or fails; `503` when it is not connected. API 1.25.0. Admins and operators. Sirens (API 1.105.0): `siren.turn_on` makes a loud noise in a real building; Vigiora sends at most 15 s as its `duration` (also when none or more is asked), stores the run before it sounds and sends `siren.turn_off` at the end itself, and allows at most 60 s per siren in 10 minutes (`429 rate_limited`, `reason: siren_limit`). Alert rules cannot sound one for 10 minutes after Stop all sounds (`409 conflict`, `reason: sounds_paused`); a person or an agent still can. While the siren's last run was not confirmed off, a new `siren.turn_on` is `409 conflict` (`reason: siren_not_off`). `siren.turn_off` here, POST /sounds/actions/stop-all and GET /sounds/active cover these sirens too; stopping is always safe.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:control"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantCommandResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/room-signals/{room_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RoomId"
        }
      ],
      "get": {
        "operationId": "getHomeAssistantRoomSignals",
        "summary": "A room's devices",
        "description": "The exposed devices a room includes as signals (e.g. the pool gate contact): their state and recent changes go to the room's AI Live and Guardian as quoted sensor data, and a change wakes the room's event-driven AI Live. API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The room's devices.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantRoomSignals"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateHomeAssistantRoomSignals",
        "summary": "Set a room's devices",
        "description": "Replaces the room's devices (`entity_ids`, at most 30, exposed devices; notify services are not signals). The devices the floor plan put in the room (an IoT device pinned inside its outline, `managed_devices` of the room) stay whether listed or not (API 1.40.0). API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantRoomSignalsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The room's devices.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantRoomSignals"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/triggers": {
      "get": {
        "operationId": "listHomeAssistantTriggers",
        "summary": "List device triggers",
        "description": "Guardian triggers \"device changed → analyse a camera now\" of the cameras you may view (or of `camera_id`). API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every trigger (one page).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantTriggerPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createHomeAssistantTrigger",
        "summary": "Create a device trigger",
        "description": "When the device changes (to `to_state`, a Home Assistant state such as `on`, `open`, `unlocked`; null = any change), Guardian analyses `camera_id` now, at most once per `cooldown_seconds` (10–86400, default 120), past the motion debounce. The analysis gets the change as quoted sensor data. Needs operator permission on the camera. API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantTriggerCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The trigger.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantTrigger"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/triggers/{trigger_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/TriggerId"
        }
      ],
      "patch": {
        "operationId": "updateHomeAssistantTrigger",
        "summary": "Update a device trigger",
        "description": "A trigger cannot move to another camera. API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantTriggerUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The trigger.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantTrigger"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteHomeAssistantTrigger",
        "summary": "Delete a device trigger",
        "description": "API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/rule-actions/{alert_rule_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AlertRuleId"
        }
      ],
      "get": {
        "operationId": "getHomeAssistantRuleActions",
        "summary": "An alert rule's device actions",
        "description": "What a Guardian alert rule (camera or room rule) does in Home Assistant when it fires. Codes in params are never returned. API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The actions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantRuleActions"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateHomeAssistantRuleActions",
        "summary": "Set an alert rule's device actions",
        "description": "Replaces the rule's actions (at most 10), run in order each time it fires, e.g. `onoff.turn_on` on `light.porch` with `duration_seconds: 300` (turned off again after 5 minutes), `siren.turn_on {duration: 30}`, `notify.send` on `notify.mobile_app_<phone>` (`message` and `title` may use `{rule}`, `{reason}`, `{camera}`, `{room}`, `{severity}`; default `{rule}: {reason}`). Each action is validated against the exposed devices (`400`, with the action's index); a sensitive device needs `sensitive_confirmed: true` (`409 conflict`, `reason: sensitive_confirmation_required`). Actions are logged on the alert (`GET …/action-log?alert_id=`). Needs operator permission on the rule's camera. API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAssistantRuleActionsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The actions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantRuleActions"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/action-log": {
      "get": {
        "operationId": "listHomeAssistantActionLog",
        "summary": "Device action log",
        "description": "Every control action, newest first: its source (`api`, `mcp`, `chat`, `ai_live`, `rule`, `revert`), who (user, API key or OAuth grant), the alert and rule it ran for, the service called, the outcome (`ok`, `failed`, `refused`, `rate_limited`, `pending`, `denied`) and the error. Codes are never stored. Filters: `alert_id`, `alert_rule_id`, `instance_id`, `entity_id`; `limit` 1–500 (default 100). API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "alert_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "alert_rule_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "instance_id",
            "in": "query",
            "description": "Only this Home Assistant instance (API 1.29.0).",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "entity_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entries (one page).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantActionLogPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/pending-actions": {
      "get": {
        "operationId": "listHomeAssistantPendingActions",
        "summary": "Device actions waiting for approval",
        "description": "Actions Guardian chat or AI Live asked for that wait for a person (human in the loop is on, or the device is sensitive): your own, and AI Live's for admins and operators (admins see all). They expire after 10 minutes. User sessions only. API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "Pending actions (one page).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantPendingActionPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/pending-actions/{pending_id}/actions/approve": {
      "parameters": [
        {
          "$ref": "#/components/parameters/PendingId"
        }
      ],
      "post": {
        "operationId": "approveHomeAssistantPendingAction",
        "summary": "Approve a pending device action",
        "description": "Runs the action as asked (a sensitive one counts as confirmed by you) and answers its result. User sessions only: an agent can never approve its own action. API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The decision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantPendingDecision"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/home-assistant/pending-actions/{pending_id}/actions/deny": {
      "parameters": [
        {
          "$ref": "#/components/parameters/PendingId"
        }
      ],
      "post": {
        "operationId": "denyHomeAssistantPendingAction",
        "summary": "Deny a pending device action",
        "description": "Drops the action; nothing runs. User sessions only. API 1.25.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The decision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAssistantPendingDecision"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/mqtt": {
      "get": {
        "operationId": "getMqttIntegration",
        "summary": "MQTT integration",
        "description": "The MQTT broker Vigiora publishes its Things to (`broker_url`, `username`, whether a password is stored — `password_set`; the password is never returned —, `client_id`, `topic_prefix`, `node_id`, `tls_verify`, Home Assistant discovery and its prefix, `allow_control`, `qos`) and the connection's `status` (`state`: `disabled`, `connecting`, `connected`, `error`, `no_secret_key`; the topic root `<topic_prefix>/<node_id>`, messages published, things published and discovery entities, the last error and the next retry). Topics: `<root>/status` (online/offline), `<root>/things/<thing_id>/state` (retained JSON), `<root>/events` (the Things envelope, as `GET /events/stream?format=things`), `<root>/things/<thing_id>/cmd` (commands, JSON `{\"command\": \"<capability>.<command>\", \"params\": {}}`, with `allow_control`) and `<discovery_prefix>/<component>/vigiora_<node_id>/<thing>_<key>/config`. API 1.26.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The integration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MqttIntegration"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateMqttIntegration",
        "summary": "Set up the MQTT integration",
        "description": "Changes the MQTT settings (only the fields sent): `broker_url` (`mqtt://host[:1883]`, `mqtts://`, `ws://`, `wss://`), `username` and `password` (stored sealed with the server's secret key, never returned; an empty string clears it), `client_id`, `topic_prefix` (default `vigiora`), `node_id` (default: this server's slug), `tls_verify`, `discovery` and `discovery_prefix` (default `homeassistant`), `allow_control` (lets anyone who can publish to the command topic run Things commands as the admin who saved these settings: switch recording and AI, set a room's AI mode) and `qos`. `enabled` needs a broker address. The bridge reconnects at once. The request is not idempotent-replayable (`Idempotency-Key` refused). `409 conflict` (`no_secret_key`). API 1.26.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MqttIntegrationUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The integration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MqttIntegration"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/mqtt/actions/test": {
      "post": {
        "operationId": "testMqttIntegration",
        "summary": "Publish an MQTT test message",
        "description": "Publishes a test message on `<root>/test` over the current connection. `409 conflict` (`disabled`, `not_connected`); `502 device_failed` when the broker refuses it. API 1.26.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Published.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MqttTestResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/ai-model": {
      "get": {
        "operationId": "getAIModel",
        "summary": "Get the AI model setting",
        "description": "Which AI model answers the assistant (Guardian chat) and makes the picture descriptions: `vigiora` (Vigiora cloud AI, the default), `ollama` (a local Ollama server at `base_url`) or `own_key` (an OpenAI-compatible provider with the owner's own API key: `preset` `openai`, `gemini`, `anthropic` or `custom`). The API key is never returned: only `api_key_set` and its last 4 characters. `capabilities` is what the last test found (`null` = not tested). `uses_vigiora_credits` is false with an own model. `privacy` says where questions and pictures go. Every other AI feature keeps using Vigiora cloud AI. API 1.112.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The setting.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIModel"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateAIModel",
        "summary": "Choose the AI model",
        "description": "Changes the AI model of the assistant and the picture descriptions. Only the fields sent change. `mode` `ollama` needs `model` (from `actions/list-models`); `base_url` defaults to `http://127.0.0.1:11434`. `mode` `own_key` needs `model` and `api_key` (optional for `preset` `custom`); a preset fixes `base_url`. `api_key` is stored sealed with the server's secret key and never returned; an empty string clears it; changing the address needs the key again (a stored key is never sent to a new address). `base_url` must be http or https; loopback and private network addresses are allowed, link-local (169.254.0.0/16, fe80::/10) and cloud metadata addresses are refused; a key travels only over https or to this computer / a private network. `fallback_to_vigiora` (default false): when the chosen model cannot read pictures or use tools, those requests go to Vigiora cloud AI instead of being refused. Changing the model forgets the last test. `Idempotency-Key` refused (the body may hold a key). `409 conflict` (`no_secret_key`). It changes where camera pictures are sent, so an AI agent needs the user's approval while human in the loop is on (`x-vigiora-confirm`). API 1.112.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AIModelUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The setting.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIModel"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/ai-model/actions/test": {
      "post": {
        "operationId": "testAIModel",
        "summary": "Test the AI model",
        "description": "Runs three small checks on the chosen own model and says plainly what works: `text` (a one-word reply), `pictures` (a built-in red test picture) and `tools` (one tool call and its result), sent the way the real calls go (for Ollama: its own `/api/chat` with a context size chosen from the request). `supported: false` means the model cannot do it at all. The optional body is applied for the test only (not saved), so a model can be tried before it is chosen. Testing the saved model remembers the result, which decides what the assistant asks of it. Nothing about the server is sent: only the fixed test prompt and picture. `409 conflict` (`vigiora_chosen`). The server connects to the model's address, so an AI agent needs the user's approval while human in the loop is on (`x-vigiora-confirm`); an admin in the web app is not asked. API 1.112.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AIModelUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The checks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIModelTestResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/system/ai-model/actions/list-models": {
      "post": {
        "operationId": "listAIModels",
        "summary": "List the models of a model server",
        "description": "The models an Ollama server has pulled (its `/api/tags`), or the models an OpenAI-compatible provider lists (`/models`). The optional body is applied for the listing only (not saved; `model` is not needed). `502 device_failed` when the server cannot be reached or refuses (the reason, without the key). The server connects to the address in the body, so an AI agent needs the user's approval while human in the loop is on (`x-vigiora-confirm`); an admin in the web app is not asked. API 1.112.0. Admins only.",
        "tags": [
          "System"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AIModelUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The model names, sorted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIModelList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/telegram": {
      "get": {
        "operationId": "getTelegramIntegration",
        "summary": "Telegram notifications",
        "description": "The Telegram channel alerts can go to: whether it is on, whether a bot token is stored (`token_set`; the token itself is never returned), the recipients, and its delivery status (`state`: `not_set_up`, `disabled`, `ready`, `error`; `sent`, `suppressed` by the 20-a-minute limit, the last error). API 1.26.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The channel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatIntegration"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateTelegramIntegration",
        "summary": "Set up Telegram notifications",
        "description": "Changes the Telegram channel: `token` (the bot token from @BotFather, `123456789:AA…`; stored sealed with the server's secret key and never returned; an empty string clears it), `recipients` (Telegram chat ids: a number, negative for groups, or `@channel`; at most 10) and `enabled` (needs a token and a recipient). Only the fields sent change. Then an alert rule's `telegram_enabled` / `line_enabled` chooses it. The request is not idempotent-replayable (`Idempotency-Key` refused). `409 conflict` (`no_secret_key`). API 1.26.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatIntegrationUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The channel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatIntegration"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/telegram/actions/test": {
      "post": {
        "operationId": "testTelegramIntegration",
        "summary": "Send a Telegram test message",
        "description": "Sends a test message to every recipient of the Telegram channel (the token and recipients must be set; the channel need not be on). `409 conflict` (`not_configured`); `502 device_failed` when Telegram refuses it (the reason, without the token). API 1.26.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatTestResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/devices": {
      "get": {
        "operationId": "listIoTDevices",
        "summary": "List the IoT devices",
        "description": "One list of every device Vigiora knows through Home Assistant — the devices of every bridge instance and the Zigbee devices of the Home Assistant Vigiora installed, merged by Home Assistant device id (a Zigbee device carries its `zigbee` facts) — for the IoT devices page: name, manufacturer, model, source, online, battery, signal, whether shared with Vigiora, the device types, up to three headline readings, rooms and cameras. Filters: `q` (name, model, entity id, address), `type`, `source` (`zigbee`, `loona` or an instance id), `state` (`online`, `offline`, `low_battery`), `room_id`, `shared`. `refresh=true` reads the Zigbee network again instead of the recent copy. Sorted by name; paged. The Zigbee pairing window: `GET /iot/zigbee`. API 1.39.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Search words (name, manufacturer, model, area, entity id, Zigbee address).",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "sensor",
                "binary_sensor",
                "switch_light",
                "lock_cover",
                "climate",
                "button",
                "camera_linked",
                "coordinator"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "`zigbee`, `home_assistant` (any instance), or a Home Assistant instance id.",
            "schema": {
              "type": "string",
              "maxLength": 20
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "online",
                "offline",
                "low_battery"
              ]
            }
          },
          {
            "name": "room_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "shared",
            "in": "query",
            "description": "Only devices shared with Vigiora (true) or not (false).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "refresh",
            "in": "query",
            "description": "Read the Zigbee network again.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of devices.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IoTDevicePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/devices/{iot_device_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/IoTDeviceKey"
        }
      ],
      "get": {
        "operationId": "getIoTDevice",
        "summary": "An IoT device with its data mapping",
        "description": "The device with its entities: live value and unit, and what Vigiora makes of each — the access level (`none`, `read`, `control`), the rooms it feeds and the cameras it is linked to, the camera triggers (`trigger_ids`) and alert rules (`rule_ids`) that use it, and the signal kind (`signal`: door, motion, occupancy, vibration, smoke, moisture, temperature, humidity, illuminance, battery, power, switch, light, button, lock, cover, climate, unknown) with the automatic kind and the admin's override, and (API 1.40.0) `floor_plans`: where the device is pinned on floor plans and in which room, with `managed_room_ids` the rooms those pins put it in. `refresh=true` reads the Zigbee network again. API 1.39.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The device with its entities.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IoTDevice"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateIoTDevice",
        "summary": "Change an IoT devices settings",
        "description": "Renames the device (`name`: Home Assistant's device registry for a Home Assistant or Zigbee device, Vigiora's bridge names follow; an entity without a device is renamed in Vigiora only, once shared), replaces the rooms (`room_ids`) and cameras (`camera_ids`, operator permission on each) every shared entity of the device is linked to (`409 not_shared` before anything is shared; the rooms the floor plan manages stay, API 1.40.0), and sets signal kind overrides (`mappings`: `signal` null = back to the automatic kind). API 1.39.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IoTDeviceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The device.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IoTDevice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/devices/{iot_device_id}/entities": {
      "parameters": [
        {
          "$ref": "#/components/parameters/IoTDeviceKey"
        }
      ],
      "get": {
        "operationId": "listIoTDeviceEntities",
        "summary": "An IoT devices entities",
        "description": "The device's entities with their live values and data mapping (the same as the device's `entities`; one page). API 1.39.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The entities (one page).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IoTEntityPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/devices/{iot_device_id}/actions/forget": {
      "parameters": [
        {
          "$ref": "#/components/parameters/IoTDeviceKey"
        }
      ],
      "post": {
        "operationId": "forgetIoTDevice",
        "summary": "Forget an IoT device",
        "description": "Removes what Vigiora keeps about a stale device: its entities are hidden (their links, triggers and rule actions go with them) and its signal kind overrides dropped. Home Assistant is not touched; the device lists again while Home Assistant reports it. API 1.39.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/devices/{iot_device_id}/actions/expose": {
      "parameters": [
        {
          "$ref": "#/components/parameters/IoTDeviceKey"
        }
      ],
      "post": {
        "operationId": "exposeIoTDevice",
        "summary": "Share an IoT device with Vigiora",
        "description": "Exposes the device's useful entities through the Home Assistant bridge (control where possible, read-only for a lock or an alarm panel), named \"<device> – <kind>\"; a Zigbee device also loses its `hidden` mark. `409 nothing_to_expose` when no entity is of use. API 1.39.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The device.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IoTDevice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/devices/{iot_device_id}/actions/unexpose": {
      "parameters": [
        {
          "$ref": "#/components/parameters/IoTDeviceKey"
        }
      ],
      "post": {
        "operationId": "unexposeIoTDevice",
        "summary": "Hide an IoT device from Vigiora",
        "description": "Hides every entity of the device from Vigiora (links, triggers and rule actions go with them); a Zigbee device is marked `hidden` so the automatic sharing never touches it again. API 1.39.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The device.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IoTDevice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/devices/{iot_device_id}/actions/reconfigure": {
      "parameters": [
        {
          "$ref": "#/components/parameters/IoTDeviceKey"
        }
      ],
      "post": {
        "operationId": "reconfigureIoTDevice",
        "summary": "Reconfigure a Zigbee device",
        "description": "ZHA's reconfigure (re-interview and re-bind; a battery device must be awake). `409 not_zigbee` for a device that is not one. API 1.39.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The device.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IoTDevice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/devices/{iot_device_id}/actions/identify": {
      "parameters": [
        {
          "$ref": "#/components/parameters/IoTDeviceKey"
        }
      ],
      "post": {
        "operationId": "identifyIoTDevice",
        "summary": "Make a Zigbee device blink",
        "description": "Presses the device's identify button. `409 not_zigbee` for a device that is not one, `409 no_identify` when it has none. API 1.39.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "The device.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IoTDevice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/devices/{iot_device_id}/actions/remove": {
      "parameters": [
        {
          "$ref": "#/components/parameters/IoTDeviceKey"
        }
      ],
      "post": {
        "operationId": "removeIoTDevice",
        "summary": "Remove a Zigbee device from the network",
        "description": "Home Assistant tells the device to leave the Zigbee network; its entities are hidden from Vigiora and its overrides dropped. `409 not_zigbee` for a device that is not one, `409 coordinator` for the coordinator. API 1.39.0. Admins only.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": true,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/devices/{iot_device_id}/entities/{entity_id}/actions/set": {
      "parameters": [
        {
          "$ref": "#/components/parameters/IoTDeviceKey"
        },
        {
          "$ref": "#/components/parameters/BridgeEntityId"
        }
      ],
      "post": {
        "operationId": "setIoTDeviceEntity",
        "summary": "Change a device's control or setting",
        "description": "Changes one entity of the device as its `control` description allows: `values` sets writable fields (a light's `on`, `brightness_pct` (0 turns it off), one colour `rgb` [r, g, b], `hs` [hue, saturation] or `color_name` (a colour word like \"red\", \"purple\", \"warm white\", translated to rgb), or `color_temp_kelvin` clamped to the light's range, in one call; a switch's or siren's `on`; a cover's `position`; a lock's `locked` (+ `code`); an alarm's `mode` (+ `code`); a number's `value` within its min, max and step; a select's `option`; a notify service's `message` and `title`), `command` runs one of its `commands` (`open`, `close`, `stop`, `press`, `lock`, `unlock`). Values are checked against the description (`400` with the field) and mapped to exactly one Home Assistant service through the bridge: the same rate limits, action log and sensitive-device rules as `commandHomeAssistantDevice` (a lock, alarm panel or siren needs its control confirmed by an admin and `acknowledge_sensitive: true`). The entity must be shared with Vigiora for control (`409 not_controllable`; `409 no_control` when it has nothing to change). Answers what ran and the device afterwards (Home Assistant's new state when it reports it within about 1.5 s). API 1.47.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:control"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IoTEntitySet"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IoTEntitySetResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/devices/{iot_device_id}/entities/{entity_id}/actions/start-effect": {
      "parameters": [
        {
          "$ref": "#/components/parameters/IoTDeviceKey"
        },
        {
          "$ref": "#/components/parameters/BridgeEntityId"
        }
      ],
      "post": {
        "operationId": "startIoTLightEffect",
        "summary": "Run a light effect (blink, pulse, strobe)",
        "description": "Runs a server-generated effect on one light entity: Vigiora Server drives the on/off/colour sequence itself (it does not rely on the light's own firmware), so any light that can turn on and off can blink, and any colour light can pulse. `kind` is `blink` (on/off), `pulse` (fades between `rgb` and off, or between `rgb` and `rgb2`), `strobe` (fast on/off) or `sos` (· · · — — — · · ·). `duration_s` caps the whole run (default 10, max 300); `period_ms` is one on/off cycle (clamped 120–10000); `rgb`/`rgb2` are `[r, g, b]` 0–255; `brightness_pct` is 0–100 (0 keeps the light's own). The light's state (on/off, brightness, colour) is captured before the effect and restored exactly when it ends — on its own, when stopped, when a newer effect starts on the same light, or when the server stops. Starting an effect on a light that already has one replaces it. Checked against the entity's control the same way as `setIoTDeviceEntity` (a sensitive light needs the control confirmed by an admin). API 1.59.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:control"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IoTLightEffect"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The effect is running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IoTLightEffectResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/devices/{iot_device_id}/entities/{entity_id}/actions/stop-effect": {
      "parameters": [
        {
          "$ref": "#/components/parameters/IoTDeviceKey"
        },
        {
          "$ref": "#/components/parameters/BridgeEntityId"
        }
      ],
      "post": {
        "operationId": "stopIoTLightEffect",
        "summary": "Stop a light effect",
        "description": "Cancels the effect running on a light entity and restores the light to the state it had before the effect started. `404` if no effect is running there. API 1.59.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:control"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "204": {
            "description": "Stopped and restored."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/auto-actions": {
      "get": {
        "operationId": "listAutoLightActions",
        "summary": "Automatic camera-alert light actions",
        "description": "The actions Vigiora created by itself: when an alert rule fires on a camera, the light Vigiora may control in the camera's room turns on (high severity: an SOS flash first) and goes back after `cooldown_seconds`. One per (camera, light) pair that share a room; `after_dark` is on by default (sunset to sunrise at the server's location). `announced_at` is when Vigiora told the staff it linked the light; it first acts a few minutes after that. `camera_id` narrows the list. API 1.62.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "camera_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The automatic actions (one page; there is no next cursor).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoLightActionPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/auto-actions/{auto_action_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AutoActionId"
        }
      ],
      "delete": {
        "operationId": "dismissAutoLightAction",
        "summary": "Dismiss an automatic light action",
        "description": "The undo: removes the action and remembers it, so Vigiora never links that camera and light again. The light stays under your control (a light Vigiora turned on for it is put back). API 1.62.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Dismissed."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/iot/zigbee": {
      "get": {
        "operationId": "getIoTZigbeeStatus",
        "summary": "Zigbee for the IoT devices page",
        "description": "Whether the Home Assistant Vigiora installed has Zigbee set up and the pairing window with its countdown (`permit`, null when Zigbee is not available), for the IoT devices page's \"Pair a new device\" state. Pairing itself: `POST /integrations/home-assistant/actions/zigbee-permit-join` (admins). API 1.39.0. Admins and operators.",
        "tags": [
          "IoT devices"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The Zigbee state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IoTZigbeeStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/loona": {
      "get": {
        "operationId": "getLoona",
        "summary": "Loona robot status",
        "description": "The Loona pet robot integration (experimental): whether it is `configured` (enabled and the KEYi account id stored; otherwise nothing runs and nothing is tried), `online` (a session to the robot is open now; a sleeping or off-network robot is normal), `rejected` (the robot refused the account id), the last error, and the robot (`device`: serial, model, IP, firmware version, battery percent, last seen). The robot is found on the local network automatically. The account id is never returned (`keyi_user_id_set`). API 1.64.0. Admins and operators.",
        "tags": [
          "Loona"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The Loona state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoonaStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/loona/settings": {
      "patch": {
        "operationId": "updateLoonaSettings",
        "summary": "Change the Loona settings",
        "description": "Turns the integration on or off and sets the KEYi account user id (`keyi_user_id`, the one value the server cannot find out; required to enable), the KEYi region host (`host`, default `jploona.keyirobot.cn`) and optionally the robot's serial (helps discovery) or IP (skips discovery). Fields left out keep their value. The server then connects by itself. Enabling connects a device on the local network to a third-party robot with the owner's account id, so it needs confirmation from an AI agent. `400 validation_failed` for a bad value. API 1.64.0. Admins only.",
        "tags": [
          "Loona"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoonaSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The Loona state with the new settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoonaStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/loona/actions/refresh": {
      "post": {
        "operationId": "refreshLoona",
        "summary": "Ask the Loona robot for its state now",
        "description": "Re-queries the battery, firmware version, system and mode over the open session (read-only: nothing moves) and answers with the state as it is now; the new readings arrive within a second or two (call `GET /loona`). `409 conflict` with `details.reason` `not_connected` when the robot is asleep, off the network or the integration is off. `502 device_failed` when the robot did not accept the query. API 1.64.0. Admins and operators.",
        "tags": [
          "Loona"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The Loona state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoonaStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/loona/actions/drive": {
      "post": {
        "operationId": "driveLoona",
        "summary": "Drive the Loona robot",
        "description": "EXPERIMENTAL. Nudges the robot in a direction (`direction`: `forward`, `backward`, `left` or `right`) for `duration_ms` milliseconds (default ~400, clamped to a safe range). The robot physically moves, so it needs confirmation from an AI agent. The command enters remote control, sends the nudge and leaves. The wire payload is best-effort (the integration is reverse-engineered). `409 conflict` with `details.reason` `not_connected` when the robot is asleep, off the network or the integration is off. `502 device_failed` when the robot did not accept the command. API 1.67.0. Admins and operators.",
        "tags": [
          "Loona"
        ],
        "security": [
          {
            "apiKey": [
              "devices:control"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoonaDriveAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The Loona state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoonaStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/loona/actions/speak": {
      "post": {
        "operationId": "speakLoona",
        "summary": "Make the Loona robot speak",
        "description": "EXPERIMENTAL. Makes the robot say `text` (at most 500 characters) out loud through its GPT-chat command. The robot speaks, so it needs confirmation from an AI agent. The wire payload is best-effort. `409 conflict` (`details.reason` `not_connected`) when the robot is not connected. `502 device_failed` when the robot did not accept the command. API 1.67.0. Admins and operators.",
        "tags": [
          "Loona"
        ],
        "security": [
          {
            "apiKey": [
              "devices:control"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoonaSpeakAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The Loona state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoonaStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/loona/actions/photo": {
      "post": {
        "operationId": "photoLoona",
        "summary": "Make the Loona robot take a photo",
        "description": "EXPERIMENTAL. Asks the robot to take a still with its camera (saved to the KEYi cloud; nothing is returned on the socket). Needs confirmation from an AI agent. The wire payload is best-effort. `409 conflict` (`details.reason` `not_connected`) when the robot is not connected. `502 device_failed` when the robot did not accept the command. API 1.67.0. Admins and operators.",
        "tags": [
          "Loona"
        ],
        "security": [
          {
            "apiKey": [
              "devices:control"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The Loona state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoonaStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/loona/actions/emote": {
      "post": {
        "operationId": "emoteLoona",
        "summary": "Make the Loona robot play an expression",
        "description": "EXPERIMENTAL. Makes the robot play a canned expression / behaviour (`kind`: `face`, `find_people`, `fondle`, `listen_name` or `mechanical`). The robot moves and emotes, so it needs confirmation from an AI agent. The wire payload is best-effort. `409 conflict` (`details.reason` `not_connected`) when the robot is not connected. `502 device_failed` when the robot did not accept the command. API 1.67.0. Admins and operators.",
        "tags": [
          "Loona"
        ],
        "security": [
          {
            "apiKey": [
              "devices:control"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoonaEmoteAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The Loona state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoonaStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/loona/actions/disconnect": {
      "post": {
        "operationId": "disconnectLoona",
        "summary": "Disconnect from the Loona robot",
        "description": "Drops the live link to the robot and stops the server redialling, WITHOUT forgetting it: the KEYi account id, host, serial and IP stay configured, so a later reconnect brings it back. The robot then shows as disconnected by you (`paused`) rather than merely asleep. Reversible with `POST /loona/actions/reconnect`. API 1.67.0. Admins and operators.",
        "tags": [
          "Loona"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The Loona state (now paused).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoonaStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/loona/actions/reconnect": {
      "post": {
        "operationId": "reconnectLoona",
        "summary": "Reconnect to the Loona robot",
        "description": "Clears the paused state set by `POST /loona/actions/disconnect` and redials the robot now (it connects when the robot is awake and reachable). API 1.67.0. Admins and operators.",
        "tags": [
          "Loona"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The Loona state (redialling).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoonaStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/memory/facts": {
      "get": {
        "operationId": "listMemoryFacts",
        "summary": "List what Vigiora remembers about you",
        "description": "The durable facts Vigiora learned about the calling user from their Guardian chats (a person, a habit, an experience, a preference), newest change first. Only the caller's own facts are ever returned, whatever the role. Filters: `kind` and `subject` (exact, case-insensitive). API 1.65.0.",
        "tags": [
          "Memory"
        ],
        "security": [
          {
            "apiKey": [
              "memory:read"
            ]
          },
          {
            "apiKeyHeader": [
              "memory:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "memory:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "person",
                "habit",
                "experience",
                "preference",
                "other"
              ]
            }
          },
          {
            "name": "subject",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of facts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryFactPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/memory/facts/{fact_id}": {
      "get": {
        "operationId": "getMemoryFact",
        "summary": "Read one remembered fact",
        "description": "One of the caller's own facts. `404 not_found` for a fact that does not exist or belongs to another user. API 1.65.0.",
        "tags": [
          "Memory"
        ],
        "security": [
          {
            "apiKey": [
              "memory:read"
            ]
          },
          {
            "apiKeyHeader": [
              "memory:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "memory:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/FactId"
          }
        ],
        "responses": {
          "200": {
            "description": "The fact.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryFact"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateMemoryFact",
        "summary": "Correct a remembered fact",
        "description": "Changes the text (`fact`), `kind` or `subject` of one of the caller's own facts; fields left out keep their value. The fact is embedded again so recall finds it by its new meaning (`503 service_unavailable` when the embedding service is not available, `502 device_failed` when it fails). It rewrites what Vigiora believes about a person, so it needs confirmation from an AI agent. `404 not_found` for a fact that belongs to another user. API 1.65.0.",
        "tags": [
          "Memory"
        ],
        "security": [
          {
            "apiKey": [
              "memory:write"
            ]
          },
          {
            "apiKeyHeader": [
              "memory:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "memory:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/FactId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemoryFactUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The fact after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryFact"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteMemoryFact",
        "summary": "Forget a remembered fact",
        "description": "Permanently deletes one of the caller's own facts; Vigiora stops using it in answers. It cannot be undone, so it needs confirmation from an AI agent. `404 not_found` for a fact that belongs to another user. API 1.65.0.",
        "tags": [
          "Memory"
        ],
        "security": [
          {
            "apiKey": [
              "memory:write"
            ]
          },
          {
            "apiKeyHeader": [
              "memory:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "memory:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/FactId"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/account/two-factor": {
      "get": {
        "operationId": "getTwoFactor",
        "summary": "Two-factor sign-in status",
        "description": "Whether the caller signs in with a code from an authenticator app as well as the password (`enabled`), has started turning it on without confirming a first code (`pending`), since when, and how many unused recovery codes are left. `available: false` when the server cannot store two-factor secrets (its secret key is missing). Turning it on or off needs a user session (the actions below), never an API key. API 1.107.0.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "apiKey": [
              "account:read"
            ]
          },
          {
            "apiKeyHeader": [
              "account:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "account:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The caller's two-factor status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwoFactorStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/account/two-factor/actions/enrol": {
      "post": {
        "operationId": "enrolTwoFactor",
        "summary": "Start turning two-factor sign-in on",
        "description": "Checks the caller's password and creates a new secret (replacing one not yet confirmed). Show `otpauth_uri` as a QR code (or `secret` for typing in) to the user's authenticator app, then confirm with a first code. The secret is never shown again. Wrong passwords count in the same per-user limit as codes (5 per address in 10 minutes, 20 per hour: `429 rate_limited`). `403 forbidden` for a wrong password, `409 conflict` when it is already on, `503 service_unavailable` when the server cannot store secrets. User sessions only. API 1.107.0.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": "unsupported",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TwoFactorPassword"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwoFactorEnrolment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/account/two-factor/actions/confirm": {
      "post": {
        "operationId": "confirmTwoFactor",
        "summary": "Confirm two-factor sign-in with a first code",
        "description": "Turns two-factor sign-in on when `code` (6 digits, one 30-second step of clock drift either way) matches the secret from the enrol action, and returns 10 one-time recovery codes. They are shown only here; keep them somewhere safe. From now on a sign-in needs the password and a code. `400 validation_error` (field `code`) for a wrong code, `409 conflict` when nothing is being turned on. User sessions only. API 1.107.0.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": "unsupported",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TwoFactorCode"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "On, with the recovery codes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwoFactorConfirmed"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/account/two-factor/actions/regenerate-recovery-codes": {
      "post": {
        "operationId": "regenerateRecoveryCodes",
        "summary": "Get new recovery codes",
        "description": "Replaces the caller's recovery codes with 10 new ones (the old ones stop working). Needs the password and a code (from the app, or a recovery code). `403 forbidden` for a wrong password, `400 validation_error` for a wrong code, `409 conflict` when two-factor sign-in is off. User sessions only. API 1.107.0.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": "unsupported",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TwoFactorPasswordCode"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new recovery codes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwoFactorRecoveryCodes"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/account/two-factor/actions/disable": {
      "post": {
        "operationId": "disableTwoFactor",
        "summary": "Turn two-factor sign-in off",
        "description": "Turns two-factor sign-in off for the caller: the secret and the recovery codes are deleted and the password alone signs in again. Needs the password and a code (from the app, or a recovery code). `403 forbidden` for a wrong password, `400 validation_error` for a wrong code, `409 conflict` when it is already off. User sessions only. API 1.107.0.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": "unsupported",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TwoFactorPasswordCode"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The status after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwoFactorStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/account/sessions": {
      "get": {
        "operationId": "listAccountSessions",
        "summary": "List your signed-in devices",
        "description": "The caller's signed-in devices (web app and app sign-ins that have not expired or been signed out), the current one first, then the most recently used. `browser` and `os` are read from the device's User-Agent (empty when not recognised); `ip` and `last_used_at` are those of its last sign-in or token refresh. `current` is true for the session making the call (never for an API key). API keys and MCP connections are not listed here (see `/api-keys`). Not paginated (`next_cursor` is always null). API 1.107.0.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "apiKey": [
              "account:read"
            ]
          },
          {
            "apiKeyHeader": [
              "account:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "account:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The signed-in devices.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSessionPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/account/sessions/{session_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SessionId"
        }
      ],
      "delete": {
        "operationId": "revokeAccountSession",
        "summary": "Sign a device out",
        "description": "Signs one of the caller's devices out: its refresh token stops working at once, so it is asked to sign in again within the access token's lifetime (15 minutes at most). `404 not_found` for a session that does not exist or belongs to another user. API 1.107.0.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "apiKey": [
              "account:write"
            ]
          },
          {
            "apiKeyHeader": [
              "account:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "account:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": true,
        "responses": {
          "204": {
            "description": "Signed out."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/account/sessions/actions/revoke-others": {
      "post": {
        "operationId": "revokeOtherAccountSessions",
        "summary": "Sign out everywhere else",
        "description": "Signs out every signed-in device of the caller except the one making the call, and returns how many were signed out. `409 conflict` for a session from before 1.107.0 that does not know its own id (sign out and in again). User sessions only. API 1.107.0.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "session"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": "unsupported",
        "responses": {
          "200": {
            "description": "How many devices were signed out.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSessionsRevoked"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/bluetooth": {
      "get": {
        "operationId": "getBluetooth",
        "summary": "Bluetooth nearby status",
        "description": "Whether the server can scan the Bluetooth devices around it (`available`; `reason` `not_supported` (not Linux), `no_dbus`, `no_bluez`, `no_adapter`, `adapter_off`, `denied` (the D-Bus policy refuses the service account) or `disabled`), the adapter, the scan settings (`enabled`, `scan_interval_minutes`, `scan_seconds`: also on `GET /settings` as `bluetooth_enabled`, `bluetooth_scan_interval_minutes`, `bluetooth_scan_seconds`), whether a scan runs now, the last scan, when the next scheduled one is due (`next_scan_at`, null while disabled or unavailable), the number of devices known (ignored ones excluded) and those first seen in the last 24 hours. The server scans once an hour (and two minutes after it starts): BLE and classic devices in range of the host adapter, through BlueZ, reading advertisements only — nothing is ever paired or connected to. API 1.42.0. Admins and operators.",
        "tags": [
          "Bluetooth"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The Bluetooth state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BluetoothStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/bluetooth/devices": {
      "get": {
        "operationId": "listBluetoothDevices",
        "summary": "Bluetooth devices seen near the server",
        "description": "Every device a scan has seen, most recently seen first, with what it advertised (name, maker from the Bluetooth SIG company identifier, services by name, manufacturer and service data as hex, appearance, class of device, signal), the classification (`kind`: phone, watch, earbuds, speaker_tv, tracker, sensor, smart_home, computer, car, beacon, unknown; `label`, `confidence`) and the history (first and last seen, `seen_count`, `new_today`). A device is keyed by its address; phones, watches and earbuds rotate a random address (`random_address`) every few minutes, and a device that came back under a new address with the same name and payload keeps its entry (`address_changes`). Ignored devices are left out unless `include_ignored=true`. The full report (what it is, the data it could provide, how Vigiora could use it) is on the detail. API 1.42.0. Admins and operators.",
        "tags": [
          "Bluetooth"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "phone",
                "watch",
                "earbuds",
                "speaker_tv",
                "tracker",
                "sensor",
                "smart_home",
                "computer",
                "car",
                "beacon",
                "unknown"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Search words (name, address, maker, label, note).",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "seen_since",
            "in": "query",
            "description": "Only devices seen at or after this time.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "include_ignored",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of devices.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BluetoothDevicePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/bluetooth/devices/{bluetooth_device_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/BluetoothAddress"
        }
      ],
      "get": {
        "operationId": "getBluetoothDevice",
        "summary": "A Bluetooth device with its report",
        "description": "The device with its `report`: what it is (`kind`, `label`, `confidence`, the `reasons` that decided it), the data it could provide (`data_available`: presence per scan, signal, a stable or rotating identity, battery or readings over GATT (a documented future step: nothing is connected to yet), beacon ids, tracker status…) and how Vigiora could use it (`uses_for_vigiora`: occupancy of a known phone or watch, a 'someone is home' signal from a TV or speaker, an unknown device at night as a security signal, a tracker staying near the house, environmental readings on the floor plan…), with `notes` (rotating addresses, nothing paired). Each line has a stable `code` and an English `text`. API 1.42.0. Admins and operators.",
        "tags": [
          "Bluetooth"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The device and its report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BluetoothDevice"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateBluetoothDevice",
        "summary": "Note or ignore a Bluetooth device",
        "description": "Sets the admin's `note` (at most 500 characters) and the `ignored` flag (an ignored device is left out of the list and the counts, and is still updated by scans). Give at least one. Nothing is paired, connected or removed. API 1.42.0. Admins and operators.",
        "tags": [
          "Bluetooth"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BluetoothDeviceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The device and its report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BluetoothDevice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/bluetooth/actions/scan": {
      "post": {
        "operationId": "scanBluetooth",
        "summary": "Scan for Bluetooth devices now",
        "description": "Runs a scan now and answers when it is done (about `seconds`, 5–60, default the `bluetooth_scan_seconds` setting) with the scan: how many devices were seen and how many were new. New devices are announced as `bluetooth.device_found` events. One scan runs at a time (`409 scan_in_progress`); without a usable adapter `409 bluetooth_unavailable` with `details.reason`. Advertisements only: nothing is paired or connected to. API 1.42.0. Admins and operators.",
        "tags": [
          "Bluetooth"
        ],
        "security": [
          {
            "apiKey": [
              "devices:write"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "x-vigiora-destructive": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BluetoothScanRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The finished scan.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BluetoothScan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/bluetooth/scans": {
      "get": {
        "operationId": "listBluetoothScans",
        "summary": "Bluetooth scan history",
        "description": "The scans run (scheduled, at startup or on demand), newest first, with their outcome. API 1.42.0. Admins and operators.",
        "tags": [
          "Bluetooth"
        ],
        "security": [
          {
            "apiKey": [
              "devices:read"
            ]
          },
          {
            "apiKeyHeader": [
              "devices:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "devices:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of scans.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BluetoothScanPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/line": {
      "get": {
        "operationId": "getLineIntegration",
        "summary": "LINE notifications",
        "description": "The LINE channel alerts can go to: whether it is on, whether a bot token is stored (`token_set`; the token itself is never returned), the recipients, and its delivery status (`state`: `not_set_up`, `disabled`, `ready`, `error`; `sent`, `suppressed` by the 20-a-minute limit, the last error). API 1.26.0. Admins and operators.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The channel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatIntegration"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateLineIntegration",
        "summary": "Set up LINE notifications",
        "description": "Changes the LINE channel: `token` (the Messaging API channel access token; stored sealed with the server's secret key and never returned; an empty string clears it), `recipients` (LINE user, group or room ids: `U…`, `C…` or `R…`, 33 characters; at most 10) and `enabled` (needs a token and a recipient). Only the fields sent change. Then an alert rule's `telegram_enabled` / `line_enabled` chooses it. The request is not idempotent-replayable (`Idempotency-Key` refused). `409 conflict` (`no_secret_key`). API 1.26.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatIntegrationUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The channel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatIntegration"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/integrations/line/actions/test": {
      "post": {
        "operationId": "testLineIntegration",
        "summary": "Send a LINE test message",
        "description": "Sends a test message to every recipient of the LINE channel (the token and recipients must be set; the channel need not be on). `409 conflict` (`not_configured`); `502 device_failed` when LINE refuses it (the reason, without the token). API 1.26.0. Admins only.",
        "tags": [
          "Integrations"
        ],
        "security": [
          {
            "apiKey": [
              "settings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "settings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "settings:write"
        ],
        "x-vigiora-roles": [
          "admin"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "$ref": "#/components/requestBodies/EmptyAction"
        },
        "responses": {
          "200": {
            "description": "Sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatTestResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/openapi.yaml": {
      "get": {
        "operationId": "getOpenAPIYAML",
        "summary": "This document (YAML)",
        "tags": [
          "Docs"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The OpenAPI document.",
            "content": {
              "application/yaml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Not modified (ETag)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/openapi.json": {
      "get": {
        "operationId": "getOpenAPIJSON",
        "summary": "This document (JSON)",
        "tags": [
          "Docs"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The OpenAPI document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "304": {
            "description": "Not modified (ETag)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plan-sites": {
      "get": {
        "operationId": "listFloorPlanSites",
        "summary": "List the sites floor plans can be added to",
        "description": "API 1.23.0. The site nodes you can see (a site group grant on the site or on its branch with zones included, or a camera of yours on that site; admins see every site), ordered by name, with their plan count and whether you may add and edit plans there (`can_edit`: the admin role, or the admin or operator role with manager level on the site). Not paged: sites are few.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:read"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The sites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanSiteList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans": {
      "get": {
        "operationId": "listFloorPlans",
        "summary": "List floor plans",
        "description": "API 1.23.0. The floor plans of the sites you can see, by id (order them by `sort_order` then `floor_number` for display). `camera_count` and `unacked_alerts` count only the cameras you may view.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:read"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "site_id",
            "in": "query",
            "description": "Only this site's plans.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of plans.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createFloorPlan",
        "summary": "Upload a floor plan",
        "description": "API 1.23.0. Uploads a floor plan image for a site: PNG or JPEG (recognised by content), at most 18 MB, each side at most 8192 px and at most 40 megapixels (convert PDF or SVG to PNG first). The image is re-encoded on the server (metadata such as GPS positions is dropped) and a 512 px thumbnail is made. Send `multipart/form-data` (text fields `site_id`, `name`, `floor_number`, `sort_order` and the file `image`) or JSON with the image base64-encoded in `image_base64` (a `data:image/png;base64,` prefix is accepted; MCP clients: the MCP endpoint accepts at most 1 MB per call). Needs the admin role, or the admin or operator role with manager level on the site (`403 forbidden` otherwise). `415 unsupported_media_type` for another image format, `413 payload_too_large` over the limit. Request bodies are limited to 20 MB, so the image may be 18 MB as a multipart file but only about 13.5 MB in the JSON `image_base64` form (base64 adds a third).",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": true,
        "x-vigiora-confirm": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FloorPlanCreate"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/FloorPlanUpload"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The plan (version 1).",
            "headers": {
              "Location": {
                "description": "The plan's URL.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans/blocks": {
      "get": {
        "operationId": "listFloorPlanBlocks",
        "summary": "The block library of the floor-plan editor",
        "description": "API 1.82.0. The standard pieces an operator drags onto a plan, each at its real size in metres: room presets, doors and windows (structure), furniture and fixtures (furniture, plan item kind `furniture`) and the grounds around the house (grounds, plan item kind `landmark`). Place a block as an item of its `kind` with its `label`; on a plan with a scale its size is `width_m` by `depth_m`. On a plan Vigiora drew (scan or description) the metre grid passes through `grid_origin_px` canvas pixels on both axes.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:read"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The library.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanBlockList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans/{floor_plan_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/FloorPlanId"
        }
      ],
      "get": {
        "operationId": "getFloorPlan",
        "summary": "Get a floor plan with its description",
        "description": "API 1.23.0. One plan with `description`: a plain-language account of where the cameras you may view are on it (compass direction they face, the rooms and areas they cover, what is near them), written for AI assistants. Use it to answer \"where is camera X\", \"which camera covers the back door\" or, with `get_floor_plan_live`, \"what is happening on floor 1\". Coordinates elsewhere are fractions of the image (0..1, origin top left); rotation 0 is up on the image (\"north\"), clockwise.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:read"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The plan.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlan"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateFloorPlan",
        "summary": "Update a floor plan",
        "description": "API 1.23.0. Changes the fields sent and, with `image_base64` (JSON) or the file `image` (multipart), replaces the image (same limits as the upload: 18 MB as a multipart file, about 13.5 MB of image in the JSON `image_base64` form, since request bodies are limited to 20 MB; items keep their positions as fractions of the image). Moving the plan to another site (`site_id`) needs manager level on both. Every update increases `version`.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FloorPlanUpdate"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/FloorPlanUpload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The plan.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteFloorPlan",
        "summary": "Delete a floor plan",
        "description": "API 1.23.0. Deletes the plan, its image and everything placed on it (the cameras, rooms and areas themselves stay).",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-destructive": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans/{floor_plan_id}/image": {
      "parameters": [
        {
          "$ref": "#/components/parameters/FloorPlanId"
        }
      ],
      "get": {
        "operationId": "getFloorPlanImage",
        "summary": "Floor plan image",
        "description": "API 1.23.0. The plan image (PNG or JPEG as uploaded, re-encoded) or, with `size=thumb`, its JPEG thumbnail (512 px longest side). Use `image_url` / `thumb_url` of the plan: they carry the version, so the image may be cached (`Cache-Control: private, max-age=86400`). Not served through a Cloudflare Tunnel origin (media is served by the media origin). Not an MCP tool.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:read"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-mcp": false,
        "parameters": [
          {
            "name": "size",
            "in": "query",
            "description": "`thumb` for the thumbnail.",
            "schema": {
              "type": "string",
              "enum": [
                "thumb"
              ]
            }
          },
          {
            "name": "v",
            "in": "query",
            "description": "The plan version (cache key; ignored by the server).",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The image.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans/{floor_plan_id}/items": {
      "parameters": [
        {
          "$ref": "#/components/parameters/FloorPlanId"
        }
      ],
      "get": {
        "operationId": "listFloorPlanItems",
        "summary": "List what is placed on a floor plan",
        "description": "API 1.23.0. The cameras, speakers (pins with `x`, `y`), rooms and analytics areas (polygons) placed on the plan, with the plan `version` to send back with a replace. Items you cannot see (a camera you may not view, a speaker of such a camera, a room or area you cannot see) are left out. Coordinates are fractions of the image (0..1, origin top left); `rotation_deg` 0 is up, clockwise; `range` is a fraction of the image width.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:read"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanItems"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans/{floor_plan_id}/items/actions/replace": {
      "parameters": [
        {
          "$ref": "#/components/parameters/FloorPlanId"
        }
      ],
      "post": {
        "operationId": "replaceFloorPlanItems",
        "summary": "Replace what is placed on a floor plan",
        "description": "API 1.23.0. Replaces the items you can see with `items` (at most 500; `id` and `name` are ignored); items you cannot see stay. `version` must be the plan's current version (from the items or the plan), else `409 conflict` with `details.current_version` and nothing is written: read the items again and merge. A camera appears at most once per plan; `fov_deg` defaults to 90 and `range` to 0.15. The body is at most 2 MB. Since API 1.40.0 an IoT device (`GET /iot/devices`) is pinned with kind `device` and its `device_key` (`entity_id` picks the entity whose state the pin shows); a device pinned inside a room polygon becomes a managed device of that room (its shared entities are the room's signals), like a camera; `400 validation` for a key the IoT devices page does not know.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FloorPlanItemsReplace"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The items after the replace, with the new version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanItems"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans/{floor_plan_id}/live": {
      "parameters": [
        {
          "$ref": "#/components/parameters/FloorPlanId"
        }
      ],
      "get": {
        "operationId": "getFloorPlanLive",
        "summary": "Live state of a floor plan",
        "description": "API 1.23.0. For the cameras on the plan you may view: status (`online`, `offline`, `standby`, `disabled`, `unknown`), whether it is recording, its unacknowledged alerts of the last 24 hours and the newest one. With the Analytics add-on (`analytics_entitled`), the live occupancy of the analytics areas on the plan; without it `areas` is empty. Use it with `get_floor_plan` to answer \"what is happening on floor 1\".",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:read"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The live state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanLive"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans/{floor_plan_id}/rooms": {
      "parameters": [
        {
          "$ref": "#/components/parameters/FloorPlanId"
        }
      ],
      "get": {
        "operationId": "listFloorPlanRooms",
        "summary": "Rooms drawn on a floor plan",
        "description": "API 1.38.0. The rooms whose polygon is on the plan, as `GET /rooms` shows them (rooms whose every camera the caller may view; viewers do not see rooms without cameras). A room polygon saved without `room_id` is given a room by the server, so every polygon on the plan is one of these.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:read"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The rooms on the plan.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanRooms"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans/{floor_plan_id}/actions/sync-rooms": {
      "parameters": [
        {
          "$ref": "#/components/parameters/FloorPlanId"
        }
      ],
      "post": {
        "operationId": "syncFloorPlanRooms",
        "summary": "Sync the rooms of a floor plan",
        "description": "API 1.38.0. What the server does on every write of the plan's items, on demand (idempotent; nothing a user made is removed): a room polygon without a room gets one (the site's room of that name when one is not yet on the plan, else a new room with source `plan`), a polygon's label and its room's name are made equal (the label wins), and the cameras whose pin is inside a polygon become that room's managed cameras — a camera that moved to another polygon moves with it, one outside every polygon leaves its managed room. Cameras a user put in a room by hand stay. Needs edit access to the plan.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "What the sync changed and the rooms on the plan.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanRoomSync"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/sites/{site_id}/floor-plans/describe": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SiteId"
        }
      ],
      "post": {
        "operationId": "describeFloorPlan",
        "summary": "Draw a floor plan from a description",
        "description": "API 1.32.0. For a site without a plan image: describe the place in words (\"a two-bedroom house, the kitchen left of the entrance, a pool in the garden to the east\") and the AI draws a schematic plan (rooms, doors, outdoor areas, a 1 m grid, a north arrow when the description gives directions), places the site's cameras it can match (by name or the rooms they are in) and stores it as a floor plan with `source: ai`. The answer carries the plan, the `layout` it was drawn from (metres, origin at the north-west corner) and the cameras that could not be placed. One AI call (two when the first answer is unusable or has overlapping areas or a stated size not kept), charged like a Guardian chat; the whole generation is limited to 60 seconds. API 1.33.0: what is still wrong after the second answer is repaired by the server (the notes say what it changed); cameras are placed from the area they are mounted on and the areas they look at; when the site has fewer cameras than the description mentions, your other visible, enabled cameras can be matched too (by name or the words of the description; a camera without a confident match is left unplaced) and keep their site. `503 ai_unavailable` when the server has no AI (not connected to Vigiora cloud) or the AI gave no usable plan, `402 insufficient_credits` when out of credits. Editing rights as for uploading a plan.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FloorPlanDescribe"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new plan (version 1) and its layout.",
            "headers": {
              "Location": {
                "description": "The plan's URL.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanGeneration"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/sites/{site_id}/floor-plans/scan": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SiteId"
        }
      ],
      "post": {
        "operationId": "scanFloorPlan",
        "summary": "Build a floor plan by scanning the cameras",
        "description": "API 1.66.0. Sweeps every camera of the site (PTZ cameras turn through a panorama), reads each picture with the AI, finds where the cameras' views overlap and stores the result as the site's scanned top-down plan (`source: scan`; a re-scan makes a new version of the same plan). The answer is the plan id and how the scan went: `scale` is `locked` (a measured size was found), `estimate` or `unscaled`; `placed` cameras were put on the plan and `islands` groups (or cameras) could not be tied to the main layout. A camera that fails to scan is left out; `422 validation_error` when the site has no cameras assigned to it (`details.field: site_id` — assign cameras to the site first) or when none of its cameras could see the floor. One AI call per camera (and per overlap check), charged like a Guardian chat; the whole scan is limited to 15 minutes. Editing rights as for uploading a plan (manager level on the site). `503 service_unavailable` when the server cannot scan.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "201": {
            "description": "The scanned plan.",
            "headers": {
              "Location": {
                "description": "The plan's URL.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanScanResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/sites/{site_id}/floor-plans/walkthroughs/sessions": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SiteId"
        }
      ],
      "post": {
        "operationId": "createFloorPlanWalkthroughSession",
        "summary": "Start a walk-through recording session",
        "description": "API 1.83.0. Call when the phone starts recording a walk-through. The answer is an unguessable `token` and the `qr_prefix` of the QR codes the phone may show the cameras while walking (`<qr_prefix><seq>`, `seq` counting up once a second from 0; the sensor track records when each `seq` was shown). A camera that reads one of the codes tells Vigiora which room it is in and where: `createFloorPlanWalkthrough` with this `token` in its `session` part places those cameras in the room the walker was in, on the wall behind the phone, facing the walker. A session is valid for 24 hours and used by one upload. The token is shown only here (no Idempotency-Key). Editing rights as for uploading a plan (manager level on the site).",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": "unsupported",
        "responses": {
          "201": {
            "description": "The session.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanWalkthroughSession"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/sites/{site_id}/floor-plans/walkthroughs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SiteId"
        }
      ],
      "get": {
        "operationId": "listFloorPlanWalkthroughs",
        "summary": "List the site's walk-throughs",
        "description": "API 1.85.0. The site's walk-throughs, newest first (at most 200), each with whether its video is kept (`video_kept`, `video_bytes`). A walk's video, sensor track and the cameras' QR sightings are kept until the walk is deleted (`DELETE /floor-plans/walkthroughs/{walkthrough_id}`), so it can be watched and run again. Managers of the site only.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:read"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The walk-throughs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanWalkthroughPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createFloorPlanWalkthrough",
        "summary": "Build a floor plan from a walk-through video",
        "description": "API 1.83.0. Upload a phone video of a walk through the rooms and the grounds (MP4, MOV or WebM, up to 1 GB and 30 minutes) as `multipart/form-data`: the optional `session` (a token from `createFloorPlanWalkthroughSession`) and `sensors` (the phone's sensor track, JSON — see `FloorPlanWalkthroughSensors`) parts first, the `video` part last. The answer is `202` with the job; poll `getFloorPlanWalkthrough`. The server takes frames at about 2 per second, drops blurry and repeated ones, reads at most 48 with the vision AI (a runner's local model first, the cloud AI when there is none or it fails; only frames leave the server, never the video), splits the walk into places, and draws rooms (sized from the steps and compass when the track has them, else typical sizes), doors where the walk went from room to room, windows, the furniture seen (block library sizes) and the grounds. A site without a plan gets a new one (`source: scan`); otherwise the walk is ADDED to the site's plan (the scanned one first): rooms, doors, furniture and grounds the plan lacks — nothing on it is deleted or moved, except camera pins Vigiora placed itself, which a camera's QR sightings may move; the plan's items are kept in the job before the change. The GPS fix (or the video's own location tag) sets the site's location when it has none. Missing sensors only make a poorer plan; the job's `notes` say what was used. Cloud reads are charged like a Guardian chat; `402` when out of AI credits. `413` over 1 GB, `415` not a video. Not served through a Cloudflare Tunnel origin (media goes to the media origin). Not an MCP tool.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-mcp": false,
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/FloorPlanWalkthroughUpload"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job, queued; poll its URL.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanWalkthrough"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans/walkthroughs/{walkthrough_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WalkthroughId"
        }
      ],
      "get": {
        "operationId": "getFloorPlanWalkthrough",
        "summary": "Get a walk-through job",
        "description": "API 1.83.0. A walk-through's progress (`state` queued → running → done or failed; `phase` frames, reading, layout, saving) and, when done, the plan it made or added to (`plan_id`, `merged`), what it drew (`counts`), which phone sensors shaped it (`sensors_used`) and short `notes`. A recording session not yet uploaded is `recording`. Visible to managers of the site; `404` otherwise.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:read"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanWalkthrough"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteFloorPlanWalkthrough",
        "summary": "Delete a walk-through",
        "description": "API 1.85.0. Deletes the walk-through and its kept video, sensor track and QR sightings. The plan it made or added to stays. Nothing is deleted automatically: this is the only way a walk's video goes. `409` while the walk is being read.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-destructive": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans/walkthroughs/{walkthrough_id}/video": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WalkthroughId"
        }
      ],
      "get": {
        "operationId": "getFloorPlanWalkthroughVideo",
        "summary": "Walk-through video",
        "description": "API 1.85.0. The kept video of the walk (MP4 or WebM as the phone recorded it; Range requests supported). `404` when none is kept.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:read"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The video.",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/webm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "Part of the video (a Range request)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans/walkthroughs/{walkthrough_id}/actions/rerun": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WalkthroughId"
        }
      ],
      "post": {
        "operationId": "rerunFloorPlanWalkthrough",
        "summary": "Run a walk-through again",
        "description": "API 1.85.0. Reads a finished (done or failed) walk again from its kept video, sensor track and QR sightings — after a failure, or to use a better layout. The job goes back to `queued` and is followed like a new one (`GET /floor-plans/walkthroughs/{walkthrough_id}`). The plan the earlier run made stays; the new run makes a plan of its own, so the two can be compared; nothing a person placed is touched. Spends AI credits for frames read by the cloud. `409` while the walk is recorded or read, or when its video is not kept.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "202": {
            "description": "Queued again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanWalkthrough"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/sites/{site_id}/floor-plans/walkthroughs/uploads": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SiteId"
        }
      ],
      "post": {
        "operationId": "createFloorPlanWalkthroughUpload",
        "summary": "Open a chunked walk-through upload",
        "description": "API 1.90.0. A walk-through video is a few hundred megabytes and the phone is often on a mobile network, where one long request dies at the first hiccup. Open an upload, send the video in chunks of `chunk_bytes` (`appendFloorPlanWalkthroughUpload`, each a small request the client simply repeats when it fails), then `finishFloorPlanWalkthroughUpload` with the sensors and the session token: the server joins the chunks and runs the same job as `createFloorPlanWalkthrough`. An upload not finished within 24 hours is dropped. Managers of the site only. Not served through a Cloudflare Tunnel origin (media goes to the media origin). Not an MCP tool.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-mcp": false,
        "responses": {
          "201": {
            "description": "The upload, open and empty.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanWalkthroughChunkedUpload"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/sites/{site_id}/floor-plans/walkthroughs/uploads/{upload_id}/actions/append": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SiteId"
        },
        {
          "$ref": "#/components/parameters/UploadId"
        }
      ],
      "post": {
        "operationId": "appendFloorPlanWalkthroughUpload",
        "summary": "Send one chunk of the video",
        "description": "API 1.90.0. The raw bytes of chunk `index` (0-based, at most `chunk_bytes` each, `413` over that; the last chunk may be shorter). Sending an index again replaces that chunk, so a client that never saw the answer repeats the request. The answer lists the chunks received so far. `404` for an unknown, expired or another site's upload. Not an MCP tool.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-mcp": false,
        "parameters": [
          {
            "name": "index",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 128
            },
            "description": "The chunk number, 0-based."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The upload with the chunks received.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanWalkthroughChunkedUpload"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/sites/{site_id}/floor-plans/walkthroughs/uploads/{upload_id}/actions/finish": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SiteId"
        },
        {
          "$ref": "#/components/parameters/UploadId"
        }
      ],
      "post": {
        "operationId": "finishFloorPlanWalkthroughUpload",
        "summary": "Join the chunks and build the plan",
        "description": "API 1.90.0. Says how many chunks make the video (`chunks`, and its `size` in bytes when known), with the optional `session` token and `sensors` track of `createFloorPlanWalkthrough`. `400` names a chunk that was not received (send it again and finish again). On success the answer is `202` with the job, exactly as `createFloorPlanWalkthrough`, and the upload is spent. `402`, `413`, `415` as there. Not an MCP tool.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-mcp": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FloorPlanWalkthroughFinish"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job, queued; poll its URL.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanWalkthrough"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans/{floor_plan_id}/actions/refine": {
      "parameters": [
        {
          "$ref": "#/components/parameters/FloorPlanId"
        }
      ],
      "post": {
        "operationId": "refineFloorPlan",
        "summary": "Change a described floor plan",
        "description": "API 1.32.0. Changes a plan drawn from a description (`source: ai`) by an instruction (\"move the kitchen to the left of the entrance\", \"the pool is outside, to the east\"): the AI gets the current layout, with the cameras where their pins are now, and returns the whole updated layout, which is drawn as a new version of the same plan (the camera pins of the layout's cameras move; other items stay). The layout before the change is kept for one undo (`undoFloorPlanLayout`). `400 validation_error` for an uploaded plan. Charged and limited like `describeFloorPlan`.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FloorPlanRefine"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The plan's new version and its layout.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanGeneration"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans/{floor_plan_id}/layout": {
      "parameters": [
        {
          "$ref": "#/components/parameters/FloorPlanId"
        }
      ],
      "get": {
        "operationId": "getFloorPlanLayout",
        "summary": "The layout a floor plan was drawn from",
        "description": "API 1.32.0. For a plan drawn from a description: its `layout` (areas in metres with the origin at the north-west corner, x east, y south; openings; cameras where their pins are now, the ones you may view), whether one change can be undone and the description chat. An uploaded plan answers `layout: null`. With `format=svg` the layout is drawn as an SVG image with the cameras and their view (404 for an uploaded plan).",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:read"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "description": "`json` (default) or `svg`.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "svg"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The layout.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanLayoutView"
                }
              },
              "image/svg+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/floor-plans/{floor_plan_id}/layout/actions/undo": {
      "parameters": [
        {
          "$ref": "#/components/parameters/FloorPlanId"
        }
      ],
      "post": {
        "operationId": "undoFloorPlanLayout",
        "summary": "Undo the last change of a described floor plan",
        "description": "API 1.32.0. Goes back to the layout before the last `refineFloorPlan` (one level; no AI call): the plan is drawn again from it as a new version and its cameras' pins return to where they were. `400 validation_error` when there is nothing to undo or the plan was uploaded.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:write"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The plan's new version and its layout.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FloorPlanGeneration"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/views/actions/compose": {
      "post": {
        "operationId": "composeView",
        "summary": "Compose an AI view",
        "description": "API 1.34.0. Says in words what to check; the AI answers with a view (title, summary, cards on cameras, grid) composed from the cameras, analytics areas and zones and floor plans the caller can see (`site_id` limits the catalogue to a site and its sub-sites). Names are matched to cameras (by name, tag, room or site); cards a camera cannot show are left out and `spec.notes` say what changed. One AI call (two when the first answer is unusable), charged like a Guardian chat; the whole composition is limited to 45 seconds. The view is stored for the caller (the 30 most recently opened unpinned views are kept). `503 ai_unavailable` when the server has no AI (not connected to Vigiora cloud) or the AI gave no usable view, `402 insufficient_credits` when out of credits.",
        "tags": [
          "Views"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ViewCompose"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The composed view.",
            "headers": {
              "Location": {
                "description": "The view's URL.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/View"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/views": {
      "get": {
        "operationId": "listViews",
        "summary": "List AI views",
        "description": "API 1.34.0. The caller's views: pinned first, then by last opened. At most 200.",
        "tags": [
          "Views"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The views.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViewPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/views/suggestions": {
      "get": {
        "operationId": "listViewSuggestions",
        "summary": "Example requests for an AI view",
        "description": "API 1.34.0. Three example requests written from what the caller has (camera names, analytics, audio, plate or face readers, floor plans), for the empty state of the AI mode.",
        "tags": [
          "Views"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The examples (empty without cameras).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViewSuggestions"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/views/{view_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ViewId"
        }
      ],
      "get": {
        "operationId": "getView",
        "summary": "Get an AI view",
        "description": "API 1.34.0. One of the caller's views; opening it moves it to the top of the recent views (`open=0` reads without that). Another user's view is `404`.",
        "tags": [
          "Views"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "open",
            "in": "query",
            "required": false,
            "description": "`0` reads the view without marking it opened.",
            "schema": {
              "type": "string",
              "enum": [
                "0",
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The view.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/View"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateView",
        "summary": "Pin, rename or trim an AI view",
        "description": "API 1.34.0. `pinned` keeps the view past the recent-views cap, `title` renames it, `card_keys` keeps only those cards (in grid order; at least one). At least one field.",
        "tags": [
          "Views"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ViewPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The view.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/View"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteView",
        "summary": "Delete an AI view",
        "description": "API 1.34.0. The caller's own views only.",
        "tags": [
          "Views"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/views/{view_id}/actions/refine": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ViewId"
        }
      ],
      "post": {
        "operationId": "refineView",
        "summary": "Change an AI view",
        "description": "API 1.34.0. Changes a view by an instruction (\"add the garage\", \"drop the heatmap\", \"last 7 days instead\"): the AI gets the current view and answers with the whole new one; cards the instruction does not mention are carried over as they are. The instruction is appended to the view's `prompt`; a title set by hand stays. Charged and limited like `composeView`.",
        "tags": [
          "Views"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ViewRefine"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The changed view.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/View"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/transcript": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraTranscript",
        "summary": "Speech transcript segments",
        "description": "API 1.35.0. The speech-to-text segments of the camera or microphone in `[from, to]` (default: the last 24 hours; at most 7 days), oldest first. Each segment is what the STT wrote at once (a few seconds, often cut mid-sentence); join segments closer than ~8 s into passages to read them. Within the window the newest 2000 segments are listed, paged by `limit` and `cursor`. Empty for a camera without speech-to-text.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "The segments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptSegmentPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/transcript/coverage": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraTranscriptCoverage",
        "summary": "Transcript coverage ranges",
        "description": "API 1.73.0. The stretches of `[from, to]` (default: the last 24 hours; at most 7 days) that have a transcript, as merged `{from, to, segments}` ranges, oldest first — rows closer than ~20 s are merged into one range. Computed over every row in the window (not just the newest, unlike the segment list), so it is exact across a full day: a gap between ranges is a stretch with no transcript (recorded speech not yet transcribed, or silence). Lets a client mark transcript coverage on a timeline without listing every segment. Empty for a camera without speech-to-text.",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:read"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The coverage ranges.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptCoverage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/transcript/actions/translate": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "translateTranscript",
        "summary": "Translate transcript passages",
        "description": "API 1.35.0. Renders the passages you give (at most 50, 2000 characters each, 20000 in all; `id` is yours and comes back unchanged, in the same order) in the language `to` (ISO 639-1). One AI call (two when the first answer is unusable), charged like a Guardian chat under the feature key `transcript_translate`; nothing is stored. `503 ai_unavailable` when the server has no AI (not connected to Vigiora cloud) or the AI gave no usable answer, `402 insufficient_credits` when out of credits. Limits per credential: 10 a minute and 2 AI operations at once (`429 rate_limited`).",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranscriptTranslate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The passages translated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptTranslation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/transcript/actions/summarize": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "summarizeTranscript",
        "summary": "Summarize recent speech",
        "description": "API 1.35.0. Sums up the speech of the last `minutes` (1 to 1440; the panel offers 10 and 60) in 2–4 sentences in `language` (ISO 639-1). No speech in the window: `summary` is empty, `segments` 0 and no AI call is made. Otherwise one AI call (two when the first answer is unusable), charged like a Guardian chat under the feature key `transcript_summarize`; nothing is stored. `503 ai_unavailable` when the server has no AI or the AI gave no usable answer, `402 insufficient_credits` when out of credits. Limits per credential: 10 a minute and 2 AI operations at once (`429 rate_limited`).",
        "tags": [
          "Guardian"
        ],
        "security": [
          {
            "apiKey": [
              "guardian:write"
            ]
          },
          {
            "apiKeyHeader": [
              "guardian:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "guardian:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranscriptSummarize"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptSummary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/locations": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "get": {
        "operationId": "getCameraLocations",
        "summary": "Where a camera is on the floor plans",
        "description": "API 1.23.0. Every placement of the camera on the floor plans you can see: the plan, its site and floor, the position (fractions of the image), the direction it faces and a plain-language `description` (\"faces north-east, covers Reception, near the main door\"). Use it to answer \"where is camera X\". An empty list when the camera is on no plan.",
        "tags": [
          "Floor plans"
        ],
        "security": [
          {
            "apiKey": [
              "floorplans:read"
            ]
          },
          {
            "apiKeyHeader": [
              "floorplans:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "floorplans:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The locations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraLocations"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/server": {
      "get": {
        "operationId": "getServer",
        "summary": "Server identity",
        "description": "This server's stable id, name, public address, version, edition, time zone, API version and the optional features it has (`features`, for feature detection). Any valid credential may read it; it holds no secrets. API 1.19.0.",
        "tags": [
          "Me"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The server.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Server"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/alerts/summary": {
      "get": {
        "operationId": "getAlertSummary",
        "summary": "Unacknowledged alert counts",
        "description": "Counts of the unacknowledged alerts on the cameras the caller may view, in total, by severity and by camera, with the newest one's time and id (poll this to notice new alerts cheaply). Alerts with no camera count for admins only. API 1.19.0.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "apiKey": [
              "alerts:read"
            ]
          },
          {
            "apiKeyHeader": [
              "alerts:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "alerts:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertSummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/stream-url": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "createCameraStreamUrl",
        "summary": "Live video link",
        "description": "A short-lived signed link to the camera's live video as HLS (`hls_url`, relative to the server's base URL), for players that cannot send an API key (Home Assistant, VLC, a browser `<video>`). The link carries no credential: it is valid until `expires_at` (`ttl_seconds`, 60–3600, default 600) and ends at once when the key that made it is revoked or expires, its user is disabled, or the user loses the camera. Ask for a new link before it expires. `quality`: `main` (default) or `sub` (the camera's substream, when it has one); `format`: `mpegts` (default) or `fmp4` (needed for H.265). Never exposes the camera's address or credentials: the server proxies its own stream. `rtsp_url` and `webrtc` are null (not offered to third parties). No live stream on this server is `503 stream_unavailable`. 60 links a minute per credential; each is audited. API 1.19.0.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-read-only": true,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StreamURLRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamURL"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/snapshot-url": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "createCameraSnapshotUrl",
        "summary": "Snapshot link",
        "description": "A short-lived signed link to the camera's live snapshot (JPEG), for clients that show images without sending an API key (notifications, dashboards). Same rules as the live video link. Events carry such links too (`data.snapshot_url`). API 1.19.0.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-read-only": true,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaURLRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaURL"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/cameras/{camera_id}/actions/speak": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CameraId"
        }
      ],
      "post": {
        "operationId": "speakOnCamera",
        "summary": "Speak through a camera",
        "description": "Says `text` aloud (text to speech) through this camera's own speaker output (Settings → Speakers), played by the server or by the camera's vigiora-client; no room needed. `volume` 0–1 (default: the output's). Needs the admin or operator role and operator permission on the camera. A camera with no speaker output is `404 not_found`; when the speaker check found no audio backchannel, `422 speaker_not_supported`; a speaker that refused or did not answer is `502 ptz_failed`. 12 a minute per credential; audited. API 1.19.0.",
        "tags": [
          "Cameras"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:control"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:control"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:control"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "operator",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CameraSpeak"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Spoken.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CameraSpeakResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/media/{media_token}/stream.m3u8": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MediaToken"
        }
      ],
      "get": {
        "operationId": "getMediaStream",
        "summary": "Signed live video (HLS)",
        "description": "The HLS master playlist of a live video link (`createCameraStreamUrl`). No credential: the link authorizes it, and is checked again on every request (expiry, its key, the camera permission). Its playlist and segments follow below `hls/`. An invalid, expired or revoked link is `404`. API 1.19.0.",
        "tags": [
          "Media"
        ],
        "security": [],
        "x-vigiora-scopes": [],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-mcp": false,
        "responses": {
          "200": {
            "description": "HLS playlist.",
            "content": {
              "application/vnd.apple.mpegurl": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/media/{media_token}/hls/{hls_file}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MediaToken"
        },
        {
          "name": "hls_file",
          "in": "path",
          "required": true,
          "description": "`playlist.m3u8`, `segment.ts`, `init.mp4` or `segment.m4s`, as the playlists name them.",
          "schema": {
            "type": "string",
            "enum": [
              "playlist.m3u8",
              "segment.ts",
              "init.mp4",
              "segment.m4s"
            ]
          }
        },
        {
          "name": "id",
          "in": "query",
          "description": "The HLS session id (from the playlist).",
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "n",
          "in": "query",
          "description": "The segment number (from the playlist).",
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getMediaStreamFile",
        "summary": "Signed live video (HLS files)",
        "description": "A media playlist, init segment or segment of a live video link. API 1.19.0.",
        "tags": [
          "Media"
        ],
        "security": [],
        "x-vigiora-scopes": [],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-mcp": false,
        "responses": {
          "200": {
            "description": "Playlist or media segment.",
            "content": {
              "application/vnd.apple.mpegurl": {
                "schema": {
                  "type": "string"
                }
              },
              "video/mp2t": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/media/{media_token}/image": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MediaToken"
        }
      ],
      "get": {
        "operationId": "getMediaImage",
        "summary": "Signed image",
        "description": "The image of a snapshot link: a camera's live snapshot (`createCameraSnapshotUrl`, `snapshot_url` of `motion.started`, `presence.changed` and `camera.online`), an alert's snapshot (`alert.created`) or a Guardian entry's frame (`guardian.event`). No credential: the link authorizes it and is checked again on every request. An invalid, expired or revoked link is `404`. API 1.19.0.",
        "tags": [
          "Media"
        ],
        "security": [],
        "x-vigiora-scopes": [],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-mcp": false,
        "responses": {
          "200": {
            "description": "JPEG image.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/thing-capabilities": {
      "get": {
        "operationId": "getThingCapabilities",
        "summary": "Things capability catalogue",
        "description": "The closed, versioned vocabulary of the Things model (see Things): device kinds, and for each capability its state schema, its commands (the operation each runs, the scope and roles it needs, its human-in-the-loop class) and its events (types in the `vigiora.<capability>.<event>` envelope). API 1.18.0.",
        "tags": [
          "Things"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The catalogue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThingsCatalog"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/things": {
      "get": {
        "operationId": "listThings",
        "summary": "List things",
        "description": "The server, cameras, microphones, speakers, rooms and Analytics areas the caller may see, each with its capabilities and their current state. Built from the other operations as the caller: what the key's scopes and the user's role and camera permissions allow (speakers need the admin or operator role, areas `analytics:read`, alert counts `alerts:read`). Not paged: every thing is on the one page (`next_cursor` is always null). `?kind=` filters by kind. API 1.18.0.",
        "tags": [
          "Things"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "server",
                "camera",
                "microphone",
                "speaker",
                "room",
                "area"
              ]
            }
          }
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The things.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThingList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/things/{thing_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ThingId"
        }
      ],
      "get": {
        "operationId": "getThing",
        "summary": "Get a thing",
        "description": "One thing with its capabilities and current state. API 1.18.0.",
        "tags": [
          "Things"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The thing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thing"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/things/{thing_id}/commands/{command_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ThingId"
        },
        {
          "name": "command_id",
          "in": "path",
          "required": true,
          "description": "`<capability>.<command>`, one of the thing's `capabilities[].commands` (e.g. `speak.say`).",
          "schema": {
            "type": "string",
            "maxLength": 64
          }
        }
      ],
      "post": {
        "operationId": "runThingCommand",
        "summary": "Run a command on a thing",
        "description": "Runs the one existing operation behind the command (`GET /thing-capabilities` names it) with the command's params as its body, as the caller: that operation's validation, scope, role, camera permission, rate limits and audit apply, and its errors are answered unchanged. The body is the command's params (an object; empty for none). Not an MCP tool: AI agents use the operations themselves, where human in the loop applies (a command's `hitl` class says which need the user's approval). API 1.18.0.",
        "tags": [
          "Things"
        ],
        "security": [
          {
            "apiKey": [
              "cameras:read"
            ]
          },
          {
            "apiKeyHeader": [
              "cameras:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "cameras:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-mcp": false,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The command's params (its params_schema)."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The operation's result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThingCommandResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/LimitReached"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/items": {
      "get": {
        "operationId": "listLibraryItems",
        "summary": "List saved pictures and clips",
        "description": "The media library's items you may see: those of the cameras you may view (admins and operators also see items without a camera). `folder` lists one folder (`\"\"` = the top level), with `recursive=true` also the folders inside it; without `folder`, every folder. `album_id` lists an album's items, in album order unless `sort` is given. `q` searches the name, camera name, note and folder. `from` / `to` filter on `captured_at` (else the save time). API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "folder",
            "in": "query",
            "description": "A folder path (`\"\"` = the top level).",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "recursive",
            "in": "query",
            "description": "Also the folders inside `folder`.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Text in the name, camera name, note or folder.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "camera_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "image",
                "clip"
              ]
            }
          },
          {
            "name": "album_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "created_at",
                "captured_at",
                "name",
                "size"
              ],
              "default": "created_at"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryItemPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createLibraryItem",
        "summary": "Save a clip export in the library",
        "description": "Copies a ready clip export (`POST /api/v1/clips`) into the media library on the server, so it is kept after the export expires: no upload. The clip must be yours (admins: any) and its camera viewable. `name` defaults to the clip's download name, `folder` to the top level; `album_ids` adds it to albums. `409 clip_not_ready` while the export runs; `507 disk_low` when saving would take the disk below the free-space floor clip exports keep. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryItemCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The saved item.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "507": {
            "$ref": "#/components/responses/InsufficientStorage"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/uploads": {
      "post": {
        "operationId": "uploadLibraryItem",
        "summary": "Upload a picture or clip to the library",
        "description": "Saves an uploaded file as a new library item: a JPEG, PNG or WebP picture of at most 20 MB and 40 megapixels, or an MP4 or WebM clip of at most 200 MB (the type is read from the file, not trusted from the request). Send `multipart/form-data` with the fields first and the `file` part last (a field after the file is a `400`). The server makes a thumbnail. `camera_id` (optional) ties the item to a camera you may view (viewers then see it); without one only admins and operators see it. `507 disk_low` when saving would take the disk below the free-space floor. Not served through a Cloudflare Tunnel origin (media goes to the media origin). Not an MCP tool. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-mcp": false,
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/LibraryUpload"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The saved item.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "507": {
            "$ref": "#/components/responses/InsufficientStorage"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/items/{item_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LibraryItemId"
        }
      ],
      "get": {
        "operationId": "getLibraryItem",
        "summary": "Get a saved item",
        "description": "One library item. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The item.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryItem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateLibraryItem",
        "summary": "Rename, move or annotate a saved item",
        "description": "Changes the item's `name`, `folder` (moving it; the folder need not exist yet), `note` or `tags`. Folder paths are names joined by `/`: no leading `/`, no `.` or `..` names, no `\\` or control characters, at most 8 levels, 80 characters a name and 255 in all. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryItemUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The item.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteLibraryItem",
        "summary": "Delete a saved item",
        "description": "Deletes the item's file, its places in albums and its public links. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/items/{item_id}/media": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LibraryItemId"
        }
      ],
      "get": {
        "operationId": "getLibraryItemMedia",
        "summary": "Get a saved item's file",
        "description": "The picture or clip (Range requests supported). `download=true` answers it as an attachment named after the item. Not served through a Cloudflare Tunnel origin (media is served by the media origin). Not an MCP tool. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "x-vigiora-mcp": false,
        "parameters": [
          {
            "name": "download",
            "in": "query",
            "description": "Answer as an attachment.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/webm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/items/{item_id}/thumbnail": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LibraryItemId"
        }
      ],
      "get": {
        "operationId": "getLibraryItemThumbnail",
        "summary": "Get a saved item's thumbnail",
        "description": "A JPEG at most 320 px wide (`thumbnail_url` is `null` when the item has none, e.g. a clip saved while ffmpeg was missing). Not served through a Cloudflare Tunnel origin. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "JPEG image.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/items/{item_id}/shares": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LibraryItemId"
        }
      ],
      "post": {
        "operationId": "createLibraryItemShare",
        "summary": "Create a public link to a saved item",
        "description": "A public link anyone can open without signing in (`/s/<token>`): a picture opens as itself, a clip in a player page. It expires after `expires_in` (default 24h), can be revoked (`DELETE /shares/{share_id}`) and stops working when the item is deleted or you may no longer see it. The URL is returned only here. Needs `clips:share`. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "clips:share"
            ]
          },
          {
            "apiKeyHeader": [
              "clips:share"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "clips:share"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-camera-permission": "viewer",
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryShareCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryShare"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/folders": {
      "get": {
        "operationId": "listLibraryFolders",
        "summary": "List library folders",
        "description": "Every folder: those created explicitly (empty ones too) and those holding items, with their parent folders. `items` and `size_bytes` count the items directly in a folder that you see. Viewers see only the folders on the way to items they see. One page; `next_cursor` is always `null`. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The folders.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryFolderPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createLibraryFolder",
        "summary": "Create a library folder",
        "description": "Creates an empty folder (`409 conflict` when it exists). Path rules as for items. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryFolderCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The folder.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryFolder"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/folders/actions/move": {
      "post": {
        "operationId": "moveLibraryFolder",
        "summary": "Rename or move a library folder",
        "description": "Renames `path` to `new_path` (which may be under another folder), with every folder and item inside it. `409 conflict` when `new_path` exists; a folder cannot move into itself. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryFolderMove"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Moved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryFolderMoved"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/folders/actions/delete": {
      "post": {
        "operationId": "deleteLibraryFolder",
        "summary": "Delete an empty library folder",
        "description": "Deletes a folder that holds no item at any depth (and the empty folders inside it); `409 conflict` otherwise. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryFolderCreate"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/albums": {
      "get": {
        "operationId": "listLibraryAlbums",
        "summary": "List albums",
        "description": "Albums: ordered lists of library items (an item is stored once and can be in many albums). The counts are of the items you see; viewers see the albums holding at least one. One page; `next_cursor` is always `null`. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The albums.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryAlbumPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createLibraryAlbum",
        "summary": "Create an album",
        "description": "Creates an album, optionally with items in order. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryAlbumCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The album.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryAlbum"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/albums/{album_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LibraryAlbumId"
        }
      ],
      "get": {
        "operationId": "getLibraryAlbum",
        "summary": "Get an album with its items",
        "description": "The album and its items you see, in album order (`position`; at most 500). API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator",
          "viewer"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The album.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryAlbumDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateLibraryAlbum",
        "summary": "Rename an album or change its cover",
        "description": "Changes `name`, `note` or `cover_item_id` (an item of the album; `null` = the first item). Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryAlbumUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The album.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryAlbum"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteLibraryAlbum",
        "summary": "Delete an album",
        "description": "Deletes the album and its links; its items stay in the library. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "x-vigiora-confirm": true,
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/albums/{album_id}/actions/add-items": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LibraryAlbumId"
        }
      ],
      "post": {
        "operationId": "addLibraryAlbumItems",
        "summary": "Add items to an album",
        "description": "Appends items (that you see) at the end of the album, in order; items already in it stay where they are. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryAlbumItems"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The album.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryAlbum"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/albums/{album_id}/actions/remove-items": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LibraryAlbumId"
        }
      ],
      "post": {
        "operationId": "removeLibraryAlbumItems",
        "summary": "Remove items from an album",
        "description": "Takes items off the album; they stay in the library. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryAlbumItems"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The album.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryAlbum"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/albums/{album_id}/actions/reorder": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LibraryAlbumId"
        }
      ],
      "post": {
        "operationId": "reorderLibraryAlbum",
        "summary": "Reorder an album",
        "description": "Puts the listed items (distinct items of the album) first, in that order; the others follow in their current order. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:write"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:write"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:write"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryAlbumItems"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The album.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryAlbum"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/albums/{album_id}/shares": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LibraryAlbumId"
        }
      ],
      "post": {
        "operationId": "createLibraryAlbumShare",
        "summary": "Create a public link to an album",
        "description": "A public page (`/s/<token>`) with the album's items in order: clips as players, pictures as thumbnails that open the picture. It shows the items you (its creator) see when it is opened, expires after `expires_in` (default 24h) and can be revoked (`DELETE /shares/{share_id}`). The URL is returned only here. Needs `clips:share`. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "clips:share"
            ]
          },
          {
            "apiKeyHeader": [
              "clips:share"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "clips:share"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": "unsupported",
        "x-vigiora-confirm": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryShareCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryShare"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/library/stats": {
      "get": {
        "operationId": "getLibraryStats",
        "summary": "Library storage use",
        "description": "How many items the whole library holds and their size, with the free space of its disk and the floor saves keep free. Admins and operators. API 1.52.0.",
        "tags": [
          "Library"
        ],
        "security": [
          {
            "apiKey": [
              "recordings:read"
            ]
          },
          {
            "apiKeyHeader": [
              "recordings:read"
            ]
          },
          {
            "bearerJwt": []
          }
        ],
        "x-vigiora-scopes": [
          "recordings:read"
        ],
        "x-vigiora-roles": [
          "admin",
          "operator"
        ],
        "x-vigiora-idempotent": false,
        "responses": {
          "200": {
            "description": "The figures.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryStats"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "vgk_<key_id>_<secret>",
        "description": "API key as `Authorization: Bearer vgk_…`."
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "API key in the X-API-Key header. Takes precedence over Authorization."
      },
      "bearerJwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "User session access token from `POST /api/auth/login`."
      }
    },
    "parameters": {
      "RobotPlaceId": {
        "name": "place_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        },
        "description": "A place of the robot (Robot navigation)."
      },
      "RobotKeyframeId": {
        "name": "keyframe_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        },
        "description": "A learned view of the robot."
      },
      "ThingId": {
        "name": "thing_id",
        "in": "path",
        "required": true,
        "description": "A thing id: `server`, `camera:12`, `microphone:4`, `speaker:3`, `room:2`, `area:1`.",
        "schema": {
          "type": "string",
          "maxLength": 64
        }
      },
      "EntityId": {
        "name": "entity_id",
        "in": "path",
        "required": true,
        "description": "A Home Assistant device key: the entity id for instance 1 (`light.porch`, `notify.mobile_app_pixel`), `<instance_id>:<entity_id>` for another instance (`2:light.porch`, API 1.29.0).",
        "schema": {
          "type": "string",
          "pattern": "^([1-9][0-9]*:)?[a-z_][a-z0-9_]*\\.[a-z0-9_]+$"
        }
      },
      "BridgeEntityId": {
        "name": "entity_id",
        "in": "path",
        "required": true,
        "description": "A Home Assistant entity id of the instance (`light.porch`).",
        "schema": {
          "type": "string",
          "pattern": "^[a-z_][a-z0-9_]*\\.[a-z0-9_]+$"
        }
      },
      "InstanceId": {
        "name": "instance_id",
        "in": "path",
        "required": true,
        "description": "A Home Assistant instance id.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "TriggerId": {
        "name": "trigger_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "GuardianPendingId": {
        "name": "pending_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[0-9a-f]{32}$"
        }
      },
      "PendingId": {
        "name": "pending_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[0-9a-f]{24}$"
        }
      },
      "ZigbeeIEEE": {
        "name": "zigbee_device_id",
        "in": "path",
        "required": true,
        "description": "A Zigbee device address (eight hex pairs, `00:12:4b:00:1c:a1:b2:c3`).",
        "schema": {
          "type": "string",
          "pattern": "^([0-9a-fA-F]{2}:){7}[0-9a-fA-F]{2}$"
        }
      },
      "IoTDeviceKey": {
        "name": "iot_device_id",
        "in": "path",
        "required": true,
        "description": "An IoT device key: `<instance id>:<Home Assistant device id>`, or `<instance id>:<entity id>` for an entity without a device.",
        "schema": {
          "type": "string",
          "maxLength": 200,
          "pattern": "^[1-9][0-9]*:.+$"
        }
      },
      "BluetoothAddress": {
        "name": "bluetooth_device_id",
        "in": "path",
        "required": true,
        "description": "A Bluetooth device address (`AA:BB:CC:DD:EE:FF`, any case).",
        "schema": {
          "type": "string",
          "pattern": "^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$"
        }
      },
      "MediaToken": {
        "name": "media_token",
        "in": "path",
        "required": true,
        "description": "The signed link token (opaque; from a stream-url or snapshot-url answer, or an event).",
        "schema": {
          "type": "string",
          "maxLength": 1024
        }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "description": "Page size, 1–200.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200,
          "default": 50
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "description": "`next_cursor` of the previous page.",
        "schema": {
          "type": "string"
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "description": "Makes a retry of this request safe (see Idempotency).",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "AddonId": {
        "name": "addon_id",
        "in": "path",
        "required": true,
        "description": "The add-on's id (its manifest id).",
        "schema": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{2,39}$"
        }
      },
      "CameraId": {
        "name": "camera_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "PrivacyMaskId": {
        "name": "mask_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "MotionZoneId": {
        "name": "zone_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "AlertId": {
        "name": "alert_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "RecordingId": {
        "name": "recording_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "LibraryItemId": {
        "name": "item_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "LibraryAlbumId": {
        "name": "album_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "ClipId": {
        "name": "clip_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "ShareId": {
        "name": "share_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "LiveShareId": {
        "name": "live_share_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "KeyId": {
        "name": "key_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "AutomationId": {
        "name": "automation_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "WebhookId": {
        "name": "webhook_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "ClientErrorId": {
        "name": "client_error_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "DeliveryId": {
        "name": "delivery_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "SiteId": {
        "name": "site_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "RoomId": {
        "name": "room_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "LayoutId": {
        "name": "layout_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "EntryId": {
        "name": "entry_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "FactId": {
        "name": "fact_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "UserId": {
        "name": "user_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "SessionId": {
        "name": "session_id",
        "in": "path",
        "required": true,
        "description": "A signed-in device's id (GET /account/sessions).",
        "schema": {
          "type": "string",
          "pattern": "^[0-9a-f]{32}$"
        }
      },
      "FaceId": {
        "name": "face_id",
        "in": "path",
        "required": true,
        "description": "A face id (enrolled faces), or `det-<alert id>` for a pending face.",
        "schema": {
          "type": "string",
          "maxLength": 64
        }
      },
      "PresetToken": {
        "name": "preset_token",
        "in": "path",
        "required": true,
        "description": "The preset's `token`.",
        "schema": {
          "type": "string",
          "maxLength": 64
        }
      },
      "AlertRuleId": {
        "name": "alert_rule_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "LabelAlertRuleId": {
        "name": "label_alert_rule_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "MotionRuleId": {
        "name": "motion_rule_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "WalkthroughId": {
        "name": "walkthrough_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "UploadId": {
        "name": "upload_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[0-9a-f]{24}$"
        }
      },
      "FloorPlanId": {
        "name": "floor_plan_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "ViewId": {
        "name": "view_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "AnalyticsAreaId": {
        "name": "analytics_area_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "AnalyticsLineId": {
        "name": "analytics_line_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "AnalyticsZoneId": {
        "name": "analytics_zone_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "AnalyticsCameraFilter": {
        "name": "camera_id",
        "in": "query",
        "description": "Only this camera's.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "AnalyticsFrom": {
        "name": "from",
        "in": "query",
        "description": "Start: RFC 3339, or a local time without an offset (`2026-11-02T09:00`, `2026-11-02`) in the server's time zone. Required unless `period` is given.",
        "schema": {
          "type": "string"
        }
      },
      "AnalyticsTo": {
        "name": "to",
        "in": "query",
        "description": "End (exclusive), as `from`; default now. At most 400 days after `from`.",
        "schema": {
          "type": "string"
        }
      },
      "AnalyticsPeriod": {
        "name": "period",
        "in": "query",
        "description": "A named period in the server's time zone, instead of `from` and `to`: `today` and `this_week` (from Monday) and `this_month` until now, `yesterday`, or `last_7_days`.",
        "schema": {
          "type": "string",
          "enum": [
            "today",
            "yesterday",
            "this_week",
            "last_7_days",
            "this_month"
          ]
        }
      },
      "AnalyticsClass": {
        "name": "class",
        "in": "query",
        "description": "The class counted (default `person`); `all` counts every class.",
        "schema": {
          "type": "string",
          "enum": [
            "person",
            "car",
            "truck",
            "bus",
            "motorbike",
            "bicycle",
            "all"
          ]
        }
      },
      "AnalyticsStep": {
        "name": "step",
        "in": "query",
        "description": "Adds a series with one point per step (`15m` for periods up to 7 days).",
        "schema": {
          "type": "string",
          "enum": [
            "15m",
            "1h",
            "1d"
          ]
        }
      },
      "AnalyticsPathLimit": {
        "name": "limit",
        "in": "query",
        "description": "The newest tracks to use (1–500, default 200).",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500
        }
      },
      "AnalyticsAlertRuleId": {
        "name": "analytics_alert_rule_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "AnalyticsDisplayId": {
        "name": "analytics_display_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "AiServiceId": {
        "name": "ai_service_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "maxLength": 64,
          "description": "The service name (`core-ai`, `motion-detect`, `hal-video`, `hal-audio`, `hal-live`, …). API 1.36.1 renamed\nthe three AI add-ons from `gemini-video` / `gemini-audio` / `gemini-live`; the old names are still accepted\nhere, and responses carry the new ones.\n"
        }
      },
      "GroupId": {
        "name": "group_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "LayoutSequenceId": {
        "name": "layout_sequence_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "OutputId": {
        "name": "output_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "AutoActionId": {
        "name": "auto_action_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "ClientId": {
        "name": "client_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "maxLength": 128
        }
      },
      "BriefingItemToken": {
        "name": "briefing_item_token",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "maxLength": 64,
          "pattern": "^[a-z]{1,8}:[a-z0-9_:-]{1,64}$",
          "description": "A Briefing item id from the Briefing (`d:123` an alert, `g:45` a Guardian entry, …)."
        }
      },
      "ConversationId": {
        "name": "conversation_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "AiLiveSessionId": {
        "name": "ai_live_session_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "ConnectedAppId": {
        "name": "connected_app_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "AiServiceInstanceId": {
        "name": "ai_service_instance_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "ToolId": {
        "name": "tool_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "Lang": {
        "name": "lang",
        "in": "query",
        "description": "Language of AI-written texts (ISO-639-1, e.g. `th`); default the `Accept-Language` header's first tag, else English (texts without that language fall back to English).",
        "schema": {
          "type": "string",
          "pattern": "^[a-z]{2}$"
        }
      }
    },
    "headers": {
      "RateLimitLimit": {
        "description": "Bucket capacity of this credential.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitRemaining": {
        "description": "Requests left in the bucket.",
        "schema": {
          "type": "integer"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before retrying.",
        "schema": {
          "type": "integer"
        }
      },
      "Location": {
        "description": "URL path of the created resource.",
        "schema": {
          "type": "string"
        }
      },
      "ContentDisposition": {
        "description": "`attachment; filename=\"vigiora-config.json\"`.",
        "schema": {
          "type": "string"
        }
      },
      "FrameTime": {
        "description": "The time of the frame returned (RFC 3339, UTC).",
        "schema": {
          "type": "string"
        }
      },
      "FrameDisposition": {
        "description": "`attachment; filename=\"<camera>-<time>.jpg\"` with `download=true`.",
        "schema": {
          "type": "string"
        }
      }
    },
    "requestBodies": {
      "EmptyAction": {
        "description": "No parameters; send no body or `{}`.",
        "required": false,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Empty"
            }
          }
        }
      }
    },
    "responses": {
      "Error": {
        "description": "Error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "BadRequest": {
        "description": "Invalid request (`validation_error`, `invalid_cursor`, `idempotency_not_supported`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "No valid credential (`unauthenticated`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "`insufficient_scope`, `forbidden` (role or camera permission) or `api_key_not_allowed`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "No such resource, or not visible to you (`not_found`); no footage at that time (`no_recording`); a recording without scrubbing pictures (`no_preview`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Conflict": {
        "description": "State conflict (`conflict`, `idempotency_key_in_progress`, `dependency_not_met`, `dependent_service_assigned`, `clip_not_ready`, `clip_too_old`, `ptz_not_supported`, `not_a_robot`, `light_unsupported`, `robot_unsupported`, `robot_busy`, `ble_unsupported`, `battery_low`, `onvif_disabled`, `ptz_busy`, `protect_limit`, `ai_not_enabled`, `network_unavailable`, `scan_in_progress`, `entry_protected`, `entry_shared`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unprocessable": {
        "description": "`idempotency_key_reused`, `clip_too_long`, `clip_no_recordings`, `timelapse_too_long`, `timelapse_too_short`, `speaker_not_supported` (a camera with no siren Vigiora can sound, API 1.105.0).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "LimitReached": {
        "description": "Plan limit reached (`limit_reached`) or out of AI credits (`insufficient_credits`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Too many requests (`rate_limited`, `clip_busy`, `clip_user_busy`, `timelapse_busy`, `relay_limit`, `stream_limit`).",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "BadGateway": {
        "description": "The camera refused or did not answer (`ptz_failed`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unavailable": {
        "description": "Feature unavailable (`ptz_unavailable`, `addon_offline`, `snapshot_unavailable`, `service_unavailable`, `capture_failed`, `ai_unavailable`, `network_busy`, `no_detector`, `preview_busy` (with `Retry-After`), `preview_unavailable`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "DetectorFailed": {
        "description": "The object recognition runner failed on the frame (`detector_failed`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "DetectorTimeout": {
        "description": "The object recognition runner did not answer in time (`detector_timeout`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "The body is over the operation's limit (`payload_too_large`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "UnsupportedMediaType": {
        "description": "The body is not JSON (`unsupported_media_type`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InsufficientStorage": {
        "description": "Not enough disk or clip quota (`clip_no_space`, `clip_quota`, `disk_low`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Empty": {
        "type": "object",
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message",
              "details"
            ],
            "properties": {
              "code": {
                "$ref": "#/components/schemas/ErrorCode"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "description": "Code-specific extra data (possibly empty)."
              }
            }
          }
        }
      },
      "ErrorCode": {
        "type": "string",
        "description": "Stable error code. New codes may be added within v1. `confirmation_required` and `user_declined` are MCP tool errors only (human in the loop); REST never answers them.",
        "enum": [
          "validation_error",
          "invalid_cursor",
          "idempotency_not_supported",
          "unauthenticated",
          "insufficient_scope",
          "forbidden",
          "api_key_not_allowed",
          "not_found",
          "method_not_allowed",
          "conflict",
          "idempotency_key_in_progress",
          "idempotency_key_reused",
          "dependency_not_met",
          "dependent_service_assigned",
          "limit_reached",
          "payload_too_large",
          "unsupported_media_type",
          "rate_limited",
          "relay_limit",
          "stream_limit",
          "protect_limit",
          "disk_low",
          "ptz_failed",
          "ptz_not_supported",
          "not_a_robot",
          "light_unsupported",
          "robot_unsupported",
          "robot_busy",
          "ble_unsupported",
          "battery_low",
          "ptz_busy",
          "ptz_unavailable",
          "addon_offline",
          "onvif_disabled",
          "snapshot_unavailable",
          "service_unavailable",
          "clip_too_long",
          "clip_no_recordings",
          "clip_busy",
          "clip_user_busy",
          "clip_no_space",
          "clip_quota",
          "clip_not_ready",
          "clip_too_old",
          "timelapse_busy",
          "timelapse_too_long",
          "timelapse_too_short",
          "ai_not_enabled",
          "capture_failed",
          "ai_unavailable",
          "insufficient_credits",
          "network_unavailable",
          "scan_in_progress",
          "network_busy",
          "bluetooth_unavailable",
          "no_recording",
          "no_preview",
          "preview_busy",
          "preview_unavailable",
          "no_detector",
          "detector_timeout",
          "detector_failed",
          "stream_unavailable",
          "speaker_not_supported",
          "entry_protected",
          "entry_shared",
          "device_failed",
          "confirmation_required",
          "user_declined",
          "internal_error"
        ]
      },
      "Scope": {
        "type": "string",
        "enum": [
          "cameras:read",
          "cameras:write",
          "cameras:control",
          "alerts:read",
          "alerts:write",
          "analytics:read",
          "analytics:write",
          "floorplans:read",
          "floorplans:write",
          "recordings:read",
          "recordings:write",
          "clips:share",
          "guardian:read",
          "guardian:write",
          "memory:read",
          "memory:write",
          "account:read",
          "account:write",
          "settings:read",
          "settings:write",
          "users:read",
          "users:write",
          "events:read",
          "webhooks:read",
          "webhooks:write",
          "network:read",
          "devices:read",
          "devices:write",
          "devices:control",
          "admin"
        ]
      },
      "Me": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "user",
          "auth"
        ],
        "properties": {
          "user": {
            "$ref": "#/components/schemas/MeUser"
          },
          "auth": {
            "$ref": "#/components/schemas/MeAuth"
          }
        }
      },
      "MeUser": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "username",
          "role"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "username": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "operator",
              "viewer"
            ]
          }
        }
      },
      "MeAuth": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "key_id",
          "scoped",
          "scopes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "api_key",
              "session",
              "oauth"
            ],
            "description": "`oauth` is an OAuth access token, accepted by the MCP endpoint only."
          },
          "key_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The API key's id (`null` for a session or an OAuth token)."
          },
          "scoped": {
            "type": "boolean",
            "description": "`false` for a session and for a legacy key (implicit scopes)."
          },
          "scopes": {
            "type": [
              "array",
              "null"
            ],
            "description": "Effective scopes; `null` for a session (all scopes).",
            "items": {
              "$ref": "#/components/schemas/Scope"
            }
          }
        }
      },
      "Camera": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "enabled",
          "status",
          "source_type",
          "connection_type",
          "stream_url",
          "width",
          "height",
          "fps",
          "recording_enabled",
          "retention_days",
          "ai_enabled",
          "ai_guardian_enabled",
          "ai_live_enabled",
          "has_ptz",
          "has_speaker",
          "has_audio",
          "site_id",
          "client_id",
          "client_name",
          "client_status",
          "tags",
          "created_at",
          "updated_at",
          "sub_stream_name",
          "record_sub_stream",
          "record_hd_on_motion",
          "onvif_url",
          "hardware_id",
          "audio_monitoring_enabled",
          "wake_word_enabled",
          "ptz_manual",
          "ptz_zoom",
          "onvif_enabled",
          "sort_order",
          "brand",
          "model",
          "brand_source",
          "body_type",
          "ai_guardian_prompt",
          "ai_live_env",
          "stt_languages",
          "stt_prompt",
          "lat",
          "lon",
          "source_error",
          "ai_services",
          "warnings",
          "guardian_use_detections",
          "guardian_use_detections_set",
          "guardian_clip_preroll_sec",
          "talk",
          "speaker"
        ],
        "properties": {
          "speaker": {
            "$ref": "#/components/schemas/CameraSpeaker"
          },
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "description": "`online`: frames flowing (someone is watching, or the recorder wrote a segment in the last 90 s); `offline`: recording is on but no segment for 90 s and no live stream, or (not recording) the camera's stream port does not answer the server's periodic TCP check; `standby`: not recording and nobody watching (the stream is pulled on demand, so nothing flows; not a fault); `disabled`; `unknown`: not probed (audio-only and iframe cameras, the stream server is unreachable, or the stored source is refused: see `source_error`); `paused` (API 1.124.0): a robot switched its camera off on purpose (Bluetooth scan), not a fault. `camera.online` / `camera.offline` events follow `online` ↔ `offline`; `standby` and `paused` ↔ `online` emit nothing. Open enum.",
            "enum": [
              "online",
              "offline",
              "standby",
              "paused",
              "disabled",
              "unknown"
            ]
          },
          "source_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "rtsp, iframe, usb_audio, youtube, replay, … (open set)."
          },
          "connection_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "local, remote (vigiora-client), … (open set)."
          },
          "stream_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Camera URL. Credentials (URL userinfo, credential query parameters) are always replaced by `REDACTED`, for sessions and keys alike. Sending a URL with the markers back in `PATCH` keeps the stored credentials."
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "fps": {
            "type": [
              "integer",
              "null"
            ]
          },
          "recording_enabled": {
            "type": "boolean"
          },
          "retention_days": {
            "type": [
              "integer",
              "null"
            ],
            "description": "`null`: the server default."
          },
          "ai_enabled": {
            "type": "boolean",
            "description": "The per-camera AI switch (detections, alerts, Guardian)."
          },
          "ai_guardian_enabled": {
            "type": "boolean"
          },
          "ai_live_enabled": {
            "type": "boolean"
          },
          "has_ptz": {
            "type": "boolean",
            "description": "The camera pans/tilts/zooms here; `false` while `onvif_enabled` is off and its PTZ needs ONVIF."
          },
          "has_speaker": {
            "type": "boolean"
          },
          "talk": {
            "$ref": "#/components/schemas/CameraTalk"
          },
          "has_audio": {
            "type": "boolean"
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The vigiora-client relaying the camera (`null` for cameras on this server's network)."
          },
          "client_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "client_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sub_stream_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The go2rtc name of the camera's sub (low-resolution) stream, when set."
          },
          "record_sub_stream": {
            "type": "boolean",
            "description": "Record the sub stream instead of the main one."
          },
          "record_hd_on_motion": {
            "type": "boolean",
            "description": "Also keep the main (HD) stream while there is movement: with `record_sub_stream` on, the camera records its sub stream all the time and saves an HD clip of every period with movement (from about 10 seconds before it to 20 seconds after), listed by `GET /api/v1/cameras/{camera_id}/hd-recordings`. Without `record_sub_stream` it does nothing (the recording is the main stream already). API 1.100.0."
          },
          "onvif_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The ONVIF address PTZ uses (credentials `REDACTED`), set by hand or found by detection."
          },
          "hardware_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The camera's MAC address, learned while its stream works (camera following finds the camera again by it when its IP address changes)."
          },
          "audio_monitoring_enabled": {
            "type": "boolean"
          },
          "wake_word_enabled": {
            "type": "boolean"
          },
          "ptz_manual": {
            "type": "boolean",
            "description": "`has_ptz` was set by hand (automatic PTZ detection leaves it alone)."
          },
          "onvif_enabled": {
            "type": "boolean",
            "description": "\"Use ONVIF\" (default on). Off: Vigiora sends nothing to the camera over ONVIF and asks nobody else to (a camera behind a vigiora-client is not moved by its client either): no PTZ, presets, patrols, camera events, exposure or clock calls over ONVIF. `has_ptz` then reads `false` when the camera's PTZ would be driven over ONVIF (everything but a Hikvision ISAPI camera on this server's network), and PTZ operations answer `409 onvif_disabled`; the stored PTZ setting is kept and comes back when the switch is on again. API 1.101.0."
          },
          "sort_order": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "The camera's place in the Monitors page order (1 = first), one order for the whole server and every user; `null` = never ordered (listed after the ordered cameras). Set with `POST /cameras/actions/reorder`. API 1.102.0."
          },
          "brand": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who made the camera, when known (`Hikvision`, `Reolink` …); `null` = not known yet. The server works it out by itself: it asks cameras on its own network who they are (ONVIF device information when \"Use ONVIF\" is on, else the maker's own API) when they are added and again about daily until they answer; with nothing from the camera, from its network hardware address (`brand_source`). Read-only. API 1.103.0."
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "description": "The camera's model as the camera reports it (`DS-2CD2047G2-LU`); `null` = not known. Read-only. API 1.103.0."
          },
          "brand_source": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "camera",
              "catalog",
              "network",
              "network_module",
              null
            ],
            "description": "Where `brand` comes from: `camera` (the camera said so), `catalog` (the camera catalogue recognised it when it was added), `network` (its network hardware address, MAC prefix, is registered to this brand), `network_module` (the MAC prefix belongs to the maker of the camera's network module, not a camera brand: `brand` is that module maker, not the camera's brand); `null` exactly when `brand` is `null`. API 1.103.0."
          },
          "body_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "bullet",
              "dome",
              "turret",
              "ptz",
              "cube",
              "doorbell",
              "battery",
              "robot",
              null
            ],
            "description": "The shape of the camera's housing, for showing a picture of the kind of camera it is: from the camera catalogue's entry for `model`, else `ptz` for a camera that can be moved; `null` = not known. Read-only. API 1.103.0."
          },
          "ptz_zoom": {
            "type": [
              "string",
              "null"
            ],
            "description": "`optical` or `digital`; `null` = detected."
          },
          "ptz_settle_seconds": {
            "type": [
              "number",
              "null"
            ],
            "description": "API 1.53.0. Motion is ignored while Vigiora moves this camera (joystick, presets, patrols, API, AI tools) and for this many seconds after; `null` = the default, 3 s."
          },
          "ai_guardian_prompt": {
            "type": [
              "string",
              "null"
            ],
            "description": "Extra instructions for the Guardian AI on this camera."
          },
          "ai_live_env": {
            "type": [
              "string",
              "null"
            ],
            "description": "AI Live persona (`retail`, `security`, `reception`, `home`, `custom`)."
          },
          "stt_languages": {
            "type": "array",
            "description": "ISO 639-1 codes speech recognition expects (empty = auto-detect).",
            "items": {
              "type": "string"
            }
          },
          "stt_prompt": {
            "type": [
              "string",
              "null"
            ],
            "description": "Vocabulary hint for speech recognition (names, products)."
          },
          "lat": {
            "type": [
              "number",
              "null"
            ]
          },
          "lon": {
            "type": [
              "number",
              "null"
            ]
          },
          "source_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the camera's stored source is refused (the camera then reports `status` `unknown` and does not stream until its URL is fixed)."
          },
          "guardian_use_detections": {
            "type": "boolean",
            "description": "Guardian descriptions (and alert rules) also get what the camera's object detectors reported in the clip's window, as sensor data the AI checks against the frames (about 100 more prompt tokens, no other AI cost)."
          },
          "guardian_use_detections_set": {
            "type": "boolean",
            "description": "`false`: automatic (on when a Vision Engine detector service is assigned to the camera)."
          },
          "guardian_clip_preroll_sec": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 10,
            "description": "How many seconds before the motion that triggered it the camera's Guardian clip starts. `null` = the server's setting (`/guardian/clips/settings`, default 3). API 1.24.0."
          },
          "ai_services": {
            "type": "array",
            "description": "The AI services switched on for the camera (`GET /cameras/{camera_id}/ai-services`). Since API 1.36.1 the AI add-ons are `hal-video`, `hal-audio` and `hal-live` (before, `gemini-video` / `gemini-audio` / `gemini-live`).",
            "items": {
              "type": "string"
            }
          },
          "warnings": {
            "type": "array",
            "description": "`no_motion_trigger`: AI is on but no motion detection service triggers Guardian on the camera, so it writes no Guardian entries and its video alert rules never fire (enable `motion-detect`). Open set.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CameraAIResult": {
        "type": "object",
        "additionalProperties": false,
        "description": "The camera, and the AI services the call switched on.",
        "required": [
          "id",
          "name",
          "enabled",
          "status",
          "source_type",
          "connection_type",
          "stream_url",
          "width",
          "height",
          "fps",
          "recording_enabled",
          "retention_days",
          "ai_enabled",
          "ai_guardian_enabled",
          "ai_live_enabled",
          "has_ptz",
          "has_speaker",
          "has_audio",
          "site_id",
          "client_id",
          "client_name",
          "client_status",
          "tags",
          "created_at",
          "updated_at",
          "sub_stream_name",
          "record_sub_stream",
          "record_hd_on_motion",
          "onvif_url",
          "hardware_id",
          "audio_monitoring_enabled",
          "wake_word_enabled",
          "ptz_manual",
          "ptz_zoom",
          "onvif_enabled",
          "sort_order",
          "brand",
          "model",
          "brand_source",
          "body_type",
          "ai_guardian_prompt",
          "ai_live_env",
          "stt_languages",
          "stt_prompt",
          "lat",
          "lon",
          "source_error",
          "ai_services",
          "warnings",
          "guardian_use_detections",
          "guardian_use_detections_set",
          "guardian_clip_preroll_sec",
          "services_enabled",
          "talk",
          "speaker"
        ],
        "properties": {
          "speaker": {
            "$ref": "#/components/schemas/CameraSpeaker"
          },
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "description": "`online`: frames flowing (someone is watching, or the recorder wrote a segment in the last 90 s); `offline`: recording is on but no segment for 90 s and no live stream, or (not recording) the camera's stream port does not answer the server's periodic TCP check; `standby`: not recording and nobody watching (the stream is pulled on demand, so nothing flows; not a fault); `disabled`; `unknown`: not probed (audio-only and iframe cameras, the stream server is unreachable, or the stored source is refused: see `source_error`); `paused` (API 1.124.0): a robot switched its camera off on purpose (Bluetooth scan), not a fault. `camera.online` / `camera.offline` events follow `online` ↔ `offline`; `standby` and `paused` ↔ `online` emit nothing. Open enum.",
            "enum": [
              "online",
              "offline",
              "standby",
              "paused",
              "disabled",
              "unknown"
            ]
          },
          "source_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "rtsp, iframe, usb_audio, youtube, replay, … (open set)."
          },
          "connection_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "local, remote (vigiora-client), … (open set)."
          },
          "stream_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Camera URL. Credentials (URL userinfo, credential query parameters) are always replaced by `REDACTED`, for sessions and keys alike. Sending a URL with the markers back in `PATCH` keeps the stored credentials."
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "fps": {
            "type": [
              "integer",
              "null"
            ]
          },
          "recording_enabled": {
            "type": "boolean"
          },
          "retention_days": {
            "type": [
              "integer",
              "null"
            ],
            "description": "`null`: the server default."
          },
          "ai_enabled": {
            "type": "boolean",
            "description": "The per-camera AI switch (detections, alerts, Guardian)."
          },
          "ai_guardian_enabled": {
            "type": "boolean"
          },
          "ai_live_enabled": {
            "type": "boolean"
          },
          "has_ptz": {
            "type": "boolean",
            "description": "The camera pans/tilts/zooms here; `false` while `onvif_enabled` is off and its PTZ needs ONVIF."
          },
          "has_speaker": {
            "type": "boolean"
          },
          "talk": {
            "$ref": "#/components/schemas/CameraTalk"
          },
          "has_audio": {
            "type": "boolean"
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The vigiora-client relaying the camera (`null` for cameras on this server's network)."
          },
          "client_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "client_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sub_stream_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The go2rtc name of the camera's sub (low-resolution) stream, when set."
          },
          "record_sub_stream": {
            "type": "boolean",
            "description": "Record the sub stream instead of the main one."
          },
          "record_hd_on_motion": {
            "type": "boolean",
            "description": "Also keep the main (HD) stream while there is movement: with `record_sub_stream` on, the camera records its sub stream all the time and saves an HD clip of every period with movement (from about 10 seconds before it to 20 seconds after), listed by `GET /api/v1/cameras/{camera_id}/hd-recordings`. Without `record_sub_stream` it does nothing (the recording is the main stream already). API 1.100.0."
          },
          "onvif_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The ONVIF address PTZ uses (credentials `REDACTED`), set by hand or found by detection."
          },
          "hardware_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The camera's MAC address, learned while its stream works (camera following finds the camera again by it when its IP address changes)."
          },
          "audio_monitoring_enabled": {
            "type": "boolean"
          },
          "wake_word_enabled": {
            "type": "boolean"
          },
          "ptz_manual": {
            "type": "boolean",
            "description": "`has_ptz` was set by hand (automatic PTZ detection leaves it alone)."
          },
          "onvif_enabled": {
            "type": "boolean",
            "description": "\"Use ONVIF\" (default on). Off: Vigiora sends nothing to the camera over ONVIF and asks nobody else to (a camera behind a vigiora-client is not moved by its client either): no PTZ, presets, patrols, camera events, exposure or clock calls over ONVIF. `has_ptz` then reads `false` when the camera's PTZ would be driven over ONVIF (everything but a Hikvision ISAPI camera on this server's network), and PTZ operations answer `409 onvif_disabled`; the stored PTZ setting is kept and comes back when the switch is on again. API 1.101.0."
          },
          "sort_order": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "The camera's place in the Monitors page order (1 = first), one order for the whole server and every user; `null` = never ordered (listed after the ordered cameras). Set with `POST /cameras/actions/reorder`. API 1.102.0."
          },
          "brand": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who made the camera, when known (`Hikvision`, `Reolink` …); `null` = not known yet. The server works it out by itself: it asks cameras on its own network who they are (ONVIF device information when \"Use ONVIF\" is on, else the maker's own API) when they are added and again about daily until they answer; with nothing from the camera, from its network hardware address (`brand_source`). Read-only. API 1.103.0."
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "description": "The camera's model as the camera reports it (`DS-2CD2047G2-LU`); `null` = not known. Read-only. API 1.103.0."
          },
          "brand_source": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "camera",
              "catalog",
              "network",
              "network_module",
              null
            ],
            "description": "Where `brand` comes from: `camera` (the camera said so), `catalog` (the camera catalogue recognised it when it was added), `network` (its network hardware address, MAC prefix, is registered to this brand), `network_module` (the MAC prefix belongs to the maker of the camera's network module, not a camera brand: `brand` is that module maker, not the camera's brand); `null` exactly when `brand` is `null`. API 1.103.0."
          },
          "body_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "bullet",
              "dome",
              "turret",
              "ptz",
              "cube",
              "doorbell",
              "battery",
              "robot",
              null
            ],
            "description": "The shape of the camera's housing, for showing a picture of the kind of camera it is: from the camera catalogue's entry for `model`, else `ptz` for a camera that can be moved; `null` = not known. Read-only. API 1.103.0."
          },
          "ptz_zoom": {
            "type": [
              "string",
              "null"
            ],
            "description": "`optical` or `digital`; `null` = detected."
          },
          "ptz_settle_seconds": {
            "type": [
              "number",
              "null"
            ],
            "description": "API 1.53.0. Motion is ignored while Vigiora moves this camera (joystick, presets, patrols, API, AI tools) and for this many seconds after; `null` = the default, 3 s."
          },
          "ai_guardian_prompt": {
            "type": [
              "string",
              "null"
            ],
            "description": "Extra instructions for the Guardian AI on this camera."
          },
          "ai_live_env": {
            "type": [
              "string",
              "null"
            ],
            "description": "AI Live persona (`retail`, `security`, `reception`, `home`, `custom`)."
          },
          "stt_languages": {
            "type": "array",
            "description": "ISO 639-1 codes speech recognition expects (empty = auto-detect).",
            "items": {
              "type": "string"
            }
          },
          "stt_prompt": {
            "type": [
              "string",
              "null"
            ],
            "description": "Vocabulary hint for speech recognition (names, products)."
          },
          "lat": {
            "type": [
              "number",
              "null"
            ]
          },
          "lon": {
            "type": [
              "number",
              "null"
            ]
          },
          "source_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the camera's stored source is refused (the camera then reports `status` `unknown` and does not stream until its URL is fixed)."
          },
          "guardian_use_detections": {
            "type": "boolean",
            "description": "Guardian descriptions (and alert rules) also get what the camera's object detectors reported in the clip's window, as sensor data the AI checks against the frames (about 100 more prompt tokens, no other AI cost)."
          },
          "guardian_use_detections_set": {
            "type": "boolean",
            "description": "`false`: automatic (on when a Vision Engine detector service is assigned to the camera)."
          },
          "guardian_clip_preroll_sec": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 10,
            "description": "How many seconds before the motion that triggered it the camera's Guardian clip starts. `null` = the server's setting (`/guardian/clips/settings`, default 3). API 1.24.0."
          },
          "ai_services": {
            "type": "array",
            "description": "The AI services switched on for the camera (`GET /cameras/{camera_id}/ai-services`). Since API 1.36.1 the AI add-ons are `hal-video`, `hal-audio` and `hal-live` (before, `gemini-video` / `gemini-audio` / `gemini-live`).",
            "items": {
              "type": "string"
            }
          },
          "warnings": {
            "type": "array",
            "description": "`no_motion_trigger`: AI is on but no motion detection service triggers Guardian on the camera, so it writes no Guardian entries and its video alert rules never fire (enable `motion-detect`). Open set.",
            "items": {
              "type": "string"
            }
          },
          "services_enabled": {
            "type": "array",
            "description": "The services this call switched on (`core-ai`, and `motion-detect` when it was added as the motion trigger); empty when AI was already on.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CameraPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Camera"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CameraCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "stream_url"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "stream_url": {
            "type": "string",
            "description": "RTSP URL (credentials allowed), or the page URL of an iframe camera."
          },
          "source_type": {
            "type": "string",
            "enum": [
              "rtsp",
              "iframe",
              "usb_audio"
            ],
            "default": "rtsp"
          },
          "width": {
            "type": "integer",
            "minimum": 16,
            "maximum": 7680
          },
          "height": {
            "type": "integer",
            "minimum": 16,
            "maximum": 4320
          },
          "fps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 120
          },
          "enabled": {
            "type": "boolean",
            "default": true
          },
          "recording_enabled": {
            "type": "boolean",
            "default": false
          },
          "site_id": {
            "type": "integer",
            "minimum": 1
          },
          "tags": {
            "type": "array",
            "maxItems": 32,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "sub_stream_url": {
            "type": "string",
            "description": "RTSP URL of the camera's sub stream, on the same IPv4 address as `stream_url`."
          },
          "onvif_url": {
            "type": "string",
            "maxLength": 2048
          },
          "hardware_id": {
            "type": "string",
            "description": "The camera's MAC (`aa:bb:cc:dd:ee:ff`). User sessions only."
          },
          "client_id": {
            "type": "string",
            "description": "The vigiora-client that relays the camera (then `stream_url` is optional)."
          },
          "remote_stream_name": {
            "type": "string",
            "maxLength": 128,
            "description": "The stream name on the client."
          },
          "audio_device": {
            "type": "string",
            "maxLength": 256,
            "description": "usb_audio only: the microphone on the client."
          },
          "stt_languages": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "type": "string",
              "pattern": "^[a-z]{2}$"
            }
          },
          "ai_guardian_enabled": {
            "type": "boolean"
          },
          "ai_live_enabled": {
            "type": "boolean"
          }
        }
      },
      "CameraStorage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "measured",
          "estimate",
          "bytes_per_day",
          "source",
          "retention_days",
          "projected_bytes",
          "used_bytes",
          "hd_bytes_per_day",
          "hd_source"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "measured": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CameraStorageMeasure"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the camera really wrote lately; null when it has under an hour of finished recordings in the last 7 days, or the query describes a stream other than the saved one."
          },
          "estimate": {
            "$ref": "#/components/schemas/CameraStorageEstimate"
          },
          "bytes_per_day": {
            "type": "number",
            "description": "The figure to plan with: the measurement when there is one, the estimate otherwise."
          },
          "source": {
            "type": "string",
            "enum": [
              "measured",
              "estimate"
            ]
          },
          "retention_days": {
            "type": "integer",
            "minimum": 1
          },
          "projected_bytes": {
            "type": "number",
            "description": "`bytes_per_day` over `retention_days`."
          },
          "used_bytes": {
            "type": "number",
            "description": "What the camera's recordings take on disk now, its HD clips included."
          },
          "hd_bytes_per_day": {
            "type": "number",
            "description": "The part of `bytes_per_day` that the HD clips of the periods with movement take (`record_hd_on_motion` next to `record_sub_stream`); 0 when the camera does not keep them. API 1.100.0."
          },
          "hd_source": {
            "type": "string",
            "enum": [
              "measured",
              "estimate",
              ""
            ],
            "description": "`measured` from the camera's HD clips once they go back 6 hours, `estimate` before that (the main stream for a tenth of the day), empty when `hd_bytes_per_day` is 0."
          }
        }
      },
      "CameraStorageMeasure": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "bytes_per_day",
          "sample_seconds",
          "since"
        ],
        "properties": {
          "bytes_per_day": {
            "type": "number"
          },
          "sample_seconds": {
            "type": "number",
            "description": "How much finished recording the measurement rests on."
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "description": "The start of the oldest recording measured."
          }
        }
      },
      "CameraStorageEstimate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "bytes_per_day",
          "basis"
        ],
        "properties": {
          "bytes_per_day": {
            "type": "number"
          },
          "basis": {
            "type": "string",
            "enum": [
              "main",
              "sub_stream",
              "audio"
            ],
            "description": "What the estimate assumed: the main stream at its size and frame rate, a D1 (704×576) sub-stream at the frame rate, or a microphone."
          }
        }
      },
      "CameraUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Only the fields sent change; `{}` changes nothing.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "stream_url": {
            "type": "string",
            "minLength": 1
          },
          "enabled": {
            "type": "boolean"
          },
          "recording_enabled": {
            "type": "boolean"
          },
          "retention_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3650
          },
          "width": {
            "type": "integer",
            "minimum": 16,
            "maximum": 7680
          },
          "height": {
            "type": "integer",
            "minimum": 16,
            "maximum": 4320
          },
          "fps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 120
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "`null` removes the camera from its site."
          },
          "tags": {
            "type": "array",
            "maxItems": 32,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "sub_stream_url": {
            "type": "string",
            "description": "Sets the sub stream (cameras on this server's network; same IPv4 address as the main stream)."
          },
          "onvif_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "description": "The ONVIF address PTZ uses; `null` clears it. On this server's network it must be the camera's own host (or carry its own credentials). Sending back a `REDACTED` value keeps the stored credentials."
          },
          "hardware_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The camera's MAC; `null` forgets it (learned again while the stream works). User sessions only."
          },
          "client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Moves the camera to another vigiora-client (`null`, this server). User sessions only."
          },
          "record_sub_stream": {
            "type": "boolean"
          },
          "record_hd_on_motion": {
            "type": "boolean",
            "description": "Also keep the main (HD) stream while there is movement (needs `record_sub_stream`). API 1.100.0."
          },
          "has_ptz": {
            "type": "boolean",
            "description": "Set by hand (pins it; `ptz_manual: false` hands it back to detection)."
          },
          "ptz_manual": {
            "type": "boolean"
          },
          "onvif_enabled": {
            "type": "boolean",
            "description": "\"Use ONVIF\". `false`: Vigiora sends nothing to the camera over ONVIF (PTZ over ONVIF, presets, patrols, camera events, exposure, clock); the stored PTZ settings are kept. `true` turns it back on and checks the camera's PTZ again. API 1.101.0."
          },
          "ptz_zoom": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "optical",
              "digital",
              null
            ]
          },
          "ptz_settle_seconds": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 30,
            "description": "API 1.53.0. Seconds motion stays ignored after Vigiora moves the camera; `null` = 3 s."
          },
          "has_speaker": {
            "type": "boolean"
          },
          "ai_guardian_enabled": {
            "type": "boolean"
          },
          "ai_guardian_prompt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4096
          },
          "ai_live_enabled": {
            "type": "boolean",
            "description": "AI Live (the `hal-live` service)."
          },
          "ai_live_env": {
            "type": "string",
            "enum": [
              "retail",
              "security",
              "reception",
              "home",
              "custom"
            ]
          },
          "audio_monitoring_enabled": {
            "type": "boolean"
          },
          "wake_word_enabled": {
            "type": "boolean"
          },
          "stt_languages": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "type": "string",
              "pattern": "^[a-z]{2}$"
            }
          },
          "stt_prompt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1024
          },
          "lat": {
            "type": [
              "number",
              "null"
            ],
            "minimum": -90,
            "maximum": 90
          },
          "lon": {
            "type": [
              "number",
              "null"
            ],
            "minimum": -180,
            "maximum": 180
          },
          "guardian_use_detections": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "\"Use object detections in descriptions\"; `null` = automatic."
          },
          "guardian_clip_preroll_sec": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 10,
            "description": "Seconds before the triggering motion the camera's Guardian clips start; `null` = the server's setting. API 1.24.0."
          }
        }
      },
      "PTZMove": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "pan": {
            "type": "number",
            "minimum": -1,
            "maximum": 1,
            "default": 0,
            "description": "Negative left, positive right."
          },
          "tilt": {
            "type": "number",
            "minimum": -1,
            "maximum": 1,
            "default": 0,
            "description": "Negative down, positive up."
          },
          "zoom": {
            "type": "number",
            "minimum": -1,
            "maximum": 1,
            "default": 0,
            "description": "Negative out, positive in."
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5000,
            "default": 400,
            "description": "Not allowed with `hold`."
          },
          "hold": {
            "type": "boolean",
            "default": false,
            "description": "API 1.46.0: move until `…/ptz/actions/stop` or until this call is not repeated within ~1.2 s. Needs a non-zero pan, tilt or zoom."
          }
        }
      },
      "NetworkScanRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "subnet": {
            "type": "string",
            "description": "One subnet to scan (CIDR, /22 to /30) inside a connected private subnet. Default every connected subnet.",
            "example": "192.168.1.0/24"
          },
          "ports": {
            "type": "array",
            "description": "Ports to check on live hosts (default all of them; `[]` none).",
            "items": {
              "type": "integer",
              "enum": [
                80,
                443,
                554,
                8000,
                8080,
                8899,
                9000,
                34567,
                37777
              ]
            },
            "maxItems": 8
          },
          "onvif": {
            "type": "boolean",
            "description": "Send an ONVIF WS-Discovery probe (default true)."
          },
          "resolve_names": {
            "type": "boolean",
            "description": "Look up reverse DNS names of the devices found (default false)."
          }
        }
      },
      "AlertDropped": {
        "type": "object",
        "description": "An alert that was not stored (API 1.108.0).",
        "required": [
          "dropped"
        ],
        "properties": {
          "dropped": {
            "type": "string",
            "enum": [
              "privacy_mask"
            ],
            "description": "Why. `privacy_mask` = the box centre is inside one of the camera's privacy masks."
          }
        }
      },
      "PrivacyMaskPoint": {
        "type": "array",
        "description": "A corner, `[x, y]` between 0 and 1 from the top left of the picture.",
        "minItems": 2,
        "maxItems": 2,
        "items": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      },
      "PrivacyMask": {
        "type": "object",
        "additionalProperties": false,
        "description": "A camera privacy mask (API 1.108.0).",
        "required": [
          "id",
          "camera_id",
          "name",
          "points",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "maxLength": 64,
            "description": "The mask's name (may be empty)."
          },
          "points": {
            "type": "array",
            "minItems": 3,
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/PrivacyMaskPoint"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PrivacyMaskList": {
        "type": "object",
        "additionalProperties": false,
        "description": "A camera's privacy masks (API 1.108.0).",
        "required": [
          "data",
          "max_masks"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrivacyMask"
            }
          },
          "max_masks": {
            "type": "integer",
            "description": "How many masks a camera may have (8)."
          }
        }
      },
      "PrivacyMaskCreate": {
        "type": "object",
        "additionalProperties": false,
        "description": "A new privacy mask (API 1.108.0).",
        "required": [
          "points"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 64
          },
          "points": {
            "type": "array",
            "minItems": 3,
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/PrivacyMaskPoint"
            }
          }
        }
      },
      "PrivacyMaskUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "A privacy mask change (API 1.108.0); at least one field.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 64
          },
          "points": {
            "type": "array",
            "minItems": 3,
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/PrivacyMaskPoint"
            }
          }
        }
      },
      "MotionZone": {
        "type": "object",
        "additionalProperties": false,
        "description": "A camera motion zone (API 1.119.0).",
        "required": [
          "id",
          "camera_id",
          "name",
          "points",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "maxLength": 64,
            "description": "The zone's name (may be empty)."
          },
          "points": {
            "type": "array",
            "minItems": 3,
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/PrivacyMaskPoint"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MotionZoneList": {
        "type": "object",
        "additionalProperties": false,
        "description": "A camera's motion zones and mode (API 1.119.0).",
        "required": [
          "data",
          "mode",
          "max_zones"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MotionZone"
            }
          },
          "mode": {
            "type": "string",
            "enum": [
              "ignore",
              "only"
            ],
            "description": "`ignore`: movement inside the zones does not count. `only`: only movement inside them counts."
          },
          "max_zones": {
            "type": "integer",
            "description": "How many zones a camera may have (8)."
          }
        }
      },
      "MotionZoneCreate": {
        "type": "object",
        "additionalProperties": false,
        "description": "A new motion zone (API 1.119.0).",
        "required": [
          "points"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 64
          },
          "points": {
            "type": "array",
            "minItems": 3,
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/PrivacyMaskPoint"
            }
          }
        }
      },
      "MotionZoneUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "A motion zone change (API 1.119.0); at least one field.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 64
          },
          "points": {
            "type": "array",
            "minItems": 3,
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/PrivacyMaskPoint"
            }
          }
        }
      },
      "MotionZoneSettings": {
        "type": "object",
        "additionalProperties": false,
        "description": "A camera's motion zone mode (API 1.119.0).",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "ignore",
              "only"
            ],
            "description": "`ignore` (default): movement inside the zones does not count. `only`: only movement inside them counts."
          }
        }
      },
      "MotionZoneSettingsUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "A motion zone mode change (API 1.119.0).",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "ignore",
              "only"
            ]
          }
        }
      },
      "CameraClock": {
        "type": "object",
        "additionalProperties": false,
        "description": "A camera clock check (API 1.45.0).",
        "required": [
          "status",
          "offset_seconds",
          "camera_time",
          "camera_timezone",
          "camera_utc_offset_seconds",
          "server_timezone",
          "server_utc_offset_seconds",
          "ntp",
          "method",
          "checked_at",
          "message",
          "site_timezone",
          "site_utc_offset_seconds",
          "site_timezone_source",
          "timezone_setting",
          "auto_fix"
        ],
        "properties": {
          "site_timezone": {
            "type": "string",
            "description": "API 1.50.0. The zone the camera is compared with and set to (IANA name, or `UTC+07:00`). A camera behind a vigiora-client may be in another zone than the server."
          },
          "site_utc_offset_seconds": {
            "type": "integer",
            "description": "API 1.50.0. The site zone's UTC offset now."
          },
          "site_timezone_source": {
            "type": "string",
            "enum": [
              "camera",
              "client",
              "client_reported",
              "server"
            ],
            "description": "API 1.50.0. Where the site zone comes from: the camera's own setting (`PATCH /cameras/{camera_id}/clock`), its client's override (`PATCH /clients/{client_id}`), the zone its client reports, or the server's."
          },
          "timezone_setting": {
            "type": [
              "string",
              "null"
            ],
            "description": "API 1.50.0. The camera's own zone setting (`null` = none)."
          },
          "auto_fix": {
            "description": "API 1.50.0. The latest automatic fix of this camera (`null` = none).",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CameraClockAutoFix"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "drift",
              "timezone",
              "no_ntp",
              "unknown"
            ]
          },
          "offset_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Camera UTC minus server UTC (negative = behind); `null` when unknown."
          },
          "camera_time": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The camera's clock (UTC) at the check."
          },
          "camera_timezone": {
            "type": [
              "string",
              "null"
            ],
            "description": "The zone as the camera reports it (POSIX TZ, e.g. `CST-7:00:00` = UTC+7)."
          },
          "camera_utc_offset_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The camera's local time minus its UTC."
          },
          "server_timezone": {
            "type": "string",
            "description": "The server's IANA zone (`Asia/Bangkok`), or `UTC+07:00` when its name is unknown."
          },
          "server_utc_offset_seconds": {
            "type": "integer"
          },
          "ntp": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "The camera syncs with a time server; `null` = not reported."
          },
          "method": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "onvif",
              "isapi",
              "reolink",
              null
            ],
            "description": "How the clock was read: ONVIF, Hikvision ISAPI or (API 1.48.0) Reolink's own API."
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "CameraClockAutoFix": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "ok",
          "message"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "ok": {
            "type": "boolean",
            "description": "The camera's clock was right after the fix."
          },
          "message": {
            "type": "string"
          }
        }
      },
      "CameraClockZoneUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "timezone"
        ],
        "properties": {
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "description": "An IANA zone (`Europe/Rome`); `null` or `\"\"` = the client's or the server's."
          }
        }
      },
      "CameraClockFix": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ok",
          "message",
          "time_set",
          "timezone_set",
          "ntp_enabled",
          "notes",
          "before",
          "after"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "description": "The camera clock is right after the fix: `after.status` is `ok` or `no_ntp` (a camera that keeps its own time zone is `ok: false`)."
          },
          "message": {
            "type": "string"
          },
          "time_set": {
            "type": "boolean"
          },
          "timezone_set": {
            "type": "boolean"
          },
          "ntp_enabled": {
            "type": "boolean"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "before": {
            "$ref": "#/components/schemas/CameraClock"
          },
          "after": {
            "$ref": "#/components/schemas/CameraClock"
          }
        }
      },
      "CameraClockDetectionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "detection_id"
        ],
        "properties": {
          "detection_id": {
            "type": "string",
            "description": "From `POST /cameras/actions/detect`."
          }
        }
      },
      "CameraNameRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "snapshot_jpeg_base64": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 8400000,
            "description": "A JPEG of the camera (base64), e.g. the detection's thumbnail. Either this or `camera_id`."
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "An existing camera; its latest cached snapshot is used."
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "The site whose cameras the name must fit."
          },
          "vendor": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The maker (a hint, never put in the name)."
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "The model (a hint, never put in the name)."
          },
          "ip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64
          },
          "current_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "The name the user has now (the default or what they typed)."
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 16,
            "description": "BCP 47 UI language, used when no other camera names set one."
          }
        }
      },
      "CameraNameSuggestion": {
        "type": "object",
        "required": [
          "name",
          "room",
          "position",
          "alternatives",
          "reason",
          "others"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "`<Room> – <position>`, at most 60 characters."
          },
          "room": {
            "type": "string"
          },
          "position": {
            "type": "string"
          },
          "alternatives": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 3
          },
          "reason": {
            "type": "string",
            "description": "One sentence on what in the picture decided it."
          },
          "others": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The existing camera names the suggestion was fitted to."
          }
        }
      },
      "CameraDetectRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ip"
        ],
        "properties": {
          "ip": {
            "type": "string",
            "maxLength": 64,
            "description": "The camera's private (LAN) IPv4 address."
          },
          "port": {
            "type": [
              "integer",
              "null"
            ],
            "enum": [
              80,
              88,
              322,
              443,
              554,
              2020,
              7441,
              7447,
              8000,
              8080,
              8554,
              8899,
              9000,
              34567,
              37777,
              null
            ],
            "description": "Its RTSP port (default 554), one of the camera ports. ONVIF is looked for on the usual ports by itself."
          },
          "username": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64
          },
          "password": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 128,
            "description": "Never logged, stored only inside the detection on the server, never returned."
          },
          "vendor": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The maker (`Hikvision`, `Dahua`, `Reolink`, `TP-Link`, …), a vendor table id or a camera catalogue brand id (`GET /cameras/catalog/brands`); its paths are tried first. Default: the maker the last network scan found for the address."
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "API 1.31.0. A camera catalogue model (`model` of `GET /cameras/catalog`, e.g. `Tapo C230`), as the user picked it: its stream templates are tried first, and a model with no local stream fails with `no_local_stream`."
          },
          "unlock": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "API 1.36.0. `true` sends the login once more although the camera refused it in the last 30 minutes or its failure budget is spent (the user fixed the camera's account, or knows the password is right). The refusal count restarts, so a login that is still wrong may lock the camera's account."
          }
        }
      },
      "CameraDetectBatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ips"
        ],
        "properties": {
          "ips": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "port": {
            "type": [
              "integer",
              "null"
            ],
            "enum": [
              80,
              88,
              322,
              443,
              554,
              2020,
              7441,
              7447,
              8000,
              8080,
              8554,
              8899,
              9000,
              34567,
              37777,
              null
            ]
          },
          "username": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64
          },
          "password": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 128,
            "description": "Never logged or returned."
          },
          "vendor": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "API 1.31.0, as for `detectCamera`."
          },
          "unlock": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "API 1.36.0. `true` sends the login once more although the camera refused it in the last 30 minutes or its failure budget is spent (the user fixed the camera's account, or knows the password is right). The refusal count restarts, so a login that is still wrong may lock the camera's account."
          }
        }
      },
      "DetectionFailure": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "hint"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "auth_failed",
              "onvif_auth_failed",
              "rtsp_closed",
              "unreachable",
              "no_stream",
              "timeout",
              "no_local_stream"
            ],
            "description": "`auth_failed`: the camera refused the login over RTSP, or asked for one and none was given; `onvif_auth_failed`: the camera refused the login over ONVIF and no stream path answered to it either (ONVIF users are often separate: give the ONVIF user, or the stream address by hand); `rtsp_closed`: the RTSP port refused the connection; `unreachable`: nothing answers; `no_stream`: the camera answered but no known path worked; `timeout`: no answer in time; `no_local_stream` (API 1.31.0): the camera catalogue says this camera (its model, or every camera of its brand) has no local stream, its video goes only to the maker's app and cloud."
          },
          "message": {
            "type": "string"
          },
          "hint": {
            "type": "string",
            "description": "What to do, in plain words."
          }
        }
      },
      "CameraDetection": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ok",
          "detection_id",
          "expires_at",
          "ip",
          "port",
          "method",
          "vendor",
          "vendor_name",
          "main_url",
          "sub_url",
          "codec",
          "width",
          "height",
          "fps",
          "snapshot_jpeg_base64",
          "onvif",
          "auth_attempts",
          "attempts_left",
          "duration_ms",
          "failure",
          "manufacturer",
          "model",
          "firmware",
          "serial",
          "device_name",
          "ptz",
          "audio_in",
          "audio_out",
          "has_audio",
          "vendor_source",
          "credential_hint",
          "suggested_name",
          "hal_objects_available",
          "catalog",
          "tls",
          "onvif_login_refused",
          "console",
          "cameras"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "detection_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it to `POST /cameras/actions/add-detected`; `null` unless `ok`."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ip": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "method": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "onvif",
              "path",
              "console",
              null
            ],
            "description": "How the stream was found (`console`, API 1.96.0, the address is a camera console and `cameras` lists its cameras)."
          },
          "vendor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The vendor table id (`hikvision`, `dahua`, `reolink`, `tapo`, …) or, for a brand only the camera catalogue knows, its catalogue brand id (`eufy`, `vigi`, …), when known."
          },
          "vendor_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "main_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The main stream's URL, without credentials."
          },
          "sub_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The sub (low-resolution) stream's URL, without credentials."
          },
          "codec": {
            "type": [
              "string",
              "null"
            ],
            "description": "`h264`, `h265`, `mjpeg`, … when known."
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "fps": {
            "type": [
              "number",
              "null"
            ]
          },
          "snapshot_jpeg_base64": {
            "type": [
              "string",
              "null"
            ],
            "description": "A thumbnail (JPEG, 480 pixels wide), base64; `null` when no frame could be read."
          },
          "onvif": {
            "type": "boolean",
            "description": "An ONVIF device service answered."
          },
          "auth_attempts": {
            "type": "integer",
            "description": "Requests of this detection that carried the login."
          },
          "attempts_left": {
            "type": "integer",
            "description": "Refused logins this camera may still see in the sliding 30 minutes before Vigiora stops sending any (3 at most). Warn the user when it is low: the camera itself may lock its account."
          },
          "duration_ms": {
            "type": "integer"
          },
          "failure": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/DetectionFailure"
              },
              {
                "type": "null"
              }
            ]
          },
          "manufacturer": {
            "type": [
              "string",
              "null"
            ],
            "description": "Device facts (API 1.28.0) from ONVIF GetDeviceInformation or the maker's HTTP API (Hikvision and EZVIZ ISAPI); `null` when unknown."
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "firmware": {
            "type": [
              "string",
              "null"
            ]
          },
          "serial": {
            "type": [
              "string",
              "null"
            ]
          },
          "device_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ptz": {
            "type": "boolean",
            "description": "A PTZ configuration was found (ONVIF); the camera is created with PTZ on."
          },
          "audio_in": {
            "type": "boolean",
            "description": "A microphone (ONVIF audio source) was found."
          },
          "audio_out": {
            "type": "boolean",
            "description": "A speaker (ONVIF audio output) was found."
          },
          "has_audio": {
            "type": "boolean",
            "description": "The main stream carries an audio track."
          },
          "vendor_source": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "hint",
              "onvif",
              "path",
              "console",
              null
            ],
            "description": "What decided `vendor`: the request or the scan's maker (`hint`), the manufacturer the camera gave over ONVIF (`onvif`), the stream path that answered (`path`), or the console that answered (`console`, API 1.96.0)."
          },
          "credential_hint": {
            "type": [
              "string",
              "null"
            ],
            "description": "The maker's login advice from the camera catalogue (EZVIZ cameras take the verification code on the label as the password), user-facing English; also prefixed to an `auth_failed` failure's hint."
          },
          "suggested_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "A name for the camera (the model it reported, else the catalogue's brand and model, else its maker); `null` unless `ok`."
          },
          "hal_objects_available": {
            "type": "boolean",
            "description": "A Vision Engine is online, so `add-detected` turns object recognition on by default."
          },
          "catalog": {
            "description": "API 1.31.0. What the camera catalogue knows about the camera: the model it reported, else the picked `model`, else its brand; templates are filled for `ip`. `null` when it does not recognise it.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/CameraCatalogMatch"
              },
              {
                "type": "null"
              }
            ]
          },
          "tls": {
            "type": "boolean",
            "description": "API 1.96.0. The main stream is RTSP over TLS (`rtsps://`, e.g. Wyze on port 322)."
          },
          "onvif_login_refused": {
            "type": "boolean",
            "description": "API 1.96.0. ONVIF refused the login and the stream was then found on a known RTSP path with the same login (`method: path`): the camera keeps a separate ONVIF user; PTZ over ONVIF needs that user."
          },
          "console": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "unifi_protect",
              null
            ],
            "description": "API 1.96.0. The address is a camera console, not a camera; `null` for a camera."
          },
          "cameras": {
            "type": "array",
            "description": "API 1.96.0. The cameras a console serves (empty for a camera), at most 64: pick one or more and pass their `detection_id` to `add-detected`.",
            "items": {
              "$ref": "#/components/schemas/ConsoleCameraFound"
            }
          }
        }
      },
      "ConsoleCameraFound": {
        "type": "object",
        "additionalProperties": false,
        "description": "API 1.96.0. One camera a console serves.",
        "required": [
          "id",
          "name",
          "model",
          "mac",
          "connected",
          "rtsp_enabled",
          "main_url",
          "sub_url",
          "tls",
          "width",
          "height",
          "fps",
          "detection_id",
          "expires_at",
          "note"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The console's id for the camera."
          },
          "name": {
            "type": "string",
            "description": "Its name in the console."
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "mac": {
            "type": [
              "string",
              "null"
            ]
          },
          "connected": {
            "type": "boolean",
            "description": "The console reports it online."
          },
          "rtsp_enabled": {
            "type": "boolean",
            "description": "The console already serves its stream. When `false`, `add-detected` turns RTSP on for it in the console with the same login first."
          },
          "main_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The restream address with its alias (which works as a password) replaced by `REDACTED`; `null` while RTSP is off."
          },
          "sub_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "tls": {
            "type": "boolean",
            "description": "RTSPS (port 7441) instead of RTSP (7447)."
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "fps": {
            "type": [
              "number",
              "null"
            ]
          },
          "detection_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it to `add-detected`; `null` when the camera has no stream at all."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "What happens or what to do, in plain words."
          }
        }
      },
      "DetectionBatchItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ip",
          "status",
          "result",
          "rate_limited",
          "retry_after_seconds"
        ],
        "properties": {
          "ip": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "done"
            ]
          },
          "result": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CameraDetection"
              },
              {
                "type": "null"
              }
            ]
          },
          "rate_limited": {
            "type": "boolean",
            "description": "The camera's login budget was spent, so it was not tried."
          },
          "retry_after_seconds": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "DetectionBatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status",
          "started_at",
          "finished_at",
          "items"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "done"
            ]
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DetectionBatchItem"
            }
          }
        }
      },
      "AddDetectedCamera": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "detection_id",
          "name"
        ],
        "properties": {
          "detection_id": {
            "type": "string",
            "maxLength": 64
          },
          "name": {
            "type": "string",
            "maxLength": 128,
            "description": "`\"\"`: the detection's `suggested_name` (API 1.28.0)."
          },
          "enabled": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "recording_enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Default: the server's recording default (`GET /settings`)."
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "tags": {
            "type": [
              "array",
              "null"
            ],
            "maxItems": 32,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "width": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 16,
            "maximum": 7680,
            "description": "Override the detected frame size (with `height`) and rate. API 1.28.0."
          },
          "height": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 16,
            "maximum": 4320
          },
          "fps": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 120
          },
          "ai_guardian_enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Core AI on from the start (off by default; it uses credits). API 1.28.0."
          },
          "hal_objects": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Object recognition (hal-objects) on the new camera, with the default list of things to find (person, car, motorcycle, bicycle, truck, dog, cat, license plate, backpack, umbrella). `null`: on when a Vision Engine is online (`hal_objects_available`). API 1.28.0."
          }
        }
      },
      "AddDetectedRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "cameras"
        ],
        "properties": {
          "cameras": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/AddDetectedCamera"
            }
          }
        }
      },
      "AddDetectedFailure": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "detection_id",
          "error"
        ],
        "properties": {
          "detection_id": {
            "type": "string"
          },
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message",
              "details"
            ],
            "properties": {
              "code": {
                "$ref": "#/components/schemas/ErrorCode"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object"
              }
            }
          }
        }
      },
      "AddDetectedResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "created",
          "failed"
        ],
        "properties": {
          "created": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Camera"
            }
          },
          "failed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddDetectedFailure"
            }
          }
        }
      },
      "DHCPMoveRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ip",
          "mac",
          "vendor",
          "username",
          "password"
        ],
        "properties": {
          "ip": {
            "type": "string",
            "description": "The camera's current (conflicting) IPv4 address, on a subnet this server is connected to."
          },
          "mac": {
            "type": "string",
            "maxLength": 32,
            "description": "The camera's MAC, from its discovery reply (`NetworkDevice.mac`)."
          },
          "vendor": {
            "type": "string",
            "maxLength": 64,
            "description": "`hikvision`, `ezviz` (ISAPI), `dahua` or `amcrest` (CGI); other makers are refused (`400`)."
          },
          "username": {
            "type": "string",
            "maxLength": 128
          },
          "password": {
            "type": "string",
            "maxLength": 256
          }
        }
      },
      "DHCPMoveStep": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "status",
          "message"
        ],
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "route",
              "device_info",
              "set_dhcp",
              "reboot",
              "wait"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "ok",
              "skipped",
              "failed"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "DHCPMoveError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "command"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "needs_privilege",
              "auth_failed",
              "unreachable",
              "unsupported_vendor",
              "device_mismatch",
              "refused",
              "timeout",
              "busy"
            ],
            "description": "`needs_privilege`: this server may not pin a neighbour entry (no CAP_NET_ADMIN) and another device answers at the address; run `command` on the server once, then start the move again."
          },
          "message": {
            "type": "string"
          },
          "command": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "DHCPMove": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status",
          "step",
          "mac",
          "vendor",
          "old_ip",
          "new_ip",
          "model",
          "serial",
          "firmware",
          "steps",
          "error",
          "started_at",
          "finished_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "done",
              "failed"
            ]
          },
          "step": {
            "type": "string",
            "enum": [
              "route",
              "device_info",
              "set_dhcp",
              "reboot",
              "wait"
            ],
            "description": "The current (or last) step."
          },
          "mac": {
            "type": "string"
          },
          "vendor": {
            "type": "string"
          },
          "old_ip": {
            "type": "string"
          },
          "new_ip": {
            "type": [
              "string",
              "null"
            ],
            "description": "The address the camera came back on (set when `done`): detect it there next."
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "serial": {
            "type": [
              "string",
              "null"
            ]
          },
          "firmware": {
            "type": [
              "string",
              "null"
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DHCPMoveStep"
            }
          },
          "error": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/DHCPMoveError"
              },
              {
                "type": "null"
              }
            ]
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "DiagnosticFix": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "action_id",
          "steps"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "auto",
              "manual"
            ]
          },
          "action_id": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "restart_go2rtc",
              "check_updates",
              "resync_cloud",
              "sync_clock",
              null
            ],
            "description": "The fix to run (`auto` only)."
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What to do by hand on this server's platform (also given with some `auto` fixes, as the fallback)."
          }
        }
      },
      "DiagnosticCheck": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "status",
          "detail",
          "fix",
          "duration_ms"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "`disk`, `clock`, `ports`, `cloud`, `go2rtc`, `ffmpeg`, `gpu`, `lan`, `dns`, `updates` or `camera_clocks` (API 1.45.0: cameras whose own clock is wrong; more may be added)."
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "warn",
              "fail",
              "skip"
            ]
          },
          "detail": {
            "type": "string",
            "description": "A plain explanation."
          },
          "fix": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/DiagnosticFix"
              },
              {
                "type": "null"
              }
            ]
          },
          "duration_ms": {
            "type": "integer"
          }
        }
      },
      "DiagnosticAction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "available"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "available": {
            "type": "boolean",
            "description": "Whether it can run on this install."
          }
        }
      },
      "DiagnosticsReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "platform",
          "checked_at",
          "checks",
          "actions"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "warn",
              "fail"
            ],
            "description": "The worst check status (`skip` counts as `ok`)."
          },
          "platform": {
            "type": "string",
            "enum": [
              "linux",
              "docker",
              "macos",
              "windows"
            ],
            "description": "What the manual steps are written for."
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiagnosticCheck"
            }
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiagnosticAction"
            }
          }
        }
      },
      "DiagnosticFixRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "action_id"
        ],
        "properties": {
          "action_id": {
            "type": "string",
            "maxLength": 64,
            "description": "`restart_go2rtc`, `check_updates`, `resync_cloud` or `sync_clock`."
          }
        }
      },
      "DiagnosticFixResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "action_id",
          "check"
        ],
        "properties": {
          "action_id": {
            "type": "string"
          },
          "check": {
            "$ref": "#/components/schemas/DiagnosticCheck"
          }
        }
      },
      "ChecklistItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "status",
          "source",
          "optional",
          "detail",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "health",
              "cameras",
              "recording",
              "ai_cameras",
              "notifications",
              "phone_app",
              "claude_connector"
            ]
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "done",
              "skipped",
              "pending"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "auto",
              "user",
              null
            ]
          },
          "optional": {
            "type": "boolean"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the data shows (\"3 cameras\")."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When an admin last marked it."
          }
        }
      },
      "SetupChecklist": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "complete",
          "done",
          "total",
          "items"
        ],
        "properties": {
          "complete": {
            "type": "boolean"
          },
          "done": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChecklistItem"
            }
          }
        }
      },
      "SetupChecklistUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "object",
            "description": "Item id (at least one) → `done`, `skipped` or `pending`.",
            "additionalProperties": {
              "type": "string",
              "enum": [
                "done",
                "skipped",
                "pending"
              ]
            }
          }
        }
      },
      "AICameraSuggestion": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "name",
          "has_ai",
          "suggested",
          "score",
          "people",
          "motion_events",
          "detections",
          "stream_live",
          "reason"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "has_ai": {
            "type": "boolean"
          },
          "suggested": {
            "type": "boolean",
            "description": "Give this camera one of the free AI slots."
          },
          "score": {
            "type": "number"
          },
          "people": {
            "type": "integer"
          },
          "motion_events": {
            "type": "integer"
          },
          "detections": {
            "type": "integer"
          },
          "stream_live": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "AICameraSuggestions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "slots",
          "used",
          "free",
          "basis",
          "window_days",
          "cameras"
        ],
        "properties": {
          "slots": {
            "type": "integer"
          },
          "used": {
            "type": "integer"
          },
          "free": {
            "type": "integer"
          },
          "basis": {
            "type": "string",
            "enum": [
              "activity",
              "stream",
              "order"
            ]
          },
          "window_days": {
            "type": "integer"
          },
          "cameras": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AICameraSuggestion"
            }
          }
        }
      },
      "NetworkDevice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ip",
          "mac",
          "vendor",
          "hostname",
          "open_ports",
          "onvif",
          "onvif_url",
          "last_seen",
          "known_camera_id",
          "is_known_camera",
          "is_self",
          "vendor_class",
          "known_camera_name",
          "model",
          "firmware",
          "serial",
          "name",
          "discovery",
          "dhcp",
          "activated",
          "ip_conflict",
          "conflict_mac",
          "catalog"
        ],
        "properties": {
          "ip": {
            "type": "string"
          },
          "mac": {
            "type": [
              "string",
              "null"
            ],
            "description": "Lower-case `aa:bb:cc:dd:ee:ff`."
          },
          "vendor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The maker's short name from the MAC's prefix in the IEEE public registry (MA-L, MA-M, MA-S), or the maker a discovery reply named; `null` when unregistered or locally administered (randomised)."
          },
          "vendor_class": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "camera",
              "module",
              "computer",
              null
            ],
            "description": "What the MAC's maker makes (API 1.28.0): `camera` (a camera brand), `module` (a camera / Wi-Fi module maker such as Gaoshengda, iComm or Espressif: often a camera of a brand the prefix does not tell; the stream probe finds the brand), `computer` (computers, phones, routers, NAS), `null` unknown."
          },
          "known_camera_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The matching camera's name, when you may view it (API 1.28.0)."
          },
          "model": {
            "type": "string",
            "description": "The model a discovery reply (SADP, Dahua, mDNS, SSDP) or ONVIF gave; `\"\"` unknown. API 1.28.0."
          },
          "firmware": {
            "type": "string"
          },
          "serial": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "The device's own name (mDNS / SSDP server name); `\"\"` none."
          },
          "discovery": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "sadp",
                "dahua",
                "ssdp",
                "mdns"
              ]
            },
            "description": "The discovery protocols it answered."
          },
          "dhcp": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether it is on DHCP, when the reply said (SADP, Dahua)."
          },
          "activated": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Hikvision only: `false` for a new camera that was never activated (set its admin password in the Hik-Connect app or on its web page first; Vigiora never activates cameras)."
          },
          "ip_conflict": {
            "type": "boolean",
            "description": "The device answered a discovery probe from an address that another device (`conflict_mac`, the neighbour-table entry) holds: a camera on its factory static address next to a device the router leased that address to. It is unreachable there; move it to DHCP (`POST /network/devices/actions/move-to-dhcp`) or change its address in its own app."
          },
          "conflict_mac": {
            "type": [
              "string",
              "null"
            ]
          },
          "catalog": {
            "description": "API 1.31.0. What the camera catalogue recognises the device as (by its discovery model, MAC prefix or maker), with its stream templates filled for `ip`. `null` for devices that do not look like cameras unless the catalogue is sure (a Ring's own MAC prefix); a prefix shared with phones or routers gives `matched_by: oui_shared`, a module maker's `module_hint`.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/CameraCatalogMatch"
              },
              {
                "type": "null"
              }
            ]
          },
          "hostname": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reverse DNS name."
          },
          "open_ports": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "onvif": {
            "type": "boolean",
            "description": "Answered the ONVIF WS-Discovery probe."
          },
          "onvif_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its ONVIF device service URL."
          },
          "last_seen": {
            "type": "string",
            "format": "date-time"
          },
          "known_camera_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The camera with this MAC or address, when you may view it."
          },
          "is_known_camera": {
            "type": "boolean",
            "description": "A Vigiora camera (visible to you or not) uses this device."
          },
          "is_self": {
            "type": "boolean",
            "description": "This server."
          }
        }
      },
      "NetworkDevicePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NetworkDevice"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "NetworkScan": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status",
          "phase",
          "progress",
          "subnets",
          "ports",
          "onvif",
          "resolve_names",
          "hosts_total",
          "truncated",
          "skipped_subnets",
          "started_at",
          "finished_at",
          "error",
          "device_count",
          "devices"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "done",
              "failed"
            ]
          },
          "phase": {
            "type": "string",
            "enum": [
              "sweep",
              "ports",
              "onvif",
              "vendor",
              "hostnames",
              "done"
            ]
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "subnets": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ports": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "onvif": {
            "type": "boolean"
          },
          "resolve_names": {
            "type": "boolean"
          },
          "hosts_total": {
            "type": "integer"
          },
          "truncated": {
            "type": "boolean",
            "description": "The 1022-host cap left connected subnets (or part of one) out."
          },
          "skipped_subnets": {
            "type": "array",
            "description": "The subnets the cap left out, in whole or in part.",
            "items": {
              "type": "string"
            }
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "device_count": {
            "type": "integer"
          },
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NetworkDevice"
            }
          }
        }
      },
      "NetworkLookup": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mac",
          "ip",
          "found",
          "source",
          "checked_at",
          "other_ips",
          "known_camera_id",
          "is_known_camera"
        ],
        "properties": {
          "mac": {
            "type": "string"
          },
          "ip": {
            "type": "string"
          },
          "found": {
            "type": "boolean"
          },
          "source": {
            "type": "string",
            "enum": [
              "neighbor",
              "sweep"
            ]
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          },
          "other_ips": {
            "type": "array",
            "description": "Other connected addresses that answer with the same MAC (a bridge or a multi-homed device).",
            "items": {
              "type": "string"
            }
          },
          "known_camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "is_known_camera": {
            "type": "boolean"
          }
        }
      },
      "AutoScan": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "interval_minutes",
          "interval_choices",
          "available",
          "unavailable_reason",
          "unavailable_message",
          "running",
          "scan_id",
          "progress",
          "last_run",
          "last_summary",
          "last_skipped",
          "next_run"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Scan automatically (on by default on a self-hosted server; always off on a hosted one)."
          },
          "interval_minutes": {
            "type": "integer",
            "enum": [
              15,
              30,
              60,
              180,
              720
            ]
          },
          "interval_choices": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "available": {
            "type": "boolean",
            "description": "Network discovery works on this server."
          },
          "unavailable_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "When not available (`hosted`, `container_network`, `not_supported`, `no_lan`, `disabled`)."
          },
          "unavailable_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "running": {
            "type": "boolean",
            "description": "A scan of the automatic scanner (scheduled or \"Scan now\") is running or being processed."
          },
          "scan_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "progress": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "last_run": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AutoScanRun"
              }
            ]
          },
          "last_summary": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AutoScanSummary"
              }
            ]
          },
          "last_skipped": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AutoScanSkip"
              }
            ]
          },
          "next_run": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The next planned run; `null` when off or unavailable."
          }
        }
      },
      "AutoScanRun": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "started_at",
          "finished_at",
          "status",
          "error",
          "trigger",
          "scan_id"
        ],
        "properties": {
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "failed"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "trigger": {
            "type": "string",
            "enum": [
              "schedule",
              "manual"
            ]
          },
          "scan_id": {
            "type": "string"
          }
        }
      },
      "AutoScanSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "devices",
          "cameras",
          "new_cameras",
          "possible_cameras"
        ],
        "properties": {
          "devices": {
            "type": "integer",
            "description": "Devices found (this server left out)."
          },
          "cameras": {
            "type": "integer",
            "description": "Of them, Vigiora cameras already."
          },
          "new_cameras": {
            "type": "integer",
            "description": "Wizard-ready candidates (`high` or `medium` confidence)."
          },
          "possible_cameras": {
            "type": "integer",
            "description": "`low` confidence candidates (camera-like, but no camera port open)."
          }
        }
      },
      "AutoScanSkip": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "reason"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "reason": {
            "type": "string",
            "enum": [
              "network_unavailable",
              "scan_running",
              "network_busy",
              "failed_to_start"
            ]
          }
        }
      },
      "AutoScanUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "interval_minutes": {
            "type": "integer",
            "enum": [
              15,
              30,
              60,
              180,
              720
            ]
          }
        }
      },
      "AutoScanStarted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "scan_id",
          "status",
          "started_at"
        ],
        "properties": {
          "scan_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "done",
              "failed"
            ]
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "NetworkCandidate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "mac",
          "ip",
          "vendor",
          "confidence",
          "wizard_ready",
          "reasons",
          "open_ports",
          "onvif",
          "rtsp_open",
          "hint",
          "hint_code",
          "first_seen",
          "last_seen",
          "announced_at",
          "model"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Its MAC (the `candidate_id` of the dismiss action)."
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "description": "The model its maker's discovery protocol gave (API 1.28.0)."
          },
          "mac": {
            "type": "string"
          },
          "ip": {
            "type": "string",
            "description": "The address it had in the latest scan."
          },
          "vendor": {
            "type": [
              "string",
              "null"
            ]
          },
          "confidence": {
            "type": "string",
            "enum": [
              "high",
              "medium",
              "low"
            ]
          },
          "wizard_ready": {
            "type": "boolean",
            "description": "`high` or `medium`: offer the setup wizard (Connect step) for it."
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "discovered",
                "onvif",
                "rtsp_open",
                "onvif_port_open",
                "reolink_port_open",
                "camera_vendor",
                "camera_chip"
              ]
            }
          },
          "open_ports": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "onvif": {
            "type": "boolean"
          },
          "rtsp_open": {
            "type": "boolean"
          },
          "hint": {
            "type": [
              "string",
              "null"
            ],
            "description": "Advice for a `low` candidate (turn on RTSP or ONVIF in its app), user-facing English."
          },
          "hint_code": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "enable_rtsp_onvif",
              "reolink_rtsp_off",
              null
            ],
            "description": "The advice as a code, to show it translated: `enable_rtsp_onvif`, or `reolink_rtsp_off` (port 9000 open without RTSP: a Reolink camera with RTSP, ONVIF and HTTP off, the default of new Reolink firmware; turn them on in the Reolink app under Settings → Network → Advanced → Server Settings)."
          },
          "first_seen": {
            "type": "string",
            "format": "date-time"
          },
          "last_seen": {
            "type": "string",
            "format": "date-time"
          },
          "announced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "NetworkCandidatePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NetworkCandidate"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CandidateDismissal": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "mac",
          "dismissed",
          "dismissed_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "mac": {
            "type": "string"
          },
          "dismissed": {
            "type": "boolean"
          },
          "dismissed_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RelocateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "dry_run": {
            "type": "boolean",
            "description": "Only report what would change (default false)."
          }
        }
      },
      "CameraRelocation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "mac",
          "old_ip",
          "new_ip",
          "changed",
          "applied",
          "dry_run",
          "source"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "mac": {
            "type": "string"
          },
          "old_ip": {
            "type": "string"
          },
          "new_ip": {
            "type": "string"
          },
          "changed": {
            "type": "boolean",
            "description": "The MAC answers at a different address than the camera's."
          },
          "applied": {
            "type": "boolean",
            "description": "The camera was moved (false for a dry run or no change)."
          },
          "dry_run": {
            "type": "boolean"
          },
          "source": {
            "type": "string",
            "enum": [
              "neighbor",
              "sweep"
            ]
          }
        }
      },
      "RobotPatrolStart": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "default": 5,
            "description": "Run time limit."
          },
          "goal": {
            "type": "string",
            "maxLength": 300,
            "description": "Optional, e.g. \"check the kitchen and come back\"."
          }
        }
      },
      "RobotLight": {
        "type": "object",
        "required": [
          "on",
          "level",
          "remaining_s"
        ],
        "properties": {
          "on": {
            "type": "boolean"
          },
          "level": {
            "type": "integer",
            "description": "Brightness 1..120 while on; 0 when off."
          },
          "remaining_s": {
            "type": "integer",
            "description": "Seconds before the robot switches it off by itself."
          }
        }
      },
      "RobotWifiMotion": {
        "type": "object",
        "required": [
          "enabled",
          "valid",
          "motion",
          "history_hz",
          "history"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "valid": {
            "type": "boolean"
          },
          "motion": {
            "type": "boolean"
          },
          "score": {
            "type": [
              "number",
              "null"
            ]
          },
          "baseline": {
            "type": [
              "number",
              "null"
            ]
          },
          "threshold": {
            "type": [
              "number",
              "null"
            ]
          },
          "threshold_auto": {
            "type": "boolean"
          },
          "since_ms": {
            "type": "integer"
          },
          "warming_up": {
            "type": "boolean"
          },
          "packets_per_s": {
            "type": "number"
          },
          "rssi": {
            "type": [
              "integer",
              "null"
            ]
          },
          "history_hz": {
            "type": "integer"
          },
          "history": {
            "type": "array",
            "items": {
              "type": [
                "number",
                "null"
              ]
            }
          },
          "camera": {
            "description": "The robot's camera switch as the server last read it (every few seconds); null when unknown.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/RobotCameraState"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "RobotCameraState": {
        "type": "object",
        "required": [
          "on",
          "paused_reason"
        ],
        "properties": {
          "on": {
            "type": "boolean"
          },
          "paused_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "null, `ble`, `deep_scan` or `manual`."
          },
          "resolution": {
            "type": "string"
          },
          "fps": {
            "type": "number"
          },
          "resumes_in_s": {
            "type": "integer"
          }
        }
      },
      "RobotScan": {
        "type": "object",
        "required": [
          "taken_at",
          "seconds",
          "took_ms",
          "result"
        ],
        "properties": {
          "taken_at": {
            "type": "string",
            "format": "date-time"
          },
          "seconds": {
            "type": "integer"
          },
          "took_ms": {
            "type": "integer"
          },
          "result": {
            "type": "object",
            "description": "What the robot heard. `wifi` lists `{bssid, ssid, rssi, channel}`; `ble` lists `{address, rssi, name, services}` (and `appearance`, `manufacturer_id` when known) on firmware before 0.4.0 and is null since 0.4.0 (use `bluetooth-scan`); `csi` is the movement over the scan (`seconds`, `valid_s`, `motion_s`, `mean_score`, `max_score`, `motion`, `now`).",
            "additionalProperties": true
          }
        }
      },
      "RobotJobStarted": {
        "type": "object",
        "required": [
          "job_id",
          "ready_after_s"
        ],
        "properties": {
          "job_id": {
            "type": "string"
          },
          "ready_after_s": {
            "type": "integer",
            "description": "Seconds until the robot is back and the job can be read."
          }
        }
      },
      "RobotJob": {
        "type": "object",
        "required": [
          "job_id",
          "kind",
          "status",
          "ready_after_s",
          "started_at",
          "finished_at",
          "result"
        ],
        "properties": {
          "job_id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "scan",
              "midi_devices",
              "midi_play"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "done",
              "failed"
            ]
          },
          "ready_after_s": {
            "type": "integer"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "result": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "error": {
            "type": "string"
          }
        }
      },
      "RobotBleDevice": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "rssi": {
            "type": "integer"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "appearance": {
            "type": "integer"
          },
          "manufacturer_id": {
            "type": "integer"
          },
          "services": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "RobotBleResult": {
        "type": "object",
        "required": [
          "job_id",
          "taken_at",
          "ok",
          "took_ms",
          "devices"
        ],
        "properties": {
          "job_id": {
            "type": "string"
          },
          "taken_at": {
            "type": "string",
            "format": "date-time"
          },
          "ok": {
            "type": "boolean"
          },
          "took_ms": {
            "type": "integer"
          },
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RobotBleDevice"
            }
          },
          "error": {
            "type": "string"
          }
        }
      },
      "RobotBluetooth": {
        "type": "object",
        "required": [
          "available",
          "keyboard",
          "away",
          "scan",
          "keyboards",
          "melodies",
          "restart",
          "low_battery"
        ],
        "properties": {
          "low_battery": {
            "type": "boolean",
            "description": "The robot's battery is low; it refuses Bluetooth jobs until charged."
          },
          "available": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "The robot has Bluetooth; null = not read yet."
          },
          "keyboard": {
            "type": [
              "object",
              "null"
            ],
            "description": "The MIDI keyboard the robot remembers.",
            "properties": {
              "address": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "away": {
            "type": [
              "object",
              "null"
            ],
            "description": "Set while the robot is away on a Bluetooth job.",
            "properties": {
              "until": {
                "type": "string",
                "format": "date-time"
              },
              "remaining_s": {
                "type": "integer"
              }
            }
          },
          "scan": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RobotBleResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "keyboards": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RobotBleResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "melodies": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "restart": {
            "type": [
              "object",
              "null"
            ],
            "description": "Why the robot last restarted (diagnostics only).",
            "properties": {
              "reason": {
                "type": "string",
                "description": "power_on, software, crash, watchdog, brownout, …"
              },
              "detail": {
                "type": "string"
              },
              "last_step": {
                "type": "string"
              },
              "prev_uptime_s": {
                "type": "integer"
              },
              "boots": {
                "type": "integer"
              },
              "brownouts": {
                "type": "integer"
              },
              "crashes": {
                "type": "integer"
              },
              "after_bluetooth_job": {
                "type": "boolean",
                "description": "A normal restart that ended a Bluetooth job."
              }
            }
          }
        }
      },
      "RobotNavGo": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "description": "Run time limit (default the robot's max_minutes)."
          }
        }
      },
      "RobotNavLearnStart": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "drive",
              "explore"
            ],
            "description": "`drive`: you drive, it keeps views. `explore`: the AI patrol drives."
          },
          "minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "description": "Session limit (default the robot's max_minutes)."
          }
        }
      },
      "RobotNavSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "movement_events",
          "max_minutes"
        ],
        "properties": {
          "movement_events": {
            "type": "boolean",
            "description": "Wi-Fi movement near the idle robot starts one Guardian look."
          },
          "max_minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30
          }
        }
      },
      "RobotNavSettingsUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "movement_events": {
            "type": "boolean"
          },
          "max_minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30
          }
        }
      },
      "RobotPlaceCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 60,
            "description": "Empty or absent = ask later (needs_name)."
          },
          "kind": {
            "type": "string",
            "enum": [
              "home",
              "place"
            ],
            "default": "place"
          }
        }
      },
      "RobotPlaceUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "kind": {
            "type": "string",
            "enum": [
              "home",
              "place"
            ]
          },
          "room_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "A room of the floor plans; null clears it."
          }
        }
      },
      "RobotPlace": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "name",
          "kind",
          "room_id",
          "suggested_name",
          "needs_name",
          "dark",
          "views",
          "heading_keyframe_id",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "home",
              "place"
            ]
          },
          "room_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "suggested_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "From the local vision model only."
          },
          "needs_name": {
            "type": "boolean"
          },
          "dark": {
            "type": "boolean",
            "description": "The place was dark when learned (the light is switched on near it)."
          },
          "views": {
            "type": "integer",
            "description": "Saved views (8 after a full save)."
          },
          "heading_keyframe_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The view the robot faces on arrival."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RobotPlaceList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RobotPlace"
            }
          }
        }
      },
      "RobotNavHere": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "keyframe_id",
          "place_id",
          "place_name",
          "at",
          "told"
        ],
        "properties": {
          "keyframe_id": {
            "type": "integer"
          },
          "place_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "place_name": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "told": {
            "type": "boolean",
            "description": "Set by \"I'm here\" (relocalise)."
          }
        }
      },
      "RobotNavLearning": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "running",
          "keyframes",
          "started_at",
          "ends_at",
          "ended_at",
          "end_reason"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "drive",
              "explore"
            ]
          },
          "running": {
            "type": "boolean"
          },
          "keyframes": {
            "type": "integer",
            "description": "Views kept in this session."
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "end_reason": {
            "type": "string"
          }
        }
      },
      "RobotNavStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "addon_online",
          "controller",
          "running",
          "kind",
          "place_id",
          "place_name",
          "minutes",
          "step",
          "max_steps",
          "started_at",
          "ends_at",
          "ended_at",
          "last_action",
          "last_note",
          "end_reason",
          "end_message",
          "learning",
          "here",
          "places",
          "keyframes"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "addon_online": {
            "type": "boolean",
            "description": "The Robot navigation add-on answers."
          },
          "controller": {
            "type": "string",
            "description": "Who holds the robot: nav, patrol, manual or empty."
          },
          "running": {
            "type": "boolean"
          },
          "kind": {
            "type": "string",
            "description": "goto, return_home or save_place (empty before any run)."
          },
          "place_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "place_name": {
            "type": "string"
          },
          "minutes": {
            "type": "integer"
          },
          "step": {
            "type": "integer"
          },
          "max_steps": {
            "type": "integer"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ends_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_action": {
            "type": "string"
          },
          "last_note": {
            "type": "string"
          },
          "end_reason": {
            "type": "string",
            "description": "arrived, done, stopped, manual, lost, blocked, no_route, too_dark, low_battery, weak_wifi, robot_unreachable, addon_offline, timeout or error."
          },
          "end_message": {
            "type": "string"
          },
          "learning": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RobotNavLearning"
              },
              {
                "type": "null"
              }
            ]
          },
          "here": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RobotNavHere"
              },
              {
                "type": "null"
              }
            ]
          },
          "places": {
            "type": "integer"
          },
          "keyframes": {
            "type": "integer"
          }
        }
      },
      "RobotNavKeyframe": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "place_id",
          "view_index",
          "x",
          "y",
          "theta",
          "wifi",
          "brightness",
          "light_used",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "place_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "view_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "x": {
            "type": "number",
            "description": "Rough position in cm (map frame)."
          },
          "y": {
            "type": "number"
          },
          "theta": {
            "type": "number",
            "description": "Heading in degrees."
          },
          "wifi": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Wi-Fi fingerprint (rssi in dBm)."
          },
          "brightness": {
            "type": "number"
          },
          "light_used": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RobotNavEdge": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "from_keyframe_id",
          "to_keyframe_id",
          "dx",
          "dy",
          "dtheta",
          "source",
          "successes",
          "failures"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "from_keyframe_id": {
            "type": "integer"
          },
          "to_keyframe_id": {
            "type": "integer"
          },
          "dx": {
            "type": "number"
          },
          "dy": {
            "type": "number"
          },
          "dtheta": {
            "type": "number"
          },
          "source": {
            "type": "string",
            "enum": [
              "odometry",
              "visual"
            ]
          },
          "successes": {
            "type": "integer"
          },
          "failures": {
            "type": "integer"
          }
        }
      },
      "RobotNavMap": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "places",
          "keyframes",
          "edges",
          "calibration"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "places": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RobotPlace"
            }
          },
          "keyframes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RobotNavKeyframe"
            }
          },
          "edges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RobotNavEdge"
            }
          },
          "calibration": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "deg_per_ms",
              "cm_per_ms"
            ],
            "properties": {
              "deg_per_ms": {
                "type": "number"
              },
              "cm_per_ms": {
                "type": "number"
              }
            }
          }
        }
      },
      "RobotNavStep": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "step",
          "action"
        ],
        "properties": {
          "step": {
            "type": "integer"
          },
          "action": {
            "type": "string"
          },
          "ms": {
            "type": "integer"
          },
          "note": {
            "type": "string"
          },
          "at_keyframe_id": {
            "type": "integer"
          },
          "free_cm": {
            "type": "number"
          }
        }
      },
      "RobotNavRun": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "kind",
          "place_id",
          "place_name",
          "started_at",
          "ended_at",
          "end_reason",
          "steps",
          "log"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "place_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "place_name": {
            "type": "string"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "end_reason": {
            "type": "string"
          },
          "steps": {
            "type": "integer"
          },
          "log": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RobotNavStep"
            }
          }
        }
      },
      "RobotNavRunPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RobotNavRun"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RobotPatrolStatus": {
        "type": "object",
        "required": [
          "camera_id",
          "running",
          "step",
          "max_steps",
          "minutes",
          "estimated_credits"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "running": {
            "type": "boolean"
          },
          "goal": {
            "type": "string"
          },
          "minutes": {
            "type": "integer"
          },
          "step": {
            "type": "integer"
          },
          "max_steps": {
            "type": "integer"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ends_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_action": {
            "type": "string",
            "description": "forward, turn_left, turn_right, back, stop, done or recover (backing off when stuck)."
          },
          "last_reason": {
            "type": "string"
          },
          "scene": {
            "type": "string",
            "description": "What the robot saw last."
          },
          "end_reason": {
            "type": "string",
            "description": "done, stopped, manual, time_limit, step_limit, stale_frame, robot_unreachable, weak_wifi, low_battery, too_dark, ai_unavailable, no_credits or error."
          },
          "end_message": {
            "type": "string"
          },
          "credits_used": {
            "type": "integer"
          },
          "estimated_credits": {
            "type": "integer",
            "description": "The most this run (or a run of `minutes`) costs in AI credits."
          }
        }
      },
      "PTZResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "`done`; `coalesced`: another move for this camera was running and this one was dropped; `holding`: a hold move is running (started, or renewed by a repeat).",
            "enum": [
              "done",
              "coalesced",
              "holding"
            ]
          }
        }
      },
      "PTZPreset": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "token",
          "name"
        ],
        "properties": {
          "token": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "name_in_vigiora": {
            "type": "boolean",
            "description": "API 1.51.0. The name is kept by Vigiora, because the camera cannot rename a preset without moving it (Reolink cameras store names themselves)."
          },
          "dwell_seconds": {
            "type": "integer",
            "description": "API 1.56.0. How long a patrol stays on this preset (kept by Vigiora; default 10)."
          }
        }
      },
      "PTZPresetUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 64,
            "description": "The new name; empty clears it. The preset does not move."
          },
          "position": {
            "type": "string",
            "enum": [
              "current"
            ],
            "description": "`current`: store the camera's current position into the preset (its name is kept)."
          },
          "dwell_seconds": {
            "type": "integer",
            "minimum": 3,
            "maximum": 3600,
            "description": "API 1.56.0. Seconds a patrol stays here."
          }
        }
      },
      "PTZPatrolStep": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "preset_token"
        ],
        "properties": {
          "preset_token": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "dwell_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 3,
            "maximum": 3600,
            "description": "`null` = the preset's own dwell time."
          },
          "speed": {
            "type": [
              "number",
              "null"
            ],
            "description": "Move speed above 0 and at most 1 (ONVIF cameras); `null` = the camera's default."
          },
          "ai_label": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Set when the automatic setup suggested this step: what the AI saw there."
          }
        }
      },
      "PTZPatrolSchedule": {
        "type": "object",
        "additionalProperties": false,
        "description": "When the patrol moves (server time). Outside it the camera goes to the home preset and waits.",
        "properties": {
          "days": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 6
            },
            "description": "0 = Sunday; empty = every day."
          },
          "start": {
            "type": "string",
            "description": "HH:MM"
          },
          "end": {
            "type": "string",
            "description": "HH:MM; before start = crosses midnight."
          }
        }
      },
      "PTZPatrol": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "name",
          "all_presets",
          "loop",
          "random_order",
          "home_preset_token",
          "manual_pause_seconds",
          "activity_behavior",
          "pause_on_activity",
          "activity_quiet_seconds",
          "activity_source",
          "schedule",
          "steps",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "all_presets": {
            "type": "boolean",
            "description": "The one-click patrol over every preset (steps follow the preset list)."
          },
          "loop": {
            "type": "boolean"
          },
          "random_order": {
            "type": "boolean"
          },
          "home_preset_token": {
            "type": [
              "string",
              "null"
            ]
          },
          "manual_pause_seconds": {
            "type": "integer",
            "description": "Pause after a person moves the camera; 0 = no pause."
          },
          "activity_behavior": {
            "type": "string",
            "enum": [
              "continue",
              "pause",
              "follow"
            ],
            "description": "On activity: keep patrolling, pause in place, or follow the action (turn toward the motion and hold on it until quiet, then resume)."
          },
          "pause_on_activity": {
            "type": "boolean",
            "description": "Derived from activity_behavior for older clients (true for pause or follow)."
          },
          "activity_quiet_seconds": {
            "type": "integer"
          },
          "activity_source": {
            "type": "string",
            "enum": [
              "auto",
              "motion",
              "onvif"
            ],
            "description": "Where activity comes from: auto (Vigiora motion detection and the camera's own ONVIF events, whichever fires), motion (Vigiora only), onvif (the camera's own detections only — its built-in motion / people / vehicle events over ONVIF). Since 1.75.0."
          },
          "schedule": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PTZPatrolSchedule"
              },
              {
                "type": "null"
              }
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PTZPatrolStep"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PTZPatrolList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PTZPatrol"
            }
          }
        }
      },
      "PTZPatrolInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "loop": {
            "type": "boolean"
          },
          "random_order": {
            "type": "boolean"
          },
          "home_preset_token": {
            "type": "string",
            "maxLength": 64,
            "description": "Empty clears it."
          },
          "manual_pause_seconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3600
          },
          "activity_behavior": {
            "type": "string",
            "enum": [
              "continue",
              "pause",
              "follow"
            ],
            "description": "On activity: continue, pause, or follow the action."
          },
          "pause_on_activity": {
            "type": "boolean",
            "description": "Legacy; activity_behavior takes precedence when both are sent."
          },
          "activity_quiet_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 600
          },
          "activity_source": {
            "type": "string",
            "enum": [
              "auto",
              "motion",
              "onvif"
            ],
            "description": "Where activity comes from (default auto). Since 1.75.0."
          },
          "schedule": {
            "$ref": "#/components/schemas/PTZPatrolSchedule"
          },
          "clear_schedule": {
            "type": "boolean"
          },
          "steps": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "$ref": "#/components/schemas/PTZPatrolStep"
            }
          }
        }
      },
      "PTZPatrolStart": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "patrol_id": {
            "type": "integer"
          },
          "all_presets": {
            "type": "boolean",
            "description": "Start the one-click patrol over every preset instead."
          },
          "once": {
            "type": "boolean",
            "description": "One pass, then the home preset."
          }
        }
      },
      "PTZPatrolStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "active",
          "camera_id"
        ],
        "properties": {
          "active": {
            "type": "boolean"
          },
          "camera_id": {
            "type": "integer"
          },
          "patrol_id": {
            "type": "integer"
          },
          "patrol_name": {
            "type": "string"
          },
          "all_presets": {
            "type": "boolean"
          },
          "once": {
            "type": "boolean"
          },
          "state": {
            "type": "string",
            "enum": [
              "moving",
              "dwelling",
              "paused",
              "outside_schedule",
              "unreachable",
              "no_presets"
            ]
          },
          "pause_reason": {
            "type": "string",
            "enum": [
              "user",
              "manual_move",
              "activity"
            ]
          },
          "step": {
            "type": "integer",
            "description": "1-based"
          },
          "steps": {
            "type": "integer"
          },
          "preset_token": {
            "type": "string"
          },
          "preset_name": {
            "type": "string"
          },
          "next_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the patrol moves on."
          },
          "paused_until": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_error": {
            "type": "string"
          }
        }
      },
      "PTZPatrolScanCandidate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "index",
          "preset_token",
          "existing",
          "has_picture",
          "judged",
          "importance",
          "watch",
          "dwell_seconds"
        ],
        "properties": {
          "index": {
            "type": "integer"
          },
          "preset_token": {
            "type": "string"
          },
          "existing": {
            "type": "boolean",
            "description": "An existing preset (else a position the scan saved)."
          },
          "preset_name": {
            "type": "string"
          },
          "has_picture": {
            "type": "boolean"
          },
          "judged": {
            "type": "boolean"
          },
          "label": {
            "type": "string"
          },
          "importance": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10
          },
          "zones": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "watch": {
            "type": "boolean",
            "description": "Worth a stop in the patrol."
          },
          "dwell_seconds": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "PTZPatrolScanStep": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "index",
          "dwell_seconds"
        ],
        "properties": {
          "index": {
            "type": "integer",
            "description": "The candidate."
          },
          "dwell_seconds": {
            "type": "integer",
            "minimum": 3,
            "maximum": 3600
          },
          "label": {
            "type": "string",
            "maxLength": 64
          }
        }
      },
      "CameraPanorama": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "phase",
          "done",
          "total",
          "started_at",
          "updated_at"
        ],
        "properties": {
          "job_id": {
            "type": "string"
          },
          "camera_id": {
            "type": "integer"
          },
          "phase": {
            "type": "string",
            "enum": [
              "queued",
              "sweeping",
              "stitching",
              "done",
              "failed"
            ]
          },
          "message": {
            "type": "string",
            "description": "Why a capture failed."
          },
          "done": {
            "type": "integer",
            "description": "Frames taken so far (while sweeping)."
          },
          "total": {
            "type": "integer",
            "description": "Frames planned."
          },
          "scan": {
            "$ref": "#/components/schemas/CameraScan"
          },
          "image_url": {
            "type": "string",
            "description": "The panorama picture; set when `phase` is `done`."
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CameraScan": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "kind",
          "angle_basis",
          "frames",
          "stitch_status",
          "width",
          "height",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "panorama",
              "single"
            ]
          },
          "angular_start_deg": {
            "type": [
              "number",
              "null"
            ],
            "description": "Set only when the camera reports absolute pan."
          },
          "angular_end_deg": {
            "type": [
              "number",
              "null"
            ]
          },
          "angle_basis": {
            "type": "string",
            "enum": [
              "relative",
              "absolute"
            ],
            "description": "`relative`: positions are fractions of the measured pan range."
          },
          "frames": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "index",
                "pan_fraction",
                "path"
              ],
              "properties": {
                "index": {
                  "type": "integer"
                },
                "pan_fraction": {
                  "type": "number",
                  "description": "0 = left end stop, 1 = right end stop."
                },
                "pan_deg": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "path": {
                  "type": "string",
                  "description": "The frame file under the server data directory."
                }
              }
            }
          },
          "stitch_status": {
            "type": "string",
            "enum": [
              "stitched",
              "fallback",
              "failed"
            ]
          },
          "confidence": {
            "type": [
              "number",
              "null"
            ],
            "description": "Share of frames the stitcher could join (0..1); 0 for a fallback."
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PTZPatrolScan": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "phase",
          "done",
          "total",
          "candidates",
          "started_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "camera_id": {
            "type": "integer"
          },
          "phase": {
            "type": "string",
            "enum": [
              "limits",
              "looking",
              "deciding",
              "proposal",
              "accepted",
              "cancelled",
              "failed"
            ]
          },
          "reason": {
            "type": "string",
            "enum": [
              "no_movement",
              "ai_unavailable",
              "ai_not_connected",
              "no_credits",
              "manual_move",
              "camera_error"
            ]
          },
          "failed_phase": {
            "type": "string",
            "enum": [
              "precheck",
              "limits",
              "looking",
              "deciding"
            ],
            "description": "Set when `phase` is `failed`: the phase the scan stopped in. `precheck` means it was refused before the camera moved (no Vigiora AI: `reason: ai_not_connected`)."
          },
          "message": {
            "type": "string"
          },
          "limits": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "method": {
                "type": "string"
              },
              "pan_tilt": {
                "type": "boolean"
              },
              "zoom": {
                "type": "boolean"
              },
              "absolute": {
                "type": "boolean"
              },
              "max_presets": {
                "type": "integer"
              },
              "pan_seconds": {
                "type": "number",
                "description": "The full pan range at full speed, found by moving to the end stops."
              },
              "positions": {
                "type": "integer",
                "description": "Pictures planned."
              },
              "ai_cap": {
                "type": "integer",
                "description": "At most this many pictures are judged by AI."
              },
              "strategy": {
                "type": "string",
                "enum": [
                  "sweep",
                  "presets"
                ]
              }
            }
          },
          "done": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PTZPatrolScanCandidate"
            }
          },
          "proposal": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name",
              "steps",
              "total_seconds"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "steps": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PTZPatrolScanStep"
                }
              },
              "total_seconds": {
                "type": "integer"
              }
            }
          },
          "patrol_id": {
            "type": "integer"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PTZPatrolScanAccept": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "steps": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "$ref": "#/components/schemas/PTZPatrolScanStep"
            }
          },
          "start": {
            "type": "boolean",
            "description": "Start the patrol right away."
          }
        }
      },
      "PTZPresetPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PTZPreset"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Timeline": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "from",
          "to",
          "spans"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "spans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimelineSpan"
            }
          }
        }
      },
      "TimelineSpan": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "start",
          "end",
          "recording_count",
          "in_progress"
        ],
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "recording_count": {
            "type": "integer",
            "minimum": 1
          },
          "in_progress": {
            "type": "boolean",
            "description": "API 1.98.0. `true` when the span ends in the segment the recorder is still writing (counted in `recording_count`); `end` is then that file's last write."
          }
        }
      },
      "PreviewList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "from",
          "to",
          "interval_seconds",
          "columns",
          "data"
        ],
        "description": "API 1.116.0. The preview sprites of a camera's recordings in a range.",
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "interval_seconds": {
            "type": "integer",
            "description": "The usual seconds between two pictures (a long recording may use more: see each item)."
          },
          "columns": {
            "type": "integer",
            "description": "Pictures per sprite row."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PreviewItem"
            }
          }
        }
      },
      "PreviewItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "recording_id",
          "start",
          "end",
          "interval_seconds",
          "columns",
          "count",
          "ready",
          "tile_width",
          "tile_height",
          "sprite_url"
        ],
        "description": "API 1.116.0. One recording's preview sprite.",
        "properties": {
          "recording_id": {
            "type": "integer"
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "interval_seconds": {
            "type": "integer",
            "minimum": 1,
            "description": "Seconds between two pictures."
          },
          "columns": {
            "type": "integer",
            "minimum": 1
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "description": "Pictures in the sprite."
          },
          "ready": {
            "type": "boolean",
            "description": "The sprite exists now; false: it is made on the first request of `sprite_url`."
          },
          "tile_width": {
            "type": "integer",
            "description": "Width of one picture in pixels (160)."
          },
          "tile_height": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Height of one picture in pixels; null until the sprite is made."
          },
          "sprite_url": {
            "type": "string",
            "description": "`GET /recordings/{recording_id}/preview`."
          }
        }
      },
      "TimelineMarks": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "bucket_seconds",
          "truncated",
          "data"
        ],
        "description": "API 1.116.0. What happened on cameras in a range, folded for a timeline.",
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "bucket_seconds": {
            "type": "integer",
            "minimum": 1
          },
          "truncated": {
            "type": "boolean",
            "description": "More than 3000 marks; the later ones were cut."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimelineMark"
            }
          }
        }
      },
      "TimelineMark": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "kind",
          "start",
          "end",
          "count",
          "alert",
          "labels",
          "rep",
          "thumbnail_url",
          "ids",
          "text"
        ],
        "description": "API 1.116.0. Events of one camera and kind folded together.",
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "person",
              "vehicle",
              "animal",
              "face",
              "plate",
              "speech",
              "sound",
              "guardian",
              "alert",
              "other"
            ]
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "description": "Events folded into the mark."
          },
          "alert": {
            "type": "boolean",
            "description": "A member raised an alert."
          },
          "labels": {
            "type": "array",
            "maxItems": 5,
            "description": "The labels seen, most frequent first (`face:<name>`, `plate:<text>`, a class, `guardian`, `speech`).",
            "items": {
              "type": "string"
            }
          },
          "rep": {
            "$ref": "#/components/schemas/TimelineMarkRep"
          },
          "thumbnail_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "A 160 px picture of `rep` (`GET /alerts/{alert_id}/snapshot` or `GET /guardian/entries/{entry_id}/frame` with `width=160`); null when it has none."
          },
          "ids": {
            "type": "array",
            "maxItems": 50,
            "description": "Ids of the members of `rep.type`.",
            "items": {
              "type": "integer"
            }
          },
          "text": {
            "type": [
              "string",
              "null"
            ],
            "description": "The start of the Guardian description (in the request's language) or of the speech; null for other kinds."
          }
        }
      },
      "TimelineMarkRep": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id"
        ],
        "description": "The member a mark shows.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "detection",
              "guardian_entry",
              "transcript",
              "hal_event"
            ],
            "description": "`detection`: an alert id (`GET /alerts/{alert_id}`); `guardian_entry`: `GET /guardian/entries/{entry_id}`; `transcript`: a speech transcript segment; `hal_event`: a runner report without a stored picture."
          },
          "id": {
            "type": "integer"
          }
        }
      },
      "RecordingEvents": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "total",
          "facets",
          "data",
          "next_cursor"
        ],
        "description": "API 1.117.0. One page of the Recordings search.",
        "properties": {
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Every result of the search (first page only)."
          },
          "facets": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RecordingFacets"
              },
              {
                "type": "null"
              }
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecordingEvent"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RecordingFacets": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "show",
          "attention",
          "labels",
          "people",
          "triggers",
          "vehicle_types",
          "cameras",
          "rooms"
        ],
        "description": "API 1.117.0. Counts per filter value, each with every other filter applied but not its own. Values with no results are left out.",
        "properties": {
          "show": {
            "type": "object",
            "description": "`all` and `events`.",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "attention": {
            "type": "integer",
            "description": "Alerts not acknowledged yet: the alert bell's number with the other filters applied, whatever the time."
          },
          "labels": {
            "type": "object",
            "description": "`person`, `vehicle`, `animal`, `other`.",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "people": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecordingFacetPerson"
            }
          },
          "triggers": {
            "type": "object",
            "description": "`motion`, `sound`, `doorbell`, `sensor`, `line_zone`, `guardian`, `addon` (one event can have several).",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "vehicle_types": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "cameras": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecordingFacetPlace"
            }
          },
          "rooms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecordingFacetPlace"
            }
          }
        }
      },
      "RecordingFacetPerson": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "unknown",
          "count"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The face name; `unknown` when nobody enrolled matched."
          },
          "unknown": {
            "type": "boolean"
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "RecordingFacetPlace": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "count"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "RecordingEvent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "camera_id",
          "camera_name",
          "at",
          "moment",
          "kind",
          "label_group",
          "label",
          "person",
          "plate",
          "vehicle_type",
          "triggers",
          "confidence",
          "is_alert",
          "severity",
          "acknowledged",
          "picture_url",
          "pictures",
          "count",
          "track_id",
          "addon",
          "description",
          "trigger"
        ],
        "description": "API 1.117.0. A detection (an alert id, `GET /alerts/{alert_id}`) or a Guardian entry (`GET /guardian/entries/{entry_id}`).",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "detection",
              "guardian_entry"
            ]
          },
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "camera_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "The time results are sorted by."
          },
          "moment": {
            "type": "string",
            "format": "date-time",
            "description": "Where to open the recording (a Guardian entry's frame or clip start when known)."
          },
          "kind": {
            "type": "string",
            "enum": [
              "person",
              "vehicle",
              "animal",
              "face",
              "plate",
              "speech",
              "sound",
              "guardian",
              "alert",
              "other"
            ]
          },
          "label_group": {
            "type": "string",
            "enum": [
              "person",
              "vehicle",
              "animal",
              "other"
            ]
          },
          "label": {
            "type": "string",
            "description": "The stored label (`face:<name>`, `plate:<text>`, a class, `guardian:<rule>`…); a Guardian entry: the label that started it or empty."
          },
          "person": {
            "type": [
              "string",
              "null"
            ],
            "description": "A recognised face's name, `unknown`, or null."
          },
          "plate": {
            "type": [
              "string",
              "null"
            ],
            "description": "The plate as read."
          },
          "vehicle_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "triggers": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "motion",
                "sound",
                "doorbell",
                "sensor",
                "line_zone",
                "guardian",
                "addon"
              ]
            }
          },
          "confidence": {
            "type": [
              "number",
              "null"
            ],
            "description": "Null for a Guardian entry."
          },
          "is_alert": {
            "type": "boolean",
            "description": "The camera's alert rules promote this label."
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "acknowledged": {
            "type": "boolean",
            "description": "Always true for a Guardian entry."
          },
          "picture_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "A 480 px picture (`GET /alerts/{alert_id}/snapshot` or `GET /guardian/entries/{entry_id}/frame`)."
          },
          "pictures": {
            "type": "array",
            "maxItems": 20,
            "description": "The pictures of the card's detections, oldest first (the newest 20); empty for a Guardian entry.",
            "items": {
              "$ref": "#/components/schemas/RecordingPicture"
            }
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "description": "The detections this card stands for (counted over at most the 24 hours before it); 1 for a Guardian entry."
          },
          "track_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "addon": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AlertAddon"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "A Guardian entry's description, in the request's language."
          },
          "trigger": {
            "type": [
              "string",
              "null"
            ],
            "description": "What started a Guardian analysis (`motion`, `detection`); null for a detection."
          }
        }
      },
      "RecordingCardsAction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "alert_ids"
        ],
        "description": "API 1.117.0. Cards by any of their detections (usually the card's `id`).",
        "properties": {
          "alert_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "RecordingCardsSave": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "cards"
        ],
        "description": "API 1.117.0. Cards to save, each with an optional item name; one folder for all.",
        "properties": {
          "cards": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "alert_id"
              ],
              "properties": {
                "alert_id": {
                  "type": "integer"
                },
                "name": {
                  "type": "string",
                  "maxLength": 200,
                  "description": "The items' name (the card's title); default the label."
                }
              }
            }
          },
          "folder": {
            "type": "string",
            "description": "Library folder (`/`-separated); empty = the top level."
          }
        }
      },
      "RecordingCardDone": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "alert_id",
          "count",
          "done"
        ],
        "properties": {
          "alert_id": {
            "type": "integer",
            "description": "The id sent."
          },
          "count": {
            "type": "integer",
            "description": "The detections of the card now."
          },
          "done": {
            "type": "integer",
            "description": "Detections acknowledged or deleted, or pictures saved."
          }
        }
      },
      "RecordingCardsResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "detection_count",
          "done_count",
          "cards",
          "not_found_ids",
          "forbidden_ids"
        ],
        "description": "API 1.117.0. What a whole-card action did.",
        "properties": {
          "detection_count": {
            "type": "integer",
            "description": "The detections of the cards now (each once)."
          },
          "done_count": {
            "type": "integer"
          },
          "cards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecordingCardDone"
            }
          },
          "not_found_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "forbidden_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "library_item_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Save only: the new items."
          }
        }
      },
      "RecordingPicture": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "alert_id",
          "url"
        ],
        "properties": {
          "alert_id": {
            "type": "integer"
          },
          "url": {
            "type": "string"
          }
        }
      },
      "AreaRect": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "x",
          "y",
          "width",
          "height"
        ],
        "description": "A rectangle in fractions (0 to 1) of the picture, from its top left corner.",
        "properties": {
          "x": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "y": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "width": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "height": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        }
      },
      "AreaSearchCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "area"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "At most 7 days after `from`; a time in the future is cut to now."
          },
          "area": {
            "$ref": "#/components/schemas/AreaRect"
          },
          "sensitivity": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "description": "How small a change counts. Default `medium`."
          }
        }
      },
      "AreaChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "start",
          "end",
          "at",
          "kind",
          "score",
          "box",
          "before_at",
          "after_at",
          "across_gap"
        ],
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "When the change first showed."
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "description": "When it last showed."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was strongest."
          },
          "kind": {
            "type": "string",
            "enum": [
              "changed",
              "activity"
            ],
            "description": "`changed`: the area looks different afterwards. `activity`: something stayed in the area for a while and left it as it was."
          },
          "score": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "The share of the area that changed."
          },
          "box": {
            "$ref": "#/components/schemas/AreaRect"
          },
          "before_at": {
            "type": "string",
            "format": "date-time",
            "description": "A moment that shows the area before the change."
          },
          "after_at": {
            "type": "string",
            "format": "date-time",
            "description": "A moment that shows it after."
          },
          "across_gap": {
            "type": "boolean",
            "description": "The change happened while nothing was recorded."
          }
        }
      },
      "HDRecording": {
        "type": "object",
        "additionalProperties": false,
        "description": "One HD clip of a period with movement (API 1.100.0).",
        "required": [
          "id",
          "camera_id",
          "start_time",
          "end_time",
          "duration_seconds",
          "size_bytes",
          "media_url"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "camera_id": {
            "type": "integer"
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "duration_seconds": {
            "type": "number"
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64"
          },
          "media_url": {
            "type": "string",
            "description": "The clip as MP4 (`GET`, same credentials)."
          }
        }
      },
      "HDRecordingList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HDRecording"
            }
          }
        }
      },
      "AreaSearch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "status",
          "progress",
          "from",
          "to",
          "area",
          "sensitivity",
          "changes",
          "recordings_total",
          "recordings_done",
          "recordings_skipped",
          "seconds_searched",
          "lighting_skipped",
          "truncated",
          "error",
          "created_at",
          "finished_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "camera_id": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "done",
              "failed",
              "canceled"
            ]
          },
          "progress": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "area": {
            "$ref": "#/components/schemas/AreaRect"
          },
          "sensitivity": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "changes": {
            "type": "array",
            "description": "Oldest first; at most 500 (`truncated` says when there were more).",
            "items": {
              "$ref": "#/components/schemas/AreaChange"
            }
          },
          "recordings_total": {
            "type": "integer",
            "minimum": 0,
            "description": "Recording files in the range."
          },
          "recordings_done": {
            "type": "integer",
            "minimum": 0
          },
          "recordings_skipped": {
            "type": "integer",
            "minimum": 0,
            "description": "Files that could not be read (deleted since, or damaged)."
          },
          "seconds_searched": {
            "type": "number",
            "minimum": 0,
            "description": "How much recording was looked at."
          },
          "lighting_skipped": {
            "type": "integer",
            "minimum": 0,
            "description": "Changes of the whole picture at once (lights, night mode) left out of `changes`."
          },
          "truncated": {
            "type": "boolean"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Alert": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "camera_name",
          "label",
          "confidence",
          "bbox",
          "track_id",
          "acknowledged",
          "is_alert",
          "severity",
          "has_snapshot",
          "source",
          "detected_at",
          "speaker",
          "addon"
        ],
        "properties": {
          "addon": {
            "description": "API 1.106.0. The community add-on that reported the alert (a detection it posted with the `alerts:write` scope; its `source` is then `addon-<id>`). Set by the server, never from a request body, unlike `source`; `null` for every other alert. `name` is the installed add-on's name, or its id once it was removed.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/AlertAddon"
              },
              {
                "type": "null"
              }
            ]
          },
          "speaker": {
            "description": "API 1.54.0. The alert's playback on camera speakers (the newest; a played one wins); `null` when none was tried.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/AlertSpeakerSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "camera_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": "string",
            "description": "Object label (`person`, `car`, …) or `face:<name>`."
          },
          "confidence": {
            "type": "number"
          },
          "bbox": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BBox"
              },
              {
                "type": "null"
              }
            ]
          },
          "track_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "acknowledged": {
            "type": "boolean"
          },
          "is_alert": {
            "type": "boolean",
            "description": "The label is promoted to an alert by the camera's alert rules."
          },
          "severity": {
            "type": "string",
            "description": "`normal` unless an alert rule sets another (open set)."
          },
          "has_snapshot": {
            "type": "boolean"
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "The external system that reported the alert (`POST /alerts`); `null` for this server's own detections."
          },
          "detected_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AlertAddon": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name"
        ],
        "description": "The add-on behind an alert (API 1.106.0).",
        "properties": {
          "id": {
            "type": "string",
            "description": "The add-on's manifest id."
          },
          "name": {
            "type": "string"
          }
        }
      },
      "BBox": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "x",
          "y",
          "w",
          "h"
        ],
        "description": "Bounding box, normalised to the frame (0–1).",
        "properties": {
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "w": {
            "type": "number"
          },
          "h": {
            "type": "number"
          }
        }
      },
      "AlertPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Alert"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "BulkAcknowledge": {
        "type": "object",
        "additionalProperties": false,
        "description": "Exactly one of `ids` and `before`.",
        "properties": {
          "ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "integer"
            }
          },
          "before": {
            "type": "string",
            "format": "date-time"
          },
          "camera_id": {
            "type": "integer",
            "minimum": 1,
            "description": "With `before` only."
          }
        }
      },
      "BulkAcknowledgeResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "acknowledged_count",
          "not_found_ids",
          "forbidden_ids"
        ],
        "properties": {
          "acknowledged_count": {
            "type": "integer",
            "minimum": 0
          },
          "not_found_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "forbidden_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "AlertCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "label",
          "source"
        ],
        "properties": {
          "camera_id": {
            "type": "integer",
            "minimum": 1
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "What was detected (`door_open`, `glass_break`, `person`, …), without control characters or line breaks. Not `face:…`."
          },
          "source": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$",
            "description": "The reporting system, lower-case letters, digits, `.`, `_` and `-` (`door-sensor`, `acme.analytics`)."
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Default 1."
          },
          "bbox": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BBox"
              },
              {
                "type": "null"
              }
            ]
          },
          "detected_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it happened (default now; from 7 days ago to 5 minutes in the future)."
          }
        }
      },
      "CameraOrder": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_ids"
        ],
        "description": "Camera ids in order (first = first on the Monitors page). API 1.102.0.",
        "properties": {
          "camera_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 5000,
            "description": "Distinct ids (a repeated id is `400 validation_error`).",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          }
        }
      },
      "BulkCameraUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_ids"
        ],
        "description": "At least one of `enabled`, `recording_enabled` and `ai_enabled`.",
        "properties": {
          "camera_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "recording_enabled": {
            "type": "boolean"
          },
          "ai_enabled": {
            "type": "boolean"
          }
        }
      },
      "BulkCameraUpdateResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "succeeded_count",
          "failed_count",
          "results"
        ],
        "properties": {
          "succeeded_count": {
            "type": "integer",
            "minimum": 0
          },
          "failed_count": {
            "type": "integer",
            "minimum": 0
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BulkCameraOutcome"
            }
          }
        }
      },
      "BulkCameraOutcome": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "ok",
          "error",
          "warnings"
        ],
        "description": "`ok`: the camera was changed. When `enabled`/`recording_enabled` applied but the AI switch failed, `ok` is true and the AI error is in `warnings`.",
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "ok": {
            "type": "boolean"
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ErrorObject"
            }
          },
          "error": {
            "description": "Why this camera was not changed (the error the single-camera operation answers), `null` when `ok`.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ErrorObject"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ErrorObject": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "details"
        ],
        "description": "The `error` object of the error envelope.",
        "properties": {
          "code": {
            "$ref": "#/components/schemas/ErrorCode"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "object"
          }
        }
      },
      "Face": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "camera_id",
          "auto_enrolled",
          "pending",
          "confidence",
          "has_photo",
          "has_crop",
          "created_at",
          "bbox"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Opaque; `det-<alert id>` for a pending face."
          },
          "name": {
            "type": "string"
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The camera the face was enrolled from (or seen on, when pending)."
          },
          "auto_enrolled": {
            "type": "boolean",
            "description": "Enrolled automatically by a client node."
          },
          "pending": {
            "type": "boolean",
            "description": "Seen in the last 24 hours but not enrolled."
          },
          "confidence": {
            "type": [
              "number",
              "null"
            ],
            "description": "Match confidence of a pending face; `null` for enrolled ones."
          },
          "has_photo": {
            "type": "boolean"
          },
          "has_crop": {
            "type": "boolean",
            "description": "API 1.33.2. A pending face whose runner sent the face crop (`getFaceCrop`)."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "bbox": {
            "description": "API 1.33.2. Where the face is in the photo (fractions of the frame, x, y = top-left); pending faces only.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/FaceBox"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "FaceBox": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "x",
          "y",
          "w",
          "h"
        ],
        "properties": {
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "w": {
            "type": "number"
          },
          "h": {
            "type": "number"
          }
        }
      },
      "FacePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Face"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "FrameBox": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "x",
          "y",
          "w",
          "h"
        ],
        "properties": {
          "x": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "y": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "w": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "h": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        }
      },
      "RecomputeFramesRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "default": 7,
            "description": "Entries observed in the last `days` days."
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Only this camera's entries."
          },
          "entry_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Only these entries (still within `days`, and of `camera_id` when given)."
          },
          "dry_run": {
            "type": "boolean",
            "default": false,
            "description": "Report what would change without changing anything."
          }
        }
      },
      "RecomputeClipsRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "default": 7,
            "description": "Entries observed in the last `days` days."
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Only this camera's entries."
          },
          "entry_ids": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Only these entries (still within `days`)."
          },
          "dry_run": {
            "type": "boolean",
            "default": false,
            "description": "Report what would change without changing anything."
          }
        }
      },
      "RecomputeClipsReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "examined",
          "no_evidence",
          "covered",
          "unchanged",
          "no_recording",
          "updated",
          "failed",
          "dry_run",
          "entries"
        ],
        "properties": {
          "examined": {
            "type": "integer",
            "description": "Entries with a clip in the period."
          },
          "no_evidence": {
            "type": "integer",
            "description": "Entries whose trigger time is unknown (no detector window stored, no time in the clip's name)."
          },
          "covered": {
            "type": "integer",
            "description": "Entries whose old clip already holds the window."
          },
          "unchanged": {
            "type": "integer",
            "description": "Entries whose clip was already cut with the pre-roll (`clip_reason` `preroll_recording`, `preroll_buffer` or `extended`)."
          },
          "no_recording": {
            "type": "integer",
            "description": "Entries whose window no recording covers."
          },
          "updated": {
            "type": "integer",
            "description": "Clips re-cut (0 on a dry run)."
          },
          "failed": {
            "type": "integer",
            "description": "Entries whose clip is missing or could not be cut."
          },
          "dry_run": {
            "type": "boolean"
          },
          "entries": {
            "type": "array",
            "description": "The entries whose clip changes (or would, on a dry run).",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "camera_id",
                "clip_start",
                "clip_end",
                "previous_clip_start",
                "previous_clip_end",
                "updated"
              ],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "camera_id": {
                  "type": "integer"
                },
                "clip_start": {
                  "type": "string",
                  "format": "date-time"
                },
                "clip_end": {
                  "type": "string",
                  "format": "date-time"
                },
                "previous_clip_start": {
                  "type": "string",
                  "format": "date-time"
                },
                "previous_clip_end": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      },
      "GuardianClipSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "preroll_seconds"
        ],
        "properties": {
          "preroll_seconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10,
            "description": "How many seconds before the motion that triggered it a Guardian clip starts (default 3). A camera's `guardian_clip_preroll_sec` overrides it."
          }
        }
      },
      "RecomputeFramesReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "examined",
          "no_evidence",
          "unchanged",
          "updated",
          "failed",
          "dry_run",
          "entries"
        ],
        "properties": {
          "examined": {
            "type": "integer",
            "description": "Entries with a clip in the period."
          },
          "no_evidence": {
            "type": "integer",
            "description": "Entries without detector evidence in their clip (left as they are)."
          },
          "unchanged": {
            "type": "integer",
            "description": "Entries whose picture already is the choice."
          },
          "updated": {
            "type": "integer",
            "description": "Pictures replaced (0 on a dry run)."
          },
          "failed": {
            "type": "integer",
            "description": "Entries whose clip is missing or whose frame could not be cut."
          },
          "dry_run": {
            "type": "boolean"
          },
          "entries": {
            "type": "array",
            "description": "The entries whose picture changes (or would, on a dry run).",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "camera_id",
                "frame_time",
                "frame_reason",
                "frame_box",
                "previous_frame_time",
                "updated"
              ],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "camera_id": {
                  "type": "integer"
                },
                "frame_time": {
                  "type": "string",
                  "format": "date-time"
                },
                "frame_reason": {
                  "type": "string",
                  "enum": [
                    "best_detection",
                    "presence"
                  ]
                },
                "frame_box": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/FrameBox"
                    }
                  ]
                },
                "previous_frame_time": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "updated": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      },
      "GuardianEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "camera_name",
          "description",
          "audio_transcript",
          "model",
          "has_frame",
          "has_clip",
          "observed_at",
          "descriptions",
          "occurred_at",
          "created_at",
          "detections",
          "detector_checked",
          "unconfirmed_alerts",
          "person_present_seconds",
          "frame_time",
          "frame_reason",
          "frame_box",
          "clip_start",
          "clip_end",
          "clip_reason",
          "trigger",
          "trigger_label"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "camera_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": "string",
            "description": "The AI's description of the scene, as plain text in the requested language (English when it has no text in that language; never the stored JSON)."
          },
          "descriptions": {
            "type": [
              "object",
              "null"
            ],
            "description": "Every language of the description: ISO-639-1 code → text (`null` when stored as plain text)."
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it happened (RFC 3339, UTC). Same as `observed_at`."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the entry was logged (RFC 3339, UTC)."
          },
          "detections": {
            "type": "array",
            "description": "What the camera's object detectors (Vision Engine services) reported in the clip's window (from 5 s before to 2 s after it), as the AI was given them to confirm its description against, best confidence first. Empty when none, or when the camera's descriptions do not use detections (`guardian_use_detections`).",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "label",
                "count",
                "max_confidence",
                "tracks"
              ],
              "properties": {
                "label": {
                  "type": "string",
                  "description": "A detector label (`person`, `car`, `face`, `licence plate`, …)."
                },
                "count": {
                  "type": "integer",
                  "description": "The most seen at one moment."
                },
                "max_confidence": {
                  "type": "number"
                },
                "tracks": {
                  "type": "integer",
                  "description": "Distinct tracked objects."
                }
              }
            }
          },
          "detector_checked": {
            "type": "boolean",
            "description": "A person-capable object detector (`hal-objects` asked to find people, `hal-smart-motion`, `hal-weapon`) was running on the camera for the whole clip, so an entry without a `person` detection means it saw no people; the AI was told so. `false` when no such detector is assigned, it was not running, or the camera's descriptions do not use detections. API 1.13.0."
          },
          "person_present_seconds": {
            "type": [
              "number",
              "null"
            ],
            "description": "How long a person was in view, in seconds, from 2 s before to 2 s after the clip, according to the person detector's presence report (`hal-objects` reports whether someone is in view, moving or not). `0` means the detector watched the whole clip and nobody was in view. `null` when no detector that reports presence covered the clip (older runners, the stream dropped, or the camera's descriptions do not use detections). API 1.14.0."
          },
          "frame_time": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the entry's picture (`/guardian/entries/{entry_id}/frame`) was taken. The picture is the clip frame that shows best what the camera's object detectors saw (see `frame_reason`). `null` on entries made before API 1.20.0 and not recomputed. API 1.20.0."
          },
          "frame_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "best_detection",
              "presence",
              "default",
              null
            ],
            "description": "Why that frame is the picture. `best_detection`, the detection of the label that matters (a person when the entry matched an alert rule about people) with the best score, favouring a large box not cut off at the frame's edge (analytics tracks, then detector reports); `presence`, the middle of the longest time the label was in view (presence report). A moment up to 2 s outside the clip is cut from the recording; `default`, no detector evidence, the frame the AI named as showing the event best (else the middle of the clip). `null` when not recorded. API 1.20.0."
          },
          "frame_box": {
            "description": "The chosen detection's box in the picture, normalised to the frame (0..1; `x`, `y` the top-left corner), for highlighting it on the full-size picture. `null` unless `frame_reason` is `best_detection` and the detector reported a normalised box. API 1.20.0.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FrameBox"
              }
            ]
          },
          "clip_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the entry's clip (`/guardian/entries/{entry_id}/clip`) starts. A clip starts a few seconds before the motion that triggered it (the pre-roll, `guardian_clip_preroll_sec` on the camera, else `/guardian/clips/settings`), so the subject that caused it is in view. `null` on entries made before API 1.24.0. API 1.24.0."
          },
          "clip_end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the entry's clip ends (at most 20 s after `clip_start`). `null` with `clip_start`. API 1.24.0."
          },
          "clip_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "preroll_recording",
              "preroll_buffer",
              "live",
              "extended",
              null
            ],
            "description": "How the clip was made. `preroll_recording`, cut from the camera's continuous recording, starting before the trigger; `preroll_buffer`, from the in-memory buffer of the camera's motion stream (a camera without continuous recording); `live`, recorded from the trigger on (no recording or buffer held the pre-roll); `extended`, widened by up to 5 s on either side to cover what the camera's object detectors saw just outside it. `null` with `clip_start`. API 1.24.0."
          },
          "trigger": {
            "type": "string",
            "enum": [
              "motion",
              "detection"
            ],
            "description": "What started the analysis. `motion`, the motion detector confirmed motion (also a manual capture, and every entry made before API 1.97.0); `detection`, the camera's object detector saw a person, a vehicle (car, truck, bus, motorcycle, bicycle) or an animal (cat, dog) — e.g. on a patrolling PTZ camera, whose motion detector is paused while it moves. At most one detection-started analysis per camera a minute, and none within a minute of a motion-started one. API 1.97.0."
          },
          "trigger_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "The detector label that started the analysis (`person`, `car`, `cat`…) when `trigger` is `detection`; `null` otherwise. API 1.97.0."
          },
          "unconfirmed_alerts": {
            "type": "array",
            "description": "Alert rules about people the AI matched on this clip that did not alert, because the person detector watched the clip and saw no person (the rule's `require_detector_confirmation`). Empty when none. API 1.13.0.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "alert_rule_id",
                "name"
              ],
              "properties": {
                "alert_rule_id": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "audio_transcript": {
            "type": [
              "string",
              "null"
            ],
            "description": "What was heard, when the camera has audio."
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "has_frame": {
            "type": "boolean"
          },
          "has_clip": {
            "type": "boolean"
          },
          "observed_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "GuardianEntryPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GuardianEntry"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "GuardianDeleteIds": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ids"
        ],
        "properties": {
          "ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 200,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "force": {
            "type": "boolean",
            "description": "Admins only. Delete protected or shared entries too, revoking their share links.",
            "default": false
          }
        }
      },
      "GuardianTrashIds": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ids"
        ],
        "properties": {
          "ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 200,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          }
        }
      },
      "GuardianBulkResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "succeeded",
          "failed"
        ],
        "properties": {
          "succeeded": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "failed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GuardianBulkFailure"
            }
          }
        }
      },
      "GuardianBulkFailure": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "code",
          "message",
          "details"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "code": {
            "$ref": "#/components/schemas/ErrorCode"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "object"
          }
        }
      },
      "GuardianTrashItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entry",
          "deleted_at",
          "deleted_by",
          "purge_at",
          "alert_count"
        ],
        "properties": {
          "entry": {
            "$ref": "#/components/schemas/GuardianEntry"
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_by": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "username"
                ],
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "username": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "purge_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the purge job removes it for good."
          },
          "alert_count": {
            "type": "integer",
            "description": "The alerts deleted with it (restored with it)."
          }
        }
      },
      "GuardianTrashPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GuardianTrashItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "GuardianTrashSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "retention_days"
        ],
        "properties": {
          "retention_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 90,
            "description": "Days a deleted Guardian entry stays restorable (default 7)."
          }
        }
      },
      "GuardianSearchHit": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entry",
          "match",
          "similarity"
        ],
        "properties": {
          "entry": {
            "$ref": "#/components/schemas/GuardianEntry"
          },
          "match": {
            "type": "string",
            "enum": [
              "semantic",
              "keyword"
            ]
          },
          "similarity": {
            "type": [
              "number",
              "null"
            ],
            "description": "0–1 for a semantic match; `null` for a keyword match."
          }
        }
      },
      "GuardianSearchHitPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GuardianSearchHit"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Always `null` (one ranked page)."
          }
        }
      },
      "GuardianChat": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Ask about this camera."
          },
          "conversation_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Store the exchange in this web-app conversation of yours."
          },
          "history": {
            "type": "array",
            "maxItems": 20,
            "description": "Earlier turns, oldest first (the last 10 are used). Give each turn's `at` when the turns come from a stored conversation.",
            "items": {
              "$ref": "#/components/schemas/GuardianChatTurn"
            }
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "description": "IANA time zone for the times in the answer (`Europe/Rome`). Default Asia/Bangkok."
          }
        }
      },
      "GuardianChatTurn": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "role",
          "text"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ]
          },
          "text": {
            "type": "string",
            "maxLength": 4000
          },
          "at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the turn was sent (API 1.93.0). Turns older than a few minutes are shown to Guardian with their time, and a thread reopened later is answered from the records again rather than from the old exchange. Omit it for turns of the present exchange."
          }
        }
      },
      "GuardianChatReply": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reply",
          "tool_calls",
          "refs",
          "pending_actions"
        ],
        "properties": {
          "pending_actions": {
            "type": "array",
            "description": "API 1.113.0. Actions Guardian wants to take that wait for the user (human in the loop): nothing in them ran. The user approves or denies each in the Vigiora app; a caller of this operation cannot. Empty when none.",
            "items": {
              "$ref": "#/components/schemas/GuardianPendingAction"
            }
          },
          "reply": {
            "type": "string",
            "description": "The answer. Since 1.34.2 each sighting it cites carries a reference token where it is cited — `[[log:ID]]` (a Guardian entry), `[[det:ID]]` (a detection) or `[[t:CAMERA_ID:RFC3339]]` (a time on a camera with no entry) — resolved in `refs`; strip the tokens to show plain text."
          },
          "tool_calls": {
            "type": "array",
            "description": "The tools Guardian used, in order (their results stay on the server).",
            "items": {
              "$ref": "#/components/schemas/GuardianToolCall"
            }
          },
          "refs": {
            "type": "array",
            "description": "The moments the reply cites (1.34.2), one per token in `reply`, in order of first use. Only tokens that match rows the tools returned are kept.",
            "items": {
              "$ref": "#/components/schemas/GuardianChatRef"
            }
          }
        }
      },
      "GuardianPendingAction": {
        "type": "object",
        "additionalProperties": false,
        "description": "API 1.113.0. An action Guardian chat waits on the user for. It belongs to the user who chatted, the conversation, the tool and these exact arguments; it runs at most once, only when that user approves it in a session, before `expires_at` (5 minutes; a server restart drops it).",
        "required": [
          "id",
          "tool",
          "summary",
          "details",
          "args",
          "args_hash",
          "state",
          "conversation_id",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{32}$"
          },
          "tool": {
            "type": "string",
            "description": "The chat tool, e.g. `start_siren`, `set_camera_alert`, `control_device`."
          },
          "summary": {
            "type": "string",
            "description": "What will happen, in words."
          },
          "details": {
            "type": "object",
            "description": "The key arguments in words (`camera_name`, `seconds`, `name`, `watches`, `severity`, `sensitive`), when they apply."
          },
          "args": {
            "type": "object",
            "description": "The stored arguments that will run."
          },
          "args_hash": {
            "type": "string",
            "description": "SHA-256 (hex) of the tool and its arguments. Approving with another `args_hash` is refused."
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "approved",
              "failed",
              "denied",
              "expired"
            ]
          },
          "conversation_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "GuardianPendingApprove": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "args_hash": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `args_hash` of the action the user was shown; refused (`409 conflict`) when it is not the stored one."
          }
        }
      },
      "GuardianPendingDecision": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "tool",
          "state",
          "reply",
          "result"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "tool": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "approved",
              "failed",
              "denied"
            ],
            "description": "`failed`: approved, but the action could not be done (`reply` says why)."
          },
          "reply": {
            "type": "string",
            "description": "What happened, in words. It is also added to the action's conversation as Guardian's answer."
          },
          "result": {
            "description": "The tool's own result (`null` when denied).",
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "GuardianChatRef": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "token",
          "kind",
          "id",
          "camera_id",
          "camera_name",
          "at",
          "label",
          "has_clip",
          "has_frame"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "The token as it appears in `reply`, e.g. `[[log:1234]]`."
          },
          "kind": {
            "type": "string",
            "enum": [
              "log",
              "det",
              "t"
            ],
            "description": "`log` — a Guardian entry (`id` is the entry id; see `GET /api/v1/guardian/entries/{entry_id}` and its clip/frame); `det` — a detection (`id` is the detection id); `t` — a time with no entry (open the camera's recording at `at`)."
          },
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "camera_id": {
            "type": "integer"
          },
          "camera_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the moment is, RFC 3339 in the caller's timezone."
          },
          "label": {
            "type": "string",
            "description": "What was seen, heard or detected (may be empty)."
          },
          "has_clip": {
            "type": "boolean"
          },
          "has_frame": {
            "type": "boolean"
          }
        }
      },
      "GuardianToolCall": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tool",
          "args"
        ],
        "properties": {
          "tool": {
            "type": "string",
            "description": "Tool name (open set)."
          },
          "args": {
            "type": "object"
          }
        }
      },
      "GuardianAnalysis": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "description",
          "analyzed_at"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "description": {
            "type": "string",
            "description": "The AI's description (empty when the camera gave no frame)."
          },
          "analyzed_at": {
            "type": "string",
            "format": "date-time"
          },
          "objects": {
            "type": "array",
            "description": "With `include_objects`, the objects found on frames of the moment (best detection per label).",
            "items": {
              "$ref": "#/components/schemas/DetectedObject"
            }
          }
        }
      },
      "TranscribeRecordingsRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the window to transcribe (inclusive, ISO 8601)."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the window (exclusive, ISO 8601). Must be after `from`; at most 24 h later."
          }
        }
      },
      "CameraAudioStatus": {
        "type": "object",
        "description": "A microphone's capture health (fields follow the web app; ignore fields you do not know). state is live, degraded, stalled, down or unknown; enabled is false when the camera's audio is not transcribed.",
        "properties": {
          "state": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "speech_today": {
            "description": "Today's speech counters for this microphone (server local day), or null when nothing was counted today.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/SpeechDay"
              },
              {
                "type": "null"
              }
            ]
          },
          "room_speech": {
            "description": "API 1.115.0. How the camera's room uses this microphone for speech-to-text, or null when the camera is in no room with two or more listening microphones.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/CameraRoomSpeech"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CameraRoomSpeech": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "room_id",
          "room_name",
          "mode",
          "transcribed",
          "microphone_camera_id",
          "microphone_name",
          "reason",
          "reason_code",
          "values"
        ],
        "description": "API 1.115.0. One microphone per room: when `transcribed` is false the room listens with `microphone_camera_id`, and this camera's speech (captions, what was said, its audio alert rules, its AI Live) comes from that microphone, which hears from a different position.",
        "properties": {
          "room_id": {
            "type": "integer"
          },
          "room_name": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "description": "As `SpeechMicrophoneChoice.mode`."
          },
          "transcribed": {
            "type": "boolean",
            "description": "This microphone is sent to speech-to-text."
          },
          "microphone_camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "microphone_name": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reason_code": {
            "type": "string"
          },
          "values": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "SpeechDay": {
        "type": "object",
        "additionalProperties": false,
        "description": "What the microphone heard today and what speech-to-text it used. Counted in memory: the day restarts at zero when the server restarts.",
        "required": [
          "date",
          "clips_cut",
          "skipped_quiet",
          "skipped_other_microphone",
          "backfill_clips",
          "backfill_silent",
          "whisper_calls",
          "deepgram_calls",
          "gemini_calls",
          "gemini_audio_seconds",
          "voice_match_calls",
          "no_text",
          "kept"
        ],
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "description": "The server's local day."
          },
          "clips_cut": {
            "type": "integer",
            "description": "Live clips the voice detector cut from the stream."
          },
          "skipped_quiet": {
            "type": "integer",
            "description": "Live clips dropped before any speech-to-text call because they were quieter than the camera's silence threshold."
          },
          "skipped_other_microphone": {
            "type": "integer",
            "description": "API 1.115.0. Live clips not sent to speech-to-text because the camera's room listens with another of its microphones."
          },
          "backfill_clips": {
            "type": "integer",
            "description": "Recording clips read by recording transcription (on request or the automatic sweep)."
          },
          "backfill_silent": {
            "type": "integer",
            "description": "Recording clips that were silent and never sent to speech-to-text."
          },
          "whisper_calls": {
            "type": "integer",
            "description": "Calls to the local Whisper speech-to-text."
          },
          "deepgram_calls": {
            "type": "integer",
            "description": "Calls tried with Deepgram."
          },
          "gemini_calls": {
            "type": "integer",
            "description": "Transcription calls to Gemini."
          },
          "gemini_audio_seconds": {
            "type": "number",
            "description": "Seconds of audio sent to Gemini for transcription."
          },
          "voice_match_calls": {
            "type": "integer",
            "description": "Gemini calls that compare a line's voice with the voices already heard. Voice matching is paused in this version, so this reads 0."
          },
          "no_text": {
            "type": "integer",
            "description": "Transcriptions that gave no line (silence, noise, a language the camera does not use, or a line filtered out)."
          },
          "kept": {
            "type": "integer",
            "description": "Lines stored as new transcripts."
          }
        }
      },
      "BackfillProgress": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "monitor_id",
          "running",
          "segments_total",
          "segments_done",
          "transcripts_added"
        ],
        "properties": {
          "monitor_id": {
            "type": "integer"
          },
          "running": {
            "type": "boolean",
            "description": "True while transcription is still in progress."
          },
          "segments_total": {
            "type": "integer",
            "description": "Recording segments in the window to process."
          },
          "segments_done": {
            "type": "integer",
            "description": "Recording segments processed so far."
          },
          "transcripts_added": {
            "type": "integer",
            "description": "Transcripts written by this run so far."
          },
          "segments_failed": {
            "type": "integer",
            "description": "Clips that could not be extracted or transcribed (e.g. the audio tool was killed, or the speech-to-text provider was down). When transcripts_added is 0 and this is greater than 0, the run errored — the recordings were not confirmed silent and a retry may succeed."
          },
          "error": {
            "type": "string",
            "description": "Present only if the run failed."
          }
        }
      },
      "AnalyzeCameraRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "include_objects": {
            "type": "boolean",
            "default": false,
            "description": "Run object recognition on frames of the moment first and give the AI its findings."
          },
          "prompts": {
            "type": "array",
            "maxItems": 20,
            "description": "What object recognition looks for (with include_objects).",
            "items": {
              "type": "string",
              "maxLength": 40
            }
          }
        }
      },
      "DetectedObject": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "label",
          "confidence",
          "bbox"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "bbox": {
            "$ref": "#/components/schemas/ObjectBBox"
          }
        }
      },
      "ObjectBBox": {
        "type": "object",
        "additionalProperties": false,
        "description": "Normalised to the frame (0-1); x, y = top-left corner.",
        "required": [
          "x",
          "y",
          "w",
          "h"
        ],
        "properties": {
          "x": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "y": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "w": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "h": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        }
      },
      "DetectObjectsRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "The recorded frame at this time (RFC 3339 with an offset); omit for the live frame."
          },
          "prompts": {
            "type": "array",
            "maxItems": 20,
            "description": "What to look for, in plain words (at most 40 characters each). Default the camera's list.",
            "items": {
              "type": "string",
              "maxLength": 40
            }
          },
          "min_confidence": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 0.99,
            "description": "Default 0.25 (the runner's)."
          },
          "annotate": {
            "type": "boolean",
            "default": true,
            "description": "Keep the frame with the boxes drawn for 15 minutes."
          }
        }
      },
      "DetectObjectsResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "objects",
          "frame_time",
          "model",
          "annotated_image_url"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "objects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DetectedObject"
            }
          },
          "frame_time": {
            "type": "string",
            "format": "date-time"
          },
          "model": {
            "type": "string",
            "description": "The runner's model."
          },
          "annotated_image_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The annotated frame (GET with the same authentication) for 15 minutes; null without annotate."
          }
        }
      },
      "ImageAnalyzeRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "image_base64"
        ],
        "properties": {
          "image_base64": {
            "type": "string",
            "description": "The image (JPEG, PNG or WebP), base64-encoded (a `data:` URL is accepted)."
          },
          "describe": {
            "type": "boolean",
            "default": true,
            "description": "AI description (guardian:write; uses AI credits)."
          },
          "detect": {
            "type": "boolean",
            "default": true,
            "description": "Object recognition."
          },
          "prompts": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "maxLength": 40
            }
          },
          "min_confidence": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 0.99
          },
          "annotate": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "ImageAnalyzeUpload": {
        "type": "object",
        "required": [
          "image"
        ],
        "properties": {
          "image": {
            "type": "string",
            "format": "binary",
            "description": "JPEG, PNG or WebP, at most 10 MB."
          },
          "describe": {
            "type": "boolean",
            "default": true
          },
          "detect": {
            "type": "boolean",
            "default": true
          },
          "prompts": {
            "type": "string",
            "description": "Comma-separated."
          },
          "min_confidence": {
            "type": "number"
          },
          "annotate": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "ImageAnalysis": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "description",
          "objects",
          "model",
          "annotated_image_url"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "The AI description; null without describe."
          },
          "objects": {
            "type": [
              "array",
              "null"
            ],
            "description": "Null without detect.",
            "items": {
              "$ref": "#/components/schemas/DetectedObject"
            }
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "annotated_image_url": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Site": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "description",
          "parent_id",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "parent_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The branch of a zone; `null` for a branch (two levels at most)."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "SitePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Site"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Room": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "site_id",
          "mode",
          "interval_seconds",
          "environment",
          "instruction",
          "wake_word",
          "timezone",
          "stt_provider",
          "ai_actuation_enabled",
          "ai_ptz_enabled",
          "ai_speak_enabled",
          "ai_mode",
          "ai_live_classic",
          "ai_live_coalesce_seconds",
          "ai_live_keepalive_seconds",
          "cameras",
          "source",
          "floor_plan",
          "devices",
          "managed_devices",
          "created_at",
          "updated_at",
          "speech_microphone",
          "speech_microphone_choice",
          "speech_microphone_notice"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "description": "API 1.38.0. Where the room comes from (open set): `manual` — made by hand; `plan` — made by the server from a room polygon on a floor plan (its name follows the polygon's label and the cameras whose pin is inside the polygon are its managed cameras); `virtual` — a collection of cameras and Home Assistant devices from different rooms, tied to no polygon."
          },
          "floor_plan": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RoomFloorPlan"
              },
              {
                "type": "null"
              }
            ],
            "description": "API 1.38.0. The floor plan the room is drawn on, or null."
          },
          "devices": {
            "type": "array",
            "description": "API 1.38.0. The room's Home Assistant devices (device keys, as `GET /integrations/home-assistant/room-signals/{room_id}`): their state is context for the room's AI and a change wakes AI Live.",
            "items": {
              "type": "string"
            }
          },
          "managed_devices": {
            "type": "array",
            "description": "API 1.40.0. The ones of `devices` the floor plan put here: an IoT device pinned inside the room's outline (`GET /iot/devices/{iot_device_id}`, `floor_plans`). A `device_entity_ids` replace keeps them; move the pin on the plan to take one out.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "type": "string",
            "description": "What AI Live uses (`video`, `audio`, `both`; open set)."
          },
          "interval_seconds": {
            "type": "integer"
          },
          "environment": {
            "type": "string",
            "description": "AI Live persona (`retail`, …; open set)."
          },
          "instruction": {
            "type": "string"
          },
          "wake_word": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "stt_provider": {
            "type": "string",
            "description": "Speech-to-text provider (`auto`, `whisper`, `deepgram`, `gemini`; open set)."
          },
          "speech_microphone": {
            "type": "string",
            "description": "API 1.115.0. Which microphones of the room are sent to speech-to-text: `auto` (default: only the best one; the others keep recording and stay playable), `all` (every microphone), or one camera id of the room as text (e.g. `\"37\"`). An id that is not a listening microphone of the room works as `auto`. Rooms with one microphone are not affected."
          },
          "speech_microphone_choice": {
            "$ref": "#/components/schemas/SpeechMicrophoneChoice"
          },
          "speech_microphone_notice": {
            "type": "boolean",
            "description": "API 1.115.0. True when the upgrade to one microphone per room switched this room (it had two or more listening microphones) to `auto`; it turns false once `speech_microphone` is written."
          },
          "ai_actuation_enabled": {
            "type": "boolean"
          },
          "ai_ptz_enabled": {
            "type": "boolean"
          },
          "ai_speak_enabled": {
            "type": "boolean"
          },
          "ai_mode": {
            "type": "string",
            "description": "Which AI runs for the room (open set): `live` — AI Live, the continuous conversational session (more AI credits); `guardian` — AI Guardian: each camera's motion-triggered descriptions get the room's `instruction` as context and the room's alert rules apply; AI Live never runs; `both`. API 1.16.0."
          },
          "ai_live_classic": {
            "type": "boolean",
            "description": "`false` (default): AI Live is event-driven — it calls the AI at session start and on activity (real motion, a person coming into or leaving view, an object detection, speech), at most once per `ai_live_coalesce_seconds`, plus an idle check every `ai_live_keepalive_seconds` while someone watches the room's output. `true`: the old fixed schedule (every `interval_seconds`). API 1.16.0."
          },
          "ai_live_coalesce_seconds": {
            "type": "integer",
            "description": "At most one AI Live call per this many seconds (default 10)."
          },
          "ai_live_keepalive_seconds": {
            "type": "integer",
            "description": "Idle check while someone watches (default 300)."
          },
          "cameras": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoomCamera"
            }
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "SpeechMicrophoneChoice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "camera_id",
          "camera_name",
          "reason",
          "reason_code",
          "values",
          "since"
        ],
        "description": "API 1.115.0. The room's microphone for speech-to-text now (read only; the server re-decides every few seconds).",
        "properties": {
          "mode": {
            "type": "string",
            "description": "Open set: `none` — fewer than two listening microphones, nothing to choose; `trial` — every microphone is transcribed side by side for a bounded number of clips to find the best one; `one` — only `camera_id` is transcribed; `all` — every microphone (the room's setting)."
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The camera whose microphone is transcribed (`one`), else null."
          },
          "camera_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why, in one plain English sentence."
          },
          "reason_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "The reason as a code with `values` filling it (open set): `trial` (mics, heard, of), `yield` (pct, other_pct, other), `coverage` (lines, other_lines, other), `clarity` (db, other_db, other), `steadier` (other, restarts), `dedicated` (other), `alike` (other), `failover` (down, using), `back` (name), `only_working` (name), `none_working`, `user_choice`, `all`. `values.invalid_choice` is true when the camera picked in `speech_microphone` is no longer a listening microphone of the room."
          },
          "values": {
            "type": "object",
            "additionalProperties": true
          },
          "since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When this choice started."
          }
        }
      },
      "RoomCamera": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "name",
          "role",
          "is_primary",
          "managed",
          "is_speech_microphone"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "What the camera contributes (`video`, `audio`, `both`; open set)."
          },
          "is_primary": {
            "type": "boolean"
          },
          "managed": {
            "type": "boolean",
            "description": "API 1.38.0. The floor plan put the camera here (its pin is inside the room's polygon); move the camera on the plan to change it. A `cameras` replace keeps managed cameras."
          },
          "is_speech_microphone": {
            "type": "boolean",
            "description": "API 1.115.0. The camera's microphone listens and the room sends it to speech-to-text. False for a camera whose speech the room hears with another microphone (see the room's `speech_microphone_choice`)."
          }
        }
      },
      "RoomFloorPlan": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "item_id"
        ],
        "description": "The floor plan a room is drawn on and the item (polygon) that is the room.",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "item_id": {
            "type": "integer"
          }
        }
      },
      "RoomPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Room"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Layout": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "cells",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "cells": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LayoutCell"
            }
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LayoutCell": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "x",
          "y",
          "w",
          "h"
        ],
        "description": "A camera's place on the grid, in grid units.",
        "properties": {
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "x": {
            "type": "integer"
          },
          "y": {
            "type": "integer"
          },
          "w": {
            "type": "integer"
          },
          "h": {
            "type": "integer"
          }
        }
      },
      "LayoutPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Layout"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "SystemCapacity": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "report",
          "verdict"
        ],
        "description": "The last capacity check and its answer; both null before the first check.",
        "properties": {
          "report": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SystemCapacityReport"
              },
              {
                "type": "null"
              }
            ]
          },
          "verdict": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SystemCapacityVerdict"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "SystemCapacityReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "measured_at",
          "disk",
          "cpu",
          "memory",
          "network",
          "cameras"
        ],
        "description": "What was measured. A null figure could not be measured on this server (another OS, or the probe failed).",
        "properties": {
          "measured_at": {
            "type": "string",
            "format": "date-time"
          },
          "disk": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "write_bytes_per_sec",
              "free_bytes",
              "total_bytes"
            ],
            "description": "The recordings disk.",
            "properties": {
              "write_bytes_per_sec": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Measured by writing 256 MiB in synced 4 MiB chunks."
              },
              "free_bytes": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "total_bytes": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          },
          "cpu": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "cores",
              "load_1m"
            ],
            "properties": {
              "cores": {
                "type": "integer"
              },
              "load_1m": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "The 1-minute load average (Linux)."
              }
            }
          },
          "memory": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "total_bytes",
              "free_bytes"
            ],
            "properties": {
              "total_bytes": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "free_bytes": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Available to new programs (Linux MemAvailable)."
              }
            }
          },
          "network": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "interface",
              "link_mbps"
            ],
            "properties": {
              "interface": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The default route's interface (Linux)."
              },
              "link_mbps": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Its link speed in Mbit/s; null on Wi-Fi and virtual links."
              }
            }
          },
          "cameras": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "count",
              "measured",
              "bytes_per_day",
              "ingest_bytes_per_sec",
              "retention_days",
              "pending_bytes"
            ],
            "description": "The enabled video cameras.",
            "properties": {
              "count": {
                "type": "integer"
              },
              "measured": {
                "type": "integer",
                "description": "How many have a rate measured from their own recordings (the rest are estimated)."
              },
              "bytes_per_day": {
                "type": "number"
              },
              "ingest_bytes_per_sec": {
                "type": "number"
              },
              "retention_days": {
                "type": "integer",
                "description": "The cameras' average retention (the default for new cameras when there are none)."
              },
              "pending_bytes": {
                "type": "number",
                "description": "What the cameras will still add on disk until their recordings fill their retention."
              }
            }
          }
        }
      },
      "SystemCapacityVerdict": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "more_cameras",
          "limited_by",
          "limits",
          "camera_bytes_per_day",
          "typical_camera"
        ],
        "properties": {
          "more_cameras": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "About how many more cameras like the ones it has the server can take: the smallest known limit. Null when no limit could be worked out."
          },
          "limited_by": {
            "type": "string",
            "enum": [
              "disk_write",
              "disk_space",
              "cpu",
              "network",
              "none"
            ]
          },
          "limits": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "disk_write",
              "disk_space",
              "cpu",
              "network"
            ],
            "description": "More cameras each resource allows; null when unknown.",
            "properties": {
              "disk_write": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "disk_space": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "cpu": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "network": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              }
            }
          },
          "camera_bytes_per_day": {
            "type": "number",
            "description": "What one more camera writes a day: the average of the cameras, or a typical 1080p 15 fps camera."
          },
          "typical_camera": {
            "type": "boolean",
            "description": "True when there are no cameras and the figures are for a typical 1080p 15 fps camera."
          }
        }
      },
      "SystemStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "cpu_count",
          "load_average",
          "disks",
          "cameras_enabled",
          "recordings",
          "unacknowledged_alerts"
        ],
        "properties": {
          "version": {
            "type": "string"
          },
          "cpu_count": {
            "type": "integer"
          },
          "load_average": {
            "type": "array",
            "description": "1, 5 and 15 minute load averages.",
            "items": {
              "type": "number"
            }
          },
          "disks": {
            "type": "array",
            "description": "The recordings disk, then the system disk when it is another filesystem.",
            "items": {
              "$ref": "#/components/schemas/SystemDisk"
            }
          },
          "cameras_enabled": {
            "type": "integer",
            "minimum": 0
          },
          "recordings": {
            "$ref": "#/components/schemas/SystemRecordings"
          },
          "unacknowledged_alerts": {
            "type": "integer",
            "minimum": 0
          },
          "api_version": {
            "type": "string",
            "description": "The API v1 version, e.g. `1.125.0` (API 1.125.0)."
          },
          "memory": {
            "description": "RAM and swap now; null when the OS does not tell (API 1.125.0).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/SystemMemory"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "SystemMemory": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "total_bytes",
          "available_bytes",
          "used_bytes",
          "used_percent",
          "swap_total_bytes",
          "swap_used_bytes"
        ],
        "properties": {
          "total_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "available_bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "Available to new programs (Linux MemAvailable)."
          },
          "used_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "used_percent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "swap_total_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "swap_used_bytes": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "SystemDisk": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "label",
          "path",
          "total_bytes",
          "used_bytes",
          "free_bytes",
          "used_percent"
        ],
        "properties": {
          "label": {
            "type": "string",
            "description": "`recordings` or `system` (open set)."
          },
          "path": {
            "type": "string"
          },
          "total_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "used_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "free_bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "Free to the server (unprivileged)."
          },
          "used_percent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          }
        }
      },
      "SystemRecordings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "segment_count",
          "size_bytes",
          "cache_bytes",
          "active_recorders"
        ],
        "properties": {
          "segment_count": {
            "type": "integer",
            "minimum": 0
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "cache_bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "Playback cache stored next to the segments."
          },
          "active_recorders": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "SystemHealth": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "monitoring",
          "overall",
          "incidents_open",
          "checked_at",
          "components"
        ],
        "properties": {
          "monitoring": {
            "type": "boolean",
            "description": "`false` when the self-heal watchdog is off (then `overall` is `unknown`)."
          },
          "overall": {
            "type": "string",
            "description": "`ok`, `degraded`, `down` or `unknown` (open set)."
          },
          "incidents_open": {
            "type": "integer",
            "minimum": 0
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HealthComponent"
            }
          },
          "memory_profile": {
            "$ref": "#/components/schemas/MemoryProfile"
          }
        }
      },
      "MemoryProfile": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tier",
          "low_memory",
          "total_bytes",
          "summary",
          "under_pressure"
        ],
        "description": "API 1.126.0. How much memory the server allows itself, chosen automatically at start from the machine's RAM; there is no setting. `normal` above about 9 GB; `low` on an 8 GB machine (smaller database buffers and connection pool, video tools on fewer threads, smaller pre-recording buffer); `tight` under about 5 GB (Raspberry Pi class), a step smaller again.",
        "properties": {
          "tier": {
            "type": "string",
            "enum": [
              "normal",
              "low",
              "tight"
            ]
          },
          "low_memory": {
            "type": "boolean",
            "description": "`tier` is `low` or `tight`."
          },
          "total_bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "The RAM the choice was made from (0 = unknown)."
          },
          "summary": {
            "type": "string",
            "description": "One line, e.g. `Low-memory mode: on, 7.8 GB`."
          },
          "under_pressure": {
            "type": "boolean",
            "description": "Available memory is short right now; background work (recording compression, transcription catch-up) waits."
          }
        }
      },
      "HealthComponent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "kind",
          "status",
          "detail",
          "restartable",
          "last_checked"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "`container`, `mount`, `disk`, `bg_service`, `streams`, `clients` (open set)."
          },
          "status": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "restartable": {
            "type": "boolean"
          },
          "last_checked": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "User": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "username",
          "email",
          "role",
          "enabled",
          "groups",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "username": {
            "type": "string"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "operator",
              "viewer"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupRef"
            }
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "UserPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/User"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "GroupRef": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "Group": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "description",
          "user_ids",
          "camera_grants",
          "site_grants",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "camera_grants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CameraGrant"
            }
          },
          "site_grants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SiteGrant"
            }
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "CameraGrant": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "camera_name",
          "permission"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "camera_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "permission": {
            "type": "string",
            "enum": [
              "viewer",
              "operator",
              "manager"
            ]
          }
        }
      },
      "SiteGrant": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "site_id",
          "site_name",
          "permission",
          "include_zones"
        ],
        "description": "The permission on every camera of the site (and of its zones when `include_zones`).",
        "properties": {
          "site_id": {
            "type": "integer"
          },
          "site_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "permission": {
            "type": "string",
            "enum": [
              "viewer",
              "operator",
              "manager"
            ]
          },
          "include_zones": {
            "type": "boolean"
          }
        }
      },
      "GroupPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Group"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "UserCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "username",
          "password"
        ],
        "properties": {
          "username": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "password": {
            "type": "string",
            "minLength": 8,
            "maxLength": 72,
            "description": "8-72 bytes."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "operator",
              "viewer"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "group_ids": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "UserUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "username": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "password": {
            "type": "string",
            "minLength": 8,
            "maxLength": 72
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "operator",
              "viewer"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "group_ids": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "Settings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "default_recording_enabled",
          "default_retention_days",
          "retention_choices",
          "camera_follow_enabled",
          "hal_events_retention_days",
          "bluetooth_enabled",
          "bluetooth_scan_interval_minutes",
          "bluetooth_scan_seconds",
          "camera_clock_autofix_enabled",
          "auto_update_enabled",
          "compress_after_days"
        ],
        "properties": {
          "compress_after_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 89,
            "description": "API 1.92.0. Compress recordings older than this many days. 0 (the default) is off. Otherwise a recording of a camera whose retention is longer than this is, once it is this old, re-encoded at a lower bitrate (same picture size, frame rate and container; audio kept) and replaced in place, so it plays, exports and shows thumbnails as before at roughly a third to a fifth of the size. Microphone recordings and recordings of cameras kept no longer than this are left alone. The work runs one recording at a time at background priority and only while nobody is playing back."
          },
          "compression": {
            "type": "object",
            "description": "API 1.92.0. The compressor's work so far and what is due (absent when the server has no recorder).",
            "additionalProperties": false,
            "required": [
              "compressed_count",
              "saved_bytes",
              "pending_count"
            ],
            "properties": {
              "compressed_count": {
                "type": "integer",
                "description": "Recordings compressed so far."
              },
              "saved_bytes": {
                "type": "integer",
                "format": "int64",
                "description": "Bytes saved by compression so far."
              },
              "pending_count": {
                "type": "integer",
                "description": "Recordings due for compression with the current setting (0 while off)."
              }
            }
          },
          "auto_update_enabled": {
            "type": "boolean",
            "description": "Install updates automatically. When true a newer signed release installs itself (the server restarts into it); when false (the default) it is downloaded and staged and the admin is asked before it installs (`GET /system/update` then reports state `ready` with `auto_install` false)."
          },
          "camera_clock_autofix_enabled": {
            "type": "boolean",
            "description": "API 1.50.0. Camera clocks fix themselves. The background clock check (every 6 hours, on add, and every 10 minutes for a camera whose clock could not be read) runs the set-clock fix on a camera that drifts, has the wrong zone or has time sync off, to the camera's site zone. Each automatic fix is audited (`camera.clock.autofix`) and shown in the camera's clock check (`auto_fix`); one that did not work is not tried again for a day. Default true."
          },
          "bluetooth_enabled": {
            "type": "boolean",
            "description": "The hourly Bluetooth scan runs (API 1.42.0; `GET /bluetooth` for the state). Default true."
          },
          "bluetooth_scan_interval_minutes": {
            "type": "integer",
            "description": "Minutes between scheduled Bluetooth scans (5–1440, default 60)."
          },
          "bluetooth_scan_seconds": {
            "type": "integer",
            "description": "How long one Bluetooth scan listens (5–120, default 20)."
          },
          "hal_events_retention_days": {
            "type": "integer",
            "description": "How long the reports of Vision Engine services (the camera detection events with a Vision Engine `source`) are kept (default 30; each service instance also keeps at most 200,000)."
          },
          "camera_follow_enabled": {
            "type": "boolean",
            "description": "Camera following moves a camera's URL (credentials included) to the address its hardware id (MAC) shows up at when its DHCP address changes. Changed with a user session only."
          },
          "default_recording_enabled": {
            "type": "boolean",
            "description": "New cameras record continuously."
          },
          "default_retention_days": {
            "type": "integer",
            "description": "New cameras keep recordings this many days."
          },
          "retention_choices": {
            "type": "array",
            "description": "The allowed retention periods (days).",
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "SettingsUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "default_recording_enabled": {
            "type": "boolean"
          },
          "default_retention_days": {
            "type": "integer"
          },
          "camera_follow_enabled": {
            "type": "boolean",
            "description": "User sessions only (`403 api_key_not_allowed`)."
          },
          "hal_events_retention_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "bluetooth_enabled": {
            "type": "boolean"
          },
          "bluetooth_scan_interval_minutes": {
            "type": "integer",
            "minimum": 5,
            "maximum": 1440
          },
          "bluetooth_scan_seconds": {
            "type": "integer",
            "minimum": 5,
            "maximum": 120
          },
          "camera_clock_autofix_enabled": {
            "type": "boolean"
          },
          "auto_update_enabled": {
            "type": "boolean",
            "description": "Install updates automatically (default false: ask first)."
          },
          "compress_after_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 89,
            "description": "Compress recordings older than this many days; 0 = off (API 1.92.0)."
          }
        }
      },
      "AgentSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "human_in_the_loop"
        ],
        "properties": {
          "human_in_the_loop": {
            "type": "boolean",
            "description": "AI agents ask the user before risky operations (unless their key or app overrides it)."
          }
        }
      },
      "AgentSettingsUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "human_in_the_loop"
        ],
        "properties": {
          "human_in_the_loop": {
            "type": "boolean"
          }
        }
      },
      "AgentPolicy": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "human_in_the_loop",
          "source",
          "override",
          "server_human_in_the_loop",
          "confirm_operations",
          "note"
        ],
        "properties": {
          "human_in_the_loop": {
            "type": "boolean",
            "description": "AI agents using this credential must get the user's approval before the confirm operations."
          },
          "source": {
            "type": "string",
            "enum": [
              "server",
              "api_key",
              "connected_app"
            ],
            "description": "What decided it."
          },
          "override": {
            "$ref": "#/components/schemas/HumanInTheLoopOverride"
          },
          "server_human_in_the_loop": {
            "type": "boolean",
            "description": "The server setting."
          },
          "confirm_operations": {
            "type": "array",
            "description": "The operationIds that need approval while human in the loop is on.",
            "items": {
              "type": "string"
            }
          },
          "note": {
            "type": "string",
            "description": "The policy in a sentence, for an agent to follow."
          }
        }
      },
      "HumanInTheLoopOverride": {
        "type": "string",
        "enum": [
          "inherit",
          "on",
          "off"
        ],
        "description": "`inherit` follows the server setting; `on` and `off` override it for this key or app."
      },
      "ConfigDocument": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "format",
          "version",
          "exported_at",
          "server_version",
          "includes_secrets",
          "kdf",
          "settings",
          "sites",
          "cameras",
          "alert_rules",
          "rooms",
          "layouts",
          "outputs",
          "floor_plans"
        ],
        "description": "A configuration export (format `vigiora.config`, version 2: version 1 plus `floor_plans`). Objects are identified by `id`.",
        "properties": {
          "format": {
            "type": "string",
            "enum": [
              "vigiora.config"
            ]
          },
          "version": {
            "type": "integer",
            "description": "2. A server refuses versions it does not know (it imports 1 and 2)."
          },
          "exported_at": {
            "type": "string",
            "format": "date-time"
          },
          "server_version": {
            "type": "string"
          },
          "includes_secrets": {
            "type": "boolean"
          },
          "kdf": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ConfigKDF"
              },
              {
                "type": "null"
              }
            ]
          },
          "settings": {
            "$ref": "#/components/schemas/ConfigSettings"
          },
          "sites": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigSite"
            }
          },
          "cameras": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigCamera"
            }
          },
          "alert_rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigAlertRule"
            }
          },
          "rooms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigRoom"
            }
          },
          "layouts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigLayout"
            }
          },
          "outputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigOutput"
            }
          },
          "floor_plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigFloorPlan"
            }
          }
        }
      },
      "ConfigFloorPlan": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "site_id",
          "name",
          "floor_number",
          "sort_order",
          "image",
          "image_type",
          "width_px",
          "height_px",
          "version",
          "items"
        ],
        "description": "A floor plan and its items. `image` names its image file in a bundle export (`floorplans/<id>/plan-<version>.png|jpg`); the JSON export carries no image bytes.",
        "properties": {
          "id": {
            "type": "integer"
          },
          "site_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "floor_number": {
            "type": [
              "integer",
              "null"
            ]
          },
          "sort_order": {
            "type": "integer"
          },
          "image": {
            "type": "string"
          },
          "image_type": {
            "type": "string",
            "enum": [
              "png",
              "jpeg",
              ""
            ]
          },
          "width_px": {
            "type": "integer"
          },
          "height_px": {
            "type": "integer"
          },
          "version": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigFloorPlanItem"
            }
          }
        }
      },
      "ConfigFloorPlanItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "camera_id",
          "speaker_id",
          "device_key",
          "entity_id",
          "room_id",
          "analytics_area_id",
          "x",
          "y",
          "rotation_deg",
          "fov_deg",
          "range",
          "polygon",
          "label",
          "z"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "camera",
              "speaker",
              "device",
              "room",
              "area",
              "door",
              "window",
              "landmark",
              "furniture"
            ]
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "speaker_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "device_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "kind device (API 1.40.0)."
          },
          "entity_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "room_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "analytics_area_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "x": {
            "type": [
              "number",
              "null"
            ]
          },
          "y": {
            "type": [
              "number",
              "null"
            ]
          },
          "rotation_deg": {
            "type": "number"
          },
          "fov_deg": {
            "type": [
              "number",
              "null"
            ]
          },
          "range": {
            "type": [
              "number",
              "null"
            ]
          },
          "polygon": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "array",
              "minItems": 2,
              "maxItems": 2,
              "items": {
                "type": "number"
              }
            }
          },
          "label": {
            "type": "string"
          },
          "z": {
            "type": "integer"
          }
        }
      },
      "ConfigKDF": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "salt",
          "time",
          "memory_kib",
          "parallelism",
          "key_length",
          "cipher"
        ],
        "description": "How the key of the encrypted values was derived from the passphrase.",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "argon2id"
            ]
          },
          "salt": {
            "type": "string",
            "description": "base64url, 16 bytes."
          },
          "time": {
            "type": "integer"
          },
          "memory_kib": {
            "type": "integer"
          },
          "parallelism": {
            "type": "integer"
          },
          "key_length": {
            "type": "integer"
          },
          "cipher": {
            "type": "string",
            "enum": [
              "aes-256-gcm"
            ]
          }
        }
      },
      "ConfigSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "default_recording_enabled",
          "default_retention_days"
        ],
        "properties": {
          "default_recording_enabled": {
            "type": "boolean"
          },
          "default_retention_days": {
            "type": "integer"
          }
        }
      },
      "ConfigSite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "description",
          "parent_id"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "parent_id": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "ConfigSecret": {
        "description": "A credential-bearing value. `REDACTED` markers replace credentials unless secrets were exported; then the whole value is encrypted.",
        "oneOf": [
          {
            "type": "string"
          },
          {
            "$ref": "#/components/schemas/EncryptedValue"
          },
          {
            "type": "null"
          }
        ]
      },
      "EncryptedValue": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "$enc"
        ],
        "properties": {
          "$enc": {
            "type": "string",
            "description": "`v1:` + base64url(12-byte nonce || AES-256-GCM ciphertext); additional data `vigiora-config-v1|cameras/<id>/<field>`."
          }
        }
      },
      "ConfigCamera": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "enabled",
          "recording_enabled",
          "retention_days",
          "width",
          "height",
          "fps",
          "source_type",
          "connection_type",
          "stream_url",
          "source_url",
          "ptz_onvif_url",
          "srt_passphrase",
          "site_id",
          "tags",
          "ai_guardian",
          "has_ptz"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "recording_enabled": {
            "type": "boolean"
          },
          "retention_days": {
            "type": "integer"
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "fps": {
            "type": [
              "integer",
              "null"
            ]
          },
          "source_type": {
            "type": "string"
          },
          "connection_type": {
            "type": "string"
          },
          "stream_url": {
            "$ref": "#/components/schemas/ConfigSecret"
          },
          "source_url": {
            "$ref": "#/components/schemas/ConfigSecret"
          },
          "ptz_onvif_url": {
            "$ref": "#/components/schemas/ConfigSecret"
          },
          "srt_passphrase": {
            "$ref": "#/components/schemas/ConfigSecret"
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ai_guardian": {
            "type": "boolean"
          },
          "has_ptz": {
            "type": "boolean"
          }
        }
      },
      "ConfigAlertRule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "label",
          "severity",
          "enabled"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "ConfigRoom": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "site_id",
          "mode",
          "interval_seconds",
          "environment",
          "instruction",
          "wake_word",
          "timezone",
          "stt_provider",
          "speech_microphone",
          "ai_actuation_enabled",
          "ai_ptz_enabled",
          "ai_speak_enabled",
          "source",
          "cameras"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "mode": {
            "type": "string"
          },
          "interval_seconds": {
            "type": "integer"
          },
          "environment": {
            "type": "string"
          },
          "instruction": {
            "type": "string"
          },
          "wake_word": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "stt_provider": {
            "type": "string"
          },
          "ai_actuation_enabled": {
            "type": "boolean"
          },
          "ai_ptz_enabled": {
            "type": "boolean"
          },
          "ai_speak_enabled": {
            "type": "boolean"
          },
          "source": {
            "type": "string",
            "description": "`manual`, `plan` or `virtual` (API 1.38.0; `manual` when absent)."
          },
          "speech_microphone": {
            "type": "string",
            "description": "`auto`, `all` or a camera id (API 1.115.0; `auto` when absent)."
          },
          "cameras": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigRoomCamera"
            }
          }
        }
      },
      "ConfigRoomCamera": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "role",
          "is_primary",
          "managed"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "role": {
            "type": "string"
          },
          "is_primary": {
            "type": "boolean"
          },
          "managed": {
            "type": "boolean",
            "description": "Put here by the floor plan sync (API 1.38.0; false when absent)."
          }
        }
      },
      "ConfigLayout": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "owner_username",
          "cells"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "owner_username": {
            "type": [
              "string",
              "null"
            ],
            "description": "The owner of a personal layout; `null` for a shared one."
          },
          "cells": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LayoutCell"
            }
          }
        }
      },
      "ConfigOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "kind",
          "client_id",
          "camera_id",
          "device",
          "volume",
          "enabled"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "client_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "device": {
            "type": [
              "string",
              "null"
            ]
          },
          "volume": {
            "type": "number"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "ConfigImport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "format",
          "version"
        ],
        "description": "A document to import (from GET /config/export). Only format and version are required; absent lists and fields change nothing.",
        "properties": {
          "format": {
            "type": "string",
            "enum": [
              "vigiora.config"
            ]
          },
          "version": {
            "type": "integer",
            "description": "1 or 2. A server refuses versions it does not know."
          },
          "exported_at": {
            "type": "string",
            "format": "date-time"
          },
          "server_version": {
            "type": "string"
          },
          "includes_secrets": {
            "type": "boolean"
          },
          "kdf": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ConfigKDF"
              },
              {
                "type": "null"
              }
            ]
          },
          "settings": {
            "$ref": "#/components/schemas/ConfigImportSettings"
          },
          "sites": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigImportSite"
            }
          },
          "cameras": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigImportCamera"
            }
          },
          "alert_rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigImportAlertRule"
            }
          },
          "rooms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigImportRoom"
            }
          },
          "layouts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigImportLayout"
            }
          },
          "outputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigImportOutput"
            }
          },
          "floor_plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigImportFloorPlan"
            }
          }
        }
      },
      "ConfigImportSite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "description": "Absent fields keep the stored value (a new object needs id and name).",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "parent_id": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "ConfigImportCamera": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "description": "Absent fields keep the stored value (a new object needs id and name).",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "recording_enabled": {
            "type": "boolean"
          },
          "retention_days": {
            "type": "integer"
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "fps": {
            "type": [
              "integer",
              "null"
            ]
          },
          "source_type": {
            "type": "string"
          },
          "connection_type": {
            "type": "string"
          },
          "stream_url": {
            "$ref": "#/components/schemas/ConfigSecret"
          },
          "source_url": {
            "$ref": "#/components/schemas/ConfigSecret"
          },
          "ptz_onvif_url": {
            "$ref": "#/components/schemas/ConfigSecret"
          },
          "srt_passphrase": {
            "$ref": "#/components/schemas/ConfigSecret"
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ai_guardian": {
            "type": "boolean"
          },
          "has_ptz": {
            "type": "boolean"
          }
        }
      },
      "ConfigImportAlertRule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "label"
        ],
        "description": "Absent fields keep the stored value (a new object needs id and name).",
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "ConfigImportRoom": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "description": "Absent fields keep the stored value (a new object needs id and name).",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "mode": {
            "type": "string"
          },
          "interval_seconds": {
            "type": "integer"
          },
          "environment": {
            "type": "string"
          },
          "instruction": {
            "type": "string"
          },
          "wake_word": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "stt_provider": {
            "type": "string"
          },
          "ai_actuation_enabled": {
            "type": "boolean"
          },
          "ai_ptz_enabled": {
            "type": "boolean"
          },
          "ai_speak_enabled": {
            "type": "boolean"
          },
          "speech_microphone": {
            "type": "string",
            "pattern": "^(auto|all|[1-9][0-9]{0,9})$",
            "description": "API 1.115.0."
          },
          "cameras": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigImportRoomCamera"
            }
          }
        }
      },
      "ConfigImportRoomCamera": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id"
        ],
        "description": "Absent fields keep the stored value (a new object needs id and name).",
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "role": {
            "type": "string"
          },
          "is_primary": {
            "type": "boolean"
          }
        }
      },
      "ConfigImportLayout": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "description": "Absent fields keep the stored value (a new object needs id and name).",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "owner_username": {
            "type": [
              "string",
              "null"
            ],
            "description": "The owner of a personal layout; `null` for a shared one."
          },
          "cells": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LayoutCell"
            }
          }
        }
      },
      "ConfigImportOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "description": "Absent fields keep the stored value (a new object needs id and name).",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "client_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "device": {
            "type": [
              "string",
              "null"
            ]
          },
          "volume": {
            "type": "number"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "ConfigImportSettings": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "default_recording_enabled": {
            "type": "boolean"
          },
          "default_retention_days": {
            "type": "integer"
          }
        }
      },
      "ConfigImportFloorPlan": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "description": "Absent fields keep the stored value (a new plan needs id, site_id and image, the latter a file of the bundle). `items`, when sent, replaces every item. image_type, width_px, height_px and version are informational.",
        "properties": {
          "id": {
            "type": "integer"
          },
          "site_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "floor_number": {
            "type": [
              "integer",
              "null"
            ]
          },
          "sort_order": {
            "type": "integer"
          },
          "image": {
            "type": "string"
          },
          "image_type": {
            "type": "string"
          },
          "width_px": {
            "type": "integer"
          },
          "height_px": {
            "type": "integer"
          },
          "version": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigFloorPlanItem"
            }
          }
        }
      },
      "ConfigImportResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dry_run",
          "applied",
          "summary",
          "changes"
        ],
        "properties": {
          "dry_run": {
            "type": "boolean"
          },
          "applied": {
            "type": "boolean",
            "description": "The changes were committed (`false` for a dry run)."
          },
          "summary": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "create",
              "update",
              "unchanged",
              "skipped",
              "retention_reductions"
            ],
            "properties": {
              "create": {
                "type": "integer"
              },
              "update": {
                "type": "integer"
              },
              "unchanged": {
                "type": "integer"
              },
              "skipped": {
                "type": "integer"
              },
              "retention_reductions": {
                "type": "integer"
              }
            }
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigChange"
            }
          }
        }
      },
      "ConfigChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "id",
          "action",
          "fields",
          "warnings",
          "reason"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "`settings`, `site`, `camera`, `alert_rule`, `room`, `layout`, `output`, `floor_plan` (open set)."
          },
          "id": {
            "type": "string",
            "description": "The object's id (`<camera_id>/<label>` for an alert rule, `server` for settings)."
          },
          "action": {
            "type": "string",
            "enum": [
              "create",
              "update",
              "unchanged",
              "skipped"
            ]
          },
          "fields": {
            "type": "array",
            "description": "The fields an update changes, or a create sets (names only, never values).",
            "items": {
              "type": "string"
            }
          },
          "warnings": {
            "type": "array",
            "description": "Consequences to review, e.g. `retention_reduced: 30 → 7 days; …`.",
            "items": {
              "type": "string"
            }
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Recording": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "camera_name",
          "start_time",
          "end_time",
          "duration_seconds",
          "size_bytes",
          "in_progress",
          "protected",
          "media_url"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "camera_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "end_time": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "`null` while the segment is being written."
          },
          "duration_seconds": {
            "type": [
              "number",
              "null"
            ]
          },
          "size_bytes": {
            "type": "integer"
          },
          "in_progress": {
            "type": "boolean"
          },
          "protected": {
            "type": "boolean",
            "description": "Never deleted by retention while true."
          },
          "media_url": {
            "type": "string",
            "description": "Path of the playback endpoint (send your credentials)."
          }
        }
      },
      "RecordingPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recording"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Clip": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "camera_id",
          "camera_ids",
          "camera_name",
          "width",
          "height",
          "status",
          "progress",
          "requested_from",
          "requested_to",
          "from",
          "to",
          "shortened",
          "size_bytes",
          "filename",
          "error",
          "created_at",
          "finished_at",
          "expires_at",
          "timelapse_seconds"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "single",
              "mosaic",
              "timelapse"
            ],
            "description": "`single`: one camera's footage. `mosaic` (1.43.0): several cameras as tiles in one video. `timelapse` (1.109.0): one camera's recordings over up to 7 days sampled into a short video."
          },
          "camera_id": {
            "type": "integer",
            "description": "The camera; a mosaic's first camera."
          },
          "camera_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Every camera of the clip in tile order (`[camera_id]` for a single clip). Since 1.43.0."
          },
          "camera_name": {
            "type": "string",
            "description": "The camera's name; a mosaic's cameras' names joined with \", \"."
          },
          "width": {
            "type": [
              "integer",
              "null"
            ],
            "description": "A mosaic's video width (null for a single clip). Since 1.43.0."
          },
          "height": {
            "type": [
              "integer",
              "null"
            ],
            "description": "A mosaic's video height (null for a single clip). Since 1.43.0."
          },
          "timelapse_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "enum": [
              30,
              60,
              120,
              300,
              null
            ],
            "description": "A timelapse's length in seconds (null for other kinds). Since 1.109.0."
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "ready",
              "failed"
            ]
          },
          "progress": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "requested_from": {
            "type": "string",
            "format": "date-time"
          },
          "requested_to": {
            "type": "string",
            "format": "date-time"
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Start of the footage actually in the clip (when ready)."
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "shortened": {
            "type": "boolean",
            "description": "The clip covers less than requested (no footage at an end)."
          },
          "size_bytes": {
            "type": "integer"
          },
          "filename": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ClipPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Clip"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ClipCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to"
        ],
        "description": "`camera_id` is required for a single clip (`kind` omitted or `single`); `camera_ids` for a mosaic; `camera_id` and `length_seconds` for a timelapse. Since 1.43.0 `camera_id` is no longer listed as required so that a mosaic can omit it.",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "single",
              "mosaic",
              "timelapse"
            ],
            "default": "single"
          },
          "camera_id": {
            "type": "integer",
            "minimum": 1,
            "description": "The camera of a single clip."
          },
          "camera_ids": {
            "type": "array",
            "minItems": 2,
            "maxItems": 9,
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The cameras of a mosaic, in tile order (distinct)."
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "layout": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MosaicLayoutCell"
            },
            "description": "Mosaic only: one grid cell per camera (a saved layout's `grid_config`); cells of other cameras are ignored. The cells' grid is scaled to the video."
          },
          "cols": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9,
            "default": 0,
            "description": "Mosaic only, without `layout`: columns of the grid (0: the smallest square-ish grid)."
          },
          "labels": {
            "type": "boolean",
            "default": true,
            "description": "Mosaic only: draw each camera's name on its tile."
          },
          "length_seconds": {
            "type": "integer",
            "enum": [
              30,
              60,
              120,
              300
            ],
            "description": "Timelapse only (required then): the length of the video, 30 s, 1, 2 or 5 minutes. Since 1.109.0."
          }
        }
      },
      "MosaicLayoutCell": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "monitor_id",
          "x",
          "y",
          "w",
          "h"
        ],
        "properties": {
          "monitor_id": {
            "type": "integer",
            "minimum": 1
          },
          "x": {
            "type": "integer",
            "minimum": 0
          },
          "y": {
            "type": "integer",
            "minimum": 0
          },
          "w": {
            "type": "integer",
            "minimum": 1
          },
          "h": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "DownloadURL": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url",
          "expires_at"
        ],
        "properties": {
          "url": {
            "type": "string",
            "description": "Path on this server; single use, no credentials needed."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LibraryItem": {
        "type": "object",
        "additionalProperties": false,
        "description": "A picture or clip saved in the media library (API 1.52.0).",
        "required": [
          "id",
          "kind",
          "folder",
          "name",
          "size_bytes",
          "mime_type",
          "width",
          "height",
          "duration_ms",
          "camera_id",
          "camera_name",
          "captured_at",
          "note",
          "tags",
          "album_ids",
          "created_by",
          "created_at",
          "updated_at",
          "media_url",
          "thumbnail_url"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "clip"
            ]
          },
          "folder": {
            "type": "string",
            "description": "Its folder path (`\"\"` = the top level)."
          },
          "name": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          },
          "mime_type": {
            "type": "string",
            "enum": [
              "image/jpeg",
              "image/png",
              "image/webp",
              "video/mp4",
              "video/webm"
            ]
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "description": "A clip's length."
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The camera it was taken from (`null`: none, or the camera was removed)."
          },
          "camera_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The camera's name when it was saved."
          },
          "captured_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the picture was taken or the clip starts."
          },
          "note": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "album_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "created_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "media_url": {
            "type": "string",
            "description": "The file (a path on this server; needs your credentials)."
          },
          "thumbnail_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "A 320 px JPEG (a path on this server)."
          },
          "position": {
            "type": "integer",
            "description": "Its place in the album (album listings only)."
          }
        }
      },
      "LibraryItemPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "LibraryItemCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "clip_id"
        ],
        "properties": {
          "clip_id": {
            "type": "string",
            "description": "A ready clip export."
          },
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "folder": {
            "type": "string",
            "maxLength": 255
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          },
          "captured_at": {
            "type": "string",
            "format": "date-time",
            "description": "Default the clip's start."
          },
          "album_ids": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          }
        }
      },
      "LibraryUpload": {
        "type": "object",
        "required": [
          "file"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Default the file's name."
          },
          "folder": {
            "type": "string",
            "maxLength": 255
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "clip"
            ],
            "description": "Refuse any other kind of file."
          },
          "camera_id": {
            "type": "integer",
            "minimum": 1
          },
          "captured_at": {
            "type": "string",
            "format": "date-time"
          },
          "album_ids": {
            "type": "string",
            "description": "Comma-separated album ids, e.g. `3,7`."
          },
          "file": {
            "type": "string",
            "format": "binary",
            "description": "The picture or clip; the last part."
          }
        }
      },
      "LibraryItemUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "folder": {
            "type": "string",
            "maxLength": 255
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          },
          "tags": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          }
        }
      },
      "LibraryFolder": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "path",
          "items",
          "size_bytes",
          "explicit"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "items": {
            "type": "integer",
            "description": "Items directly in the folder that you see."
          },
          "size_bytes": {
            "type": "integer"
          },
          "explicit": {
            "type": "boolean",
            "description": "Created as a folder (it stays when empty)."
          }
        }
      },
      "LibraryFolderPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryFolder"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "LibraryFolderCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "path"
        ],
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        }
      },
      "LibraryFolderMove": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "path",
          "new_path"
        ],
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "new_path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        }
      },
      "LibraryFolderMoved": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "path",
          "moved_items"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "moved_items": {
            "type": "integer"
          }
        }
      },
      "LibraryAlbum": {
        "type": "object",
        "additionalProperties": false,
        "description": "An ordered list of library items (API 1.52.0). Counts are of the items you see.",
        "required": [
          "id",
          "name",
          "note",
          "cover_item_id",
          "thumbnail_url",
          "item_count",
          "clip_count",
          "image_count",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "cover_item_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "thumbnail_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cover's thumbnail (the chosen cover, else the first item)."
          },
          "item_count": {
            "type": "integer"
          },
          "clip_count": {
            "type": "integer"
          },
          "image_count": {
            "type": "integer"
          },
          "created_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LibraryAlbumPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryAlbum"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "LibraryAlbumDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "note",
          "cover_item_id",
          "thumbnail_url",
          "item_count",
          "clip_count",
          "image_count",
          "created_by",
          "created_at",
          "updated_at",
          "items"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "cover_item_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "thumbnail_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "item_count": {
            "type": "integer"
          },
          "clip_count": {
            "type": "integer"
          },
          "image_count": {
            "type": "integer"
          },
          "created_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryItem"
            }
          }
        }
      },
      "LibraryAlbumCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          },
          "item_ids": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          }
        }
      },
      "LibraryAlbumUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          },
          "cover_item_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          }
        }
      },
      "LibraryAlbumItems": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "item_ids"
        ],
        "properties": {
          "item_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          }
        }
      },
      "LibraryShareCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "expires_in": {
            "type": "string",
            "enum": [
              "1h",
              "24h",
              "7d"
            ],
            "default": "24h"
          }
        }
      },
      "LibraryShare": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "url",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "The share id (revoke with `DELETE /shares/{share_id}`)."
          },
          "url": {
            "type": "string",
            "description": "The public link; returned only here."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LibraryStats": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "images",
          "clips",
          "size_bytes",
          "free_bytes",
          "total_bytes",
          "min_free_bytes"
        ],
        "properties": {
          "items": {
            "type": "integer"
          },
          "images": {
            "type": "integer"
          },
          "clips": {
            "type": "integer"
          },
          "size_bytes": {
            "type": "integer"
          },
          "free_bytes": {
            "type": "integer"
          },
          "total_bytes": {
            "type": "integer"
          },
          "min_free_bytes": {
            "type": "integer",
            "description": "The free space saves keep (they are refused below it)."
          }
        }
      },
      "Share": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "clip_id",
          "entry_id",
          "library_item_id",
          "album_id",
          "camera_id",
          "camera_name",
          "status",
          "views",
          "created_by",
          "created_at",
          "expires_at",
          "revoked_at"
        ],
        "description": "A public link: to a ready clip (`kind: clip`), since 1.27.0 to a Guardian entry's picture (`kind: picture`, made for chat alerts; no creator), since 1.52.0 to a media library item (`kind: library`) or album (`kind: album`).",
        "properties": {
          "id": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "clip",
              "picture",
              "library",
              "album"
            ]
          },
          "clip_id": {
            "type": "string",
            "description": "Empty for a picture, library or album link."
          },
          "entry_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The Guardian entry of a picture link."
          },
          "library_item_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The library item of a library link (API 1.52.0)."
          },
          "album_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The album of an album link (API 1.52.0)."
          },
          "camera_id": {
            "type": "integer"
          },
          "camera_name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "views": {
            "type": "integer"
          },
          "created_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ShareCreated": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "clip_id",
          "entry_id",
          "library_item_id",
          "album_id",
          "camera_id",
          "camera_name",
          "status",
          "views",
          "created_by",
          "created_at",
          "expires_at",
          "revoked_at",
          "url"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "clip",
              "picture",
              "library",
              "album"
            ]
          },
          "clip_id": {
            "type": "string"
          },
          "entry_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "library_item_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "album_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "camera_id": {
            "type": "integer"
          },
          "camera_name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "views": {
            "type": "integer"
          },
          "created_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "url": {
            "type": "string",
            "description": "The public link. Returned only here."
          }
        }
      },
      "SharePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Share"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ShareCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "expires_in": {
            "type": "string",
            "enum": [
              "1h",
              "24h",
              "7d"
            ],
            "default": "24h"
          }
        }
      },
      "LiveShare": {
        "type": "object",
        "additionalProperties": false,
        "description": "A live share link (API 1.109.0).",
        "required": [
          "id",
          "camera_id",
          "camera_name",
          "status",
          "created_by",
          "created_at",
          "expires_at",
          "revoked_at",
          "last_used_at",
          "locked_until",
          "unlocks",
          "viewers"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "camera_name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "created_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The last time someone entered the code or watched."
          },
          "locked_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Set while 5 wrong codes have locked the link (15 minutes)."
          },
          "unlocks": {
            "type": "integer",
            "description": "How many times the right code was entered."
          },
          "viewers": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5,
            "description": "People watching now."
          }
        }
      },
      "LiveSharePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LiveShare"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "LiveShareCreated": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "camera_name",
          "status",
          "created_by",
          "created_at",
          "expires_at",
          "revoked_at",
          "last_used_at",
          "locked_until",
          "unlocks",
          "viewers",
          "url",
          "code"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "camera_name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "created_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "locked_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "unlocks": {
            "type": "integer"
          },
          "viewers": {
            "type": "integer"
          },
          "url": {
            "type": "string",
            "description": "The public link (`/live/<token>` on the site address). Returned only here."
          },
          "code": {
            "type": "string",
            "pattern": "^[0-9]{6}$",
            "description": "The 6-digit code to enter on the page. Returned only here."
          }
        }
      },
      "LiveShareCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "expires_in": {
            "type": "string",
            "enum": [
              "1h",
              "1d",
              "7d"
            ],
            "default": "1d"
          }
        }
      },
      "Event": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "type",
          "time",
          "camera_id",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "ULID; ordered by time."
          },
          "type": {
            "type": "string",
            "description": "Event type (open set, see Events)."
          },
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "data": {
            "type": "object",
            "description": "Type-specific payload (ids, labels, short text; never secrets)."
          }
        }
      },
      "EventPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "EventType": {
        "type": "string",
        "description": "Event types a webhook can subscribe to.",
        "enum": [
          "alert.created",
          "alert.acknowledged",
          "alert.unacknowledged",
          "guardian.event",
          "camera.online",
          "camera.offline",
          "camera.moved",
          "motion.started",
          "motion.ended",
          "presence.changed",
          "recording.started",
          "recording.stopped",
          "clip.ready",
          "clip.failed",
          "ptz.moved",
          "settings.changed",
          "webhook.disabled",
          "config.exported",
          "user.created",
          "user.updated",
          "user.deleted",
          "network.camera_found",
          "alert_rule.created",
          "alert_rule.updated",
          "alert_rule.deleted",
          "device.state_changed",
          "bay.occupied",
          "bay.freed",
          "bluetooth.device_found",
          "plan.applied",
          "robot.wifi_motion",
          "robot.nav.started",
          "robot.nav.arrived",
          "robot.nav.ended",
          "robot.place.learned"
        ]
      },
      "AutomationNode": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "type",
          "params",
          "x",
          "y"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The step's name in the graph (letters, digits, - and _, at most 40)."
          },
          "kind": {
            "type": "string",
            "enum": [
              "trigger",
              "condition",
              "action"
            ]
          },
          "type": {
            "type": "string",
            "description": "One of the node types of its kind (GET /automations/node-types)."
          },
          "params": {
            "type": "object",
            "additionalProperties": true,
            "description": "The step's settings (see its node type)."
          },
          "x": {
            "type": "number",
            "description": "Position on the canvas."
          },
          "y": {
            "type": "number"
          }
        }
      },
      "AutomationBlueprintInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "type",
          "label"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "The answer's key (a-z, 0-9 and _)."
          },
          "type": {
            "type": "string",
            "enum": [
              "camera",
              "device",
              "url",
              "label",
              "text",
              "toggle",
              "preset"
            ]
          },
          "label": {
            "type": "string",
            "description": "The question in plain words."
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "For a device: the Home Assistant domains that fit."
          },
          "control": {
            "type": "boolean",
            "description": "For a device: the automation commands it (it must be shared for control)."
          },
          "optional": {
            "type": "boolean",
            "description": "May be left empty (a camera left empty means any camera)."
          },
          "default": {
            "description": "The answer when none is given."
          }
        }
      },
      "AutomationBlueprintNode": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "type",
          "params",
          "x",
          "y"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "trigger",
              "condition",
              "action"
            ]
          },
          "type": {
            "type": "string"
          },
          "params": {
            "type": "object",
            "additionalProperties": true,
            "description": "Settings; a value {\"$input\": key} is an answer."
          },
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "include_if": {
            "type": "string",
            "description": "A toggle input: the step exists only when it is on."
          }
        }
      },
      "AutomationBlueprint": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "format",
          "version",
          "name",
          "inputs",
          "graph"
        ],
        "properties": {
          "format": {
            "type": "string",
            "enum": [
              "vigiora.automation-blueprint"
            ]
          },
          "version": {
            "type": "integer",
            "description": "The file format version (1)."
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "inputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationBlueprintInput"
            }
          },
          "graph": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "nodes",
              "edges"
            ],
            "properties": {
              "nodes": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AutomationBlueprintNode"
                }
              },
              "edges": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AutomationEdge"
                }
              }
            }
          }
        }
      },
      "AutomationCandidate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "label"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "device": {
            "type": "string",
            "description": "The device key."
          },
          "label": {
            "type": "string"
          }
        }
      },
      "AutomationBlueprintOfferInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "type",
          "label",
          "candidates"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "camera",
              "device",
              "url",
              "label",
              "text",
              "toggle",
              "preset"
            ]
          },
          "label": {
            "type": "string"
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "control": {
            "type": "boolean"
          },
          "optional": {
            "type": "boolean"
          },
          "default": {
            "description": "The answer when none is given."
          },
          "candidates": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/AutomationCandidate"
            },
            "description": "The cameras or devices that fit (null for free answers)."
          }
        }
      },
      "AutomationBlueprintOffer": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "description",
          "builtin",
          "sensitive",
          "inputs",
          "blueprint"
        ],
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "builtin": {
            "type": "boolean"
          },
          "sensitive": {
            "type": "boolean"
          },
          "inputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationBlueprintOfferInput"
            }
          },
          "blueprint": {
            "$ref": "#/components/schemas/AutomationBlueprint"
          }
        }
      },
      "AutomationBlueprintList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationBlueprintOffer"
            }
          }
        }
      },
      "AutomationBlueprintCheck": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "blueprint"
        ],
        "properties": {
          "blueprint": {
            "type": "object",
            "additionalProperties": true,
            "description": "The blueprint file's content."
          }
        }
      },
      "AutomationImport": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "blueprint_id": {
            "type": "string",
            "description": "A built-in blueprint."
          },
          "blueprint": {
            "type": "object",
            "additionalProperties": true,
            "description": "A blueprint file's content."
          },
          "answers": {
            "type": "object",
            "additionalProperties": true,
            "description": "Input key to its answer."
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "enabled": {
            "type": "boolean"
          },
          "confirm_sensitive": {
            "type": "boolean",
            "description": "An admin signed in confirms the sensitive actions."
          }
        }
      },
      "AutomationEdge": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to"
        ],
        "properties": {
          "from": {
            "type": "string",
            "description": "The step that runs first."
          },
          "to": {
            "type": "string",
            "description": "The step that runs after it."
          }
        }
      },
      "AutomationGraph": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "nodes",
          "edges"
        ],
        "properties": {
          "nodes": {
            "type": "array",
            "maxItems": 40,
            "items": {
              "$ref": "#/components/schemas/AutomationNode"
            }
          },
          "edges": {
            "type": "array",
            "maxItems": 80,
            "items": {
              "$ref": "#/components/schemas/AutomationEdge"
            }
          }
        }
      },
      "Automation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "enabled",
          "graph",
          "sensitive",
          "sensitive_reasons",
          "confirmed",
          "confirmed_at",
          "has_webhook",
          "blueprint_id",
          "created_by",
          "created_at",
          "updated_at",
          "last_run_at",
          "last_result"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "graph": {
            "$ref": "#/components/schemas/AutomationGraph"
          },
          "sensitive": {
            "type": "boolean",
            "description": "It has an action that can unlock a door, open a garage door, arm or disarm the alarm or sound a siren."
          },
          "sensitive_reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "lock",
                "alarm",
                "siren",
                "cover"
              ]
            }
          },
          "confirmed": {
            "type": "boolean",
            "description": "An admin confirmed its sensitive actions as they are now (true when it has none)."
          },
          "confirmed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "has_webhook": {
            "type": "boolean",
            "description": "It has a secret web address (webhook trigger)."
          },
          "blueprint_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The built-in blueprint it was made from."
          },
          "created_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_result": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "ok",
              "partial",
              "failed",
              "not_met",
              "no_steps",
              "dry_run",
              null
            ]
          }
        }
      },
      "AutomationWithWebhook": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "enabled",
          "graph",
          "sensitive",
          "sensitive_reasons",
          "confirmed",
          "confirmed_at",
          "has_webhook",
          "blueprint_id",
          "created_by",
          "created_at",
          "updated_at",
          "last_run_at",
          "last_result",
          "webhook_path"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "graph": {
            "$ref": "#/components/schemas/AutomationGraph"
          },
          "sensitive": {
            "type": "boolean",
            "description": "It has an action that can unlock a door, open a garage door, arm or disarm the alarm or sound a siren."
          },
          "sensitive_reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "lock",
                "alarm",
                "siren",
                "cover"
              ]
            }
          },
          "confirmed": {
            "type": "boolean",
            "description": "An admin confirmed its sensitive actions as they are now (true when it has none)."
          },
          "confirmed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "has_webhook": {
            "type": "boolean",
            "description": "It has a secret web address (webhook trigger)."
          },
          "blueprint_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The built-in blueprint it was made from."
          },
          "created_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_result": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "ok",
              "partial",
              "failed",
              "not_met",
              "no_steps",
              "dry_run",
              null
            ]
          },
          "webhook_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "The secret path that runs the automation (POST, on the local network), shown only when it was just made; null otherwise."
          }
        }
      },
      "AutomationPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Automation"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AutomationWrite": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "enabled": {
            "type": "boolean"
          },
          "graph": {
            "$ref": "#/components/schemas/AutomationGraph"
          },
          "confirm_sensitive": {
            "type": "boolean",
            "description": "An admin, signed in, confirms the sensitive actions (refused for anyone else)."
          }
        }
      },
      "AutomationProblem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "node_id",
          "field",
          "message"
        ],
        "properties": {
          "node_id": {
            "type": "string",
            "description": "The step concerned (\"\" = the whole graph)."
          },
          "field": {
            "type": "string",
            "description": "The setting concerned (\"\" = none)."
          },
          "message": {
            "type": "string",
            "description": "The problem in plain words."
          }
        }
      },
      "AutomationProblems": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "valid",
          "problems",
          "sensitive_reasons"
        ],
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "problems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationProblem"
            }
          },
          "sensitive_reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "lock",
                "alarm",
                "siren",
                "cover"
              ]
            }
          }
        }
      },
      "AutomationValidate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "graph"
        ],
        "properties": {
          "graph": {
            "$ref": "#/components/schemas/AutomationGraph"
          }
        }
      },
      "AutomationField": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "type",
          "required"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "string",
              "int",
              "number",
              "bool",
              "enum",
              "camera",
              "device",
              "time",
              "weekdays",
              "label",
              "url",
              "command",
              "args"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          },
          "max_len": {
            "type": "integer"
          },
          "enum": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "default": {
            "description": "The value used when the setting is left out."
          },
          "domains": {
            "type": "array",
            "description": "The Home Assistant domains a device setting accepts.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AutomationNodeType": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "type",
          "fields",
          "wired"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "trigger",
              "condition",
              "action"
            ]
          },
          "type": {
            "type": "string"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationField"
            }
          },
          "wired": {
            "type": "boolean"
          }
        }
      },
      "AutomationNodeTypes": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "node_types",
          "sensitive_reasons",
          "cameras",
          "devices"
        ],
        "properties": {
          "node_types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationNodeType"
            }
          },
          "sensitive_reasons": {
            "type": "object",
            "description": "Each reason code in plain words.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "cameras": {
            "type": "array",
            "description": "The cameras a step can name.",
            "items": {
              "$ref": "#/components/schemas/AutomationCandidate"
            }
          },
          "devices": {
            "type": "array",
            "description": "The devices shared with Vigiora that a step can name.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "device",
                "label",
                "domain",
                "control"
              ],
              "properties": {
                "device": {
                  "type": "string",
                  "description": "The device key."
                },
                "label": {
                  "type": "string"
                },
                "domain": {
                  "type": "string"
                },
                "control": {
                  "type": "boolean",
                  "description": "Shared for control (an action can command it)."
                }
              }
            }
          }
        }
      },
      "AutomationRunRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "dry_run": {
            "type": "boolean",
            "description": "Act on nothing; answer what would happen."
          },
          "acknowledge_sensitive": {
            "type": "boolean",
            "description": "API keys and agents: the user approved running sensitive actions."
          }
        }
      },
      "AutomationStep": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "node_id",
          "type",
          "status",
          "message",
          "ms"
        ],
        "properties": {
          "node_id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "fired",
              "pass",
              "fail",
              "ok",
              "error",
              "blocked",
              "would_run"
            ]
          },
          "message": {
            "type": "string"
          },
          "ms": {
            "type": "integer"
          }
        }
      },
      "AutomationRun": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "automation_id",
          "started_at",
          "duration_ms",
          "trigger_node",
          "trigger_type",
          "trigger_summary",
          "result",
          "dry_run",
          "steps"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "automation_id": {
            "type": "integer"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "duration_ms": {
            "type": "integer"
          },
          "trigger_node": {
            "type": "string"
          },
          "trigger_type": {
            "type": "string"
          },
          "trigger_summary": {
            "type": "object",
            "additionalProperties": true,
            "description": "What the trigger handed over, short (camera_id, label, confidence, device, state …)."
          },
          "result": {
            "type": "string",
            "enum": [
              "ok",
              "partial",
              "failed",
              "not_met",
              "no_steps",
              "dry_run"
            ]
          },
          "dry_run": {
            "type": "boolean"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationStep"
            }
          }
        }
      },
      "AutomationRunPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationRun"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AutomationRunStarted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "automation_id",
          "status",
          "trigger_node"
        ],
        "properties": {
          "automation_id": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "started"
            ]
          },
          "trigger_node": {
            "type": "string"
          }
        }
      },
      "AutomationWebhook": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "webhook_path"
        ],
        "properties": {
          "webhook_path": {
            "type": "string",
            "description": "The new secret path (POST, on the local network), shown this once."
          }
        }
      },
      "Webhook": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "url",
          "event_types",
          "camera_ids",
          "enabled",
          "allow_insecure",
          "consecutive_failures",
          "disabled_reason",
          "disabled_at",
          "last_delivery_at",
          "last_delivery_status",
          "last_delivery_code",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "event_types": {
            "type": "array",
            "description": "Empty = every type.",
            "items": {
              "type": "string"
            }
          },
          "camera_ids": {
            "type": "array",
            "description": "Empty = every camera (and events without a camera).",
            "items": {
              "type": "integer"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "allow_insecure": {
            "type": "boolean"
          },
          "consecutive_failures": {
            "type": "integer"
          },
          "disabled_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "disabled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_delivery_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The newest delivery of the log (null: none yet)."
          },
          "last_delivery_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "pending",
              "delivering",
              "succeeded",
              "failed",
              "held",
              null
            ]
          },
          "last_delivery_code": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The HTTP status the receiver last answered."
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookWithSecret": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "url",
          "event_types",
          "camera_ids",
          "enabled",
          "allow_insecure",
          "consecutive_failures",
          "disabled_reason",
          "disabled_at",
          "last_delivery_at",
          "last_delivery_status",
          "last_delivery_code",
          "created_by",
          "created_at",
          "updated_at",
          "secret"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "event_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "camera_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "allow_insecure": {
            "type": "boolean"
          },
          "consecutive_failures": {
            "type": "integer"
          },
          "disabled_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "disabled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_delivery_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_delivery_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "pending",
              "delivering",
              "succeeded",
              "failed",
              "held",
              null
            ]
          },
          "last_delivery_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "secret": {
            "type": "string",
            "description": "The signing secret. Shown only here; store it now."
          }
        }
      },
      "ClientError": {
        "type": "object",
        "description": "One grouped uncaught error of the web app (API 1.41.0).",
        "additionalProperties": false,
        "required": [
          "id",
          "fingerprint",
          "message",
          "stack",
          "component_stack",
          "url",
          "web_build",
          "server_version",
          "user_agent",
          "user_id",
          "role",
          "first_seen_at",
          "last_seen_at",
          "count",
          "resolved_at",
          "resolved_note"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "fingerprint": {
            "type": "string",
            "description": "Groups repeats: the message without numbers + the top stack frames without hashes."
          },
          "message": {
            "type": "string"
          },
          "stack": {
            "type": "string",
            "description": "The newest JavaScript stack (at most 4 KB)."
          },
          "component_stack": {
            "type": "string",
            "description": "React's component stack when an error boundary caught it; else empty."
          },
          "url": {
            "type": "string",
            "description": "The page's path (no query string)."
          },
          "web_build": {
            "type": "string",
            "description": "The entry bundle of the web app that reported (\"index-abc123.js\")."
          },
          "server_version": {
            "type": "string"
          },
          "user_agent": {
            "type": "string"
          },
          "user_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The reporting user when signed in."
          },
          "role": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "count": {
            "type": "integer",
            "description": "How many times this fingerprint was reported."
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "resolved_note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "BrandingPublic": {
        "type": "object",
        "additionalProperties": false,
        "description": "What is applied now (API 1.120.0), the same as the public `/api/branding/public` that the sign-in page reads.",
        "required": [
          "name",
          "logo_url",
          "accent_color",
          "powered_by"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The display name (Vigiora when none is set)."
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The logo picture (PNG); null for the Vigiora logo."
          },
          "accent_color": {
            "type": [
              "string",
              "null"
            ],
            "description": "#rrggbb; null for the Vigiora colour."
          },
          "powered_by": {
            "type": "boolean",
            "description": "Show the small \"Powered by Vigiora\" line."
          }
        }
      },
      "BrandingLimits": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name_max",
          "logo_max_bytes",
          "logo_max_side",
          "logo_types"
        ],
        "properties": {
          "name_max": {
            "type": "integer"
          },
          "logo_max_bytes": {
            "type": "integer"
          },
          "logo_max_side": {
            "type": "integer"
          },
          "logo_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Branding": {
        "type": "object",
        "additionalProperties": false,
        "description": "The server's custom branding (API 1.120.0).",
        "required": [
          "name",
          "logo_url",
          "accent_color",
          "hide_powered_by",
          "entitled",
          "updated_at",
          "limits",
          "effective"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 40,
            "description": "The stored name; empty for Vigiora."
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The stored logo (applied only when entitled)."
          },
          "accent_color": {
            "type": "string",
            "description": "#rrggbb, or empty for the Vigiora colour."
          },
          "hide_powered_by": {
            "type": "boolean"
          },
          "entitled": {
            "type": "boolean",
            "description": "The plan includes custom branding (logo, accent colour, hiding Powered by Vigiora)."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "limits": {
            "$ref": "#/components/schemas/BrandingLimits"
          },
          "effective": {
            "$ref": "#/components/schemas/BrandingPublic"
          }
        }
      },
      "BrandingUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "A branding change (API 1.120.0); at least one field.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 40
          },
          "accent_color": {
            "type": "string",
            "description": "#rrggbb, or empty for the Vigiora colour."
          },
          "hide_powered_by": {
            "type": "boolean"
          }
        }
      },
      "BrandingLogoUpload": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "image_base64"
        ],
        "properties": {
          "image_base64": {
            "type": "string",
            "description": "The logo (PNG, JPEG or WebP, at most 512 KB), base64-encoded (a `data:` URL is accepted)."
          }
        }
      },
      "ErrorReportMode": {
        "type": "string",
        "enum": [
          "ask",
          "always",
          "never"
        ],
        "description": "`ask` (default: an admin sends each report), `always` (sent without asking) or `never` (kept on this server only)."
      },
      "ErrorReportSystem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "os",
          "arch",
          "install"
        ],
        "description": "What a report says about this server (API 1.118.0).",
        "properties": {
          "os": {
            "type": "string",
            "description": "Operating system (`linux`, `windows`, `darwin`)."
          },
          "arch": {
            "type": "string",
            "description": "CPU architecture (`amd64`, `arm64`)."
          },
          "install": {
            "type": "string",
            "enum": [
              "native",
              "docker",
              "windows",
              "macos"
            ]
          }
        }
      },
      "ErrorReportWire": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "fingerprint",
          "message",
          "stack",
          "count",
          "first_seen",
          "last_seen",
          "server_version",
          "os",
          "arch",
          "install"
        ],
        "description": "One report exactly as it is sent to Vigiora cloud (API 1.118.0).",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "panic",
              "crash",
              "client_error"
            ]
          },
          "fingerprint": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "stack": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "first_seen": {
            "type": "string",
            "format": "date-time"
          },
          "last_seen": {
            "type": "string",
            "format": "date-time"
          },
          "server_version": {
            "type": "string"
          },
          "web_build": {
            "type": "string"
          },
          "os": {
            "type": "string"
          },
          "arch": {
            "type": "string"
          },
          "install": {
            "type": "string",
            "enum": [
              "native",
              "docker",
              "windows",
              "macos"
            ]
          },
          "exit_code": {
            "type": "integer",
            "description": "Crashes only."
          }
        }
      },
      "ErrorReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "fingerprint",
          "message",
          "stack",
          "count",
          "first_seen_at",
          "last_seen_at",
          "server_version",
          "web_build",
          "exit_code",
          "status",
          "sent_at",
          "reject_reason",
          "wire"
        ],
        "description": "One queued error report, already redacted (API 1.118.0).",
        "properties": {
          "id": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "panic",
              "crash",
              "client_error"
            ],
            "description": "`panic`: an internal error the server recovered from; `crash`: the server process stopped unexpectedly; `client_error`: a new web app error."
          },
          "fingerprint": {
            "type": "string",
            "description": "Groups repeats: the kind, the message without numbers and the top stack frames."
          },
          "message": {
            "type": "string"
          },
          "stack": {
            "type": "string",
            "description": "The Go stack, the last output of a crashed server, or the JavaScript stack (at most 16000 characters)."
          },
          "count": {
            "type": "integer",
            "description": "Occurrences since first_seen_at (it keeps adding up after a report was sent)."
          },
          "first_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "server_version": {
            "type": "string"
          },
          "web_build": {
            "type": "string"
          },
          "exit_code": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The crashed process's exit code (crashes only)."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "sent",
              "dismissed",
              "rejected"
            ],
            "description": "`pending`: waits for an admin (or the automatic sender with mode `always`); `sent`; `dismissed`: never sent; `rejected`: Vigiora cloud refused it (`reject_reason`)."
          },
          "sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reject_reason": {
            "type": "string",
            "description": "Why Vigiora cloud refused the report (status `rejected`); empty otherwise."
          },
          "wire": {
            "$ref": "#/components/schemas/ErrorReportWire"
          }
        }
      },
      "ErrorReports": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "can_send",
          "pending",
          "system",
          "reports"
        ],
        "description": "The error reports consent and queue (API 1.118.0).",
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/ErrorReportMode"
          },
          "can_send": {
            "type": "boolean",
            "description": "False when this server is not connected to Vigiora cloud: nothing can be sent."
          },
          "pending": {
            "type": "integer",
            "description": "How many reports wait to be sent."
          },
          "system": {
            "$ref": "#/components/schemas/ErrorReportSystem"
          },
          "reports": {
            "type": "array",
            "description": "Pending first, then newest seen; at most 200.",
            "items": {
              "$ref": "#/components/schemas/ErrorReport"
            }
          }
        }
      },
      "ErrorReportSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "can_send"
        ],
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/ErrorReportMode"
          },
          "can_send": {
            "type": "boolean"
          }
        }
      },
      "ErrorReportSettingsUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/ErrorReportMode"
          }
        }
      },
      "ErrorReportIds": {
        "type": "object",
        "additionalProperties": false,
        "description": "Which pending reports to dismiss; omit `ids` for all of them.",
        "properties": {
          "ids": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          }
        }
      },
      "ErrorReportSend": {
        "type": "object",
        "additionalProperties": false,
        "description": "The reports to send, as they were shown; omit `reports` to send every pending one (mode `always` only).",
        "properties": {
          "reports": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "last_seen_at"
              ],
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1
                },
                "last_seen_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "The report's last_seen_at as it was shown."
                }
              }
            }
          }
        }
      },
      "ErrorReportsSent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sent",
          "rejected"
        ],
        "properties": {
          "sent": {
            "type": "integer"
          },
          "rejected": {
            "type": "integer",
            "description": "Reports Vigiora cloud refused (now `rejected`)."
          }
        }
      },
      "ErrorReportsDismissed": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dismissed"
        ],
        "properties": {
          "dismissed": {
            "type": "integer"
          }
        }
      },
      "ProgramStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "program",
          "member",
          "update_channel",
          "docker_install",
          "auto_update",
          "error_reports",
          "health_summary",
          "feedback_ready",
          "updated_at",
          "leave_url"
        ],
        "properties": {
          "program": {
            "type": "string",
            "description": "The program's name."
          },
          "member": {
            "type": "boolean"
          },
          "update_channel": {
            "type": "string",
            "enum": [
              "stable",
              "early"
            ]
          },
          "docker_install": {
            "type": "boolean",
            "description": "A Docker install always stays on the stable channel."
          },
          "auto_update": {
            "type": "boolean",
            "description": "Install updates automatically."
          },
          "error_reports": {
            "type": "string",
            "enum": [
              "ask",
              "always",
              "never"
            ]
          },
          "health_summary": {
            "type": "boolean",
            "description": "The daily health summary goes to the owner's Vigiora account."
          },
          "feedback_ready": {
            "type": "boolean",
            "description": "This server is connected to a Vigiora account and can send feedback."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When Vigiora last applied the program here."
          },
          "leave_url": {
            "type": "string",
            "format": "uri",
            "description": "Where the owner leaves the program."
          }
        }
      },
      "FeedbackInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "text"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "idea",
              "problem",
              "praise",
              "question",
              "other"
            ],
            "default": "other"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "page": {
            "type": "string",
            "maxLength": 200,
            "description": "The web app path the person is on."
          },
          "web_build": {
            "type": "string",
            "maxLength": 64,
            "description": "The web app build."
          }
        }
      },
      "Feedback": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "username",
          "text",
          "page",
          "server_version",
          "web_build",
          "member",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "idea",
              "problem",
              "praise",
              "question",
              "other"
            ]
          },
          "username": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "page": {
            "type": "string"
          },
          "server_version": {
            "type": "string"
          },
          "web_build": {
            "type": "string"
          },
          "member": {
            "type": "boolean",
            "description": "Sent as a member of the Vigiora Feedback Program."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FeedbackList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "feedback_ready",
          "member",
          "feedback"
        ],
        "properties": {
          "feedback_ready": {
            "type": "boolean"
          },
          "member": {
            "type": "boolean"
          },
          "feedback": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Feedback"
            }
          }
        }
      },
      "HealthStatus": {
        "type": "string",
        "enum": [
          "ok",
          "warn",
          "fail",
          "skip"
        ],
        "description": "`ok`, `warn` (needs attention soon), `fail` (needs attention now) or `skip` (could not be checked here)."
      },
      "HealthItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "category",
          "title",
          "status",
          "detail"
        ],
        "description": "One check of a health report.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable check id, e.g. `disk.recordings`, `gpu.driver`, `cameras.offline`."
          },
          "category": {
            "type": "string",
            "enum": [
              "disk",
              "system",
              "gpu",
              "services",
              "cameras",
              "database",
              "network",
              "security",
              "clients",
              "hardware"
            ]
          },
          "title": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/HealthStatus"
          },
          "detail": {
            "type": "string",
            "description": "What was found, as a plain sentence."
          },
          "hint": {
            "type": "string",
            "description": "How to fix it (warn and fail only)."
          },
          "short": {
            "type": "string",
            "description": "A few words for the one-line summary."
          },
          "value": {
            "type": "number",
            "description": "The measured value, when there is one."
          },
          "unit": {
            "type": "string"
          },
          "upgrade": {
            "$ref": "#/components/schemas/HealthUpgrade",
            "description": "The upgrade suggestion of an `upgrade.<kind>` item (category `hardware`, API 1.125.0)."
          }
        }
      },
      "HealthCounts": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ok",
          "warn",
          "fail",
          "skip"
        ],
        "properties": {
          "ok": {
            "type": "integer"
          },
          "warn": {
            "type": "integer"
          },
          "fail": {
            "type": "integer"
          },
          "skip": {
            "type": "integer"
          }
        }
      },
      "HealthChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "kind"
        ],
        "description": "A check whose status changed since the report before.",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "new_problem",
              "worse",
              "resolved",
              "better",
              "gone"
            ]
          },
          "from": {
            "$ref": "#/components/schemas/HealthStatus"
          },
          "to": {
            "$ref": "#/components/schemas/HealthStatus"
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "HealthReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "checked_at",
          "trigger",
          "status",
          "summary",
          "counts",
          "items",
          "changes",
          "duration_ms",
          "previous_id",
          "inventory_id",
          "cloud_sent_at",
          "notified_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          },
          "trigger": {
            "type": "string",
            "enum": [
              "scheduled",
              "manual",
              "boot"
            ],
            "description": "`scheduled` (the daily check), `manual` (Run now) or `boot` (catch-up after the server was off at the scheduled time)."
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "warn",
              "fail"
            ],
            "description": "The worst status of the report's checks."
          },
          "summary": {
            "type": "string",
            "description": "One line, e.g. \"All healthy\" or \"1 failure, 2 warnings: …\"."
          },
          "counts": {
            "$ref": "#/components/schemas/HealthCounts"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HealthItem"
            }
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HealthChange"
            }
          },
          "duration_ms": {
            "type": "integer"
          },
          "previous_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The report the changes compare against."
          },
          "inventory_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "cloud_sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When Vigiora cloud received the summary."
          },
          "cloud_error": {
            "type": "string",
            "description": "Why the summary did not reach Vigiora cloud (yet)."
          },
          "notified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "HealthReportPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HealthReport"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "HealthLatest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "report",
          "running",
          "started_at",
          "next_run_at"
        ],
        "properties": {
          "report": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/HealthReport"
              },
              {
                "type": "null"
              }
            ]
          },
          "running": {
            "type": "boolean",
            "description": "A check is running now."
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "next_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The next scheduled check; null when the daily check is off."
          }
        }
      },
      "HealthRunResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "running",
          "started_at",
          "next_run_at"
        ],
        "properties": {
          "running": {
            "type": "boolean"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "next_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "HealthSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "time",
          "notify",
          "cloud",
          "time_zone",
          "next_run_at"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Run the check every day."
          },
          "time": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
            "description": "When, HH:MM in `time_zone`."
          },
          "notify": {
            "type": "string",
            "enum": [
              "always",
              "problems",
              "never"
            ],
            "description": "Push and email after each check: `always`, `problems` (only when something is warn or fail) or `never`."
          },
          "cloud": {
            "type": "boolean",
            "description": "Send the summary to Vigiora cloud."
          },
          "time_zone": {
            "type": "string",
            "description": "The server's time zone."
          },
          "next_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "HealthSettingsUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "time": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
          },
          "notify": {
            "type": "string",
            "enum": [
              "always",
              "problems",
              "never"
            ]
          },
          "cloud": {
            "type": "boolean"
          }
        }
      },
      "HealthInventory": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "collected_at",
          "platform",
          "os_family",
          "os",
          "kernel",
          "hostname",
          "uptime_seconds",
          "in_container",
          "cpu",
          "ram_bytes",
          "swap_bytes",
          "gpus",
          "disks",
          "network",
          "usb",
          "version",
          "postgres",
          "db_mode",
          "hal_runners",
          "notes"
        ],
        "properties": {
          "collected_at": {
            "type": "string",
            "format": "date-time"
          },
          "platform": {
            "type": "string",
            "description": "e.g. `linux-amd64`, `macos-arm64`, `windows-amd64`."
          },
          "os_family": {
            "type": "string",
            "description": "`linux`, `macos` or `windows`."
          },
          "os": {
            "type": "string"
          },
          "kernel": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "uptime_seconds": {
            "type": "integer"
          },
          "in_container": {
            "type": "boolean"
          },
          "cpu": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "model",
              "cores",
              "threads"
            ],
            "properties": {
              "model": {
                "type": "string"
              },
              "cores": {
                "type": "integer"
              },
              "threads": {
                "type": "integer"
              }
            }
          },
          "form_factor": {
            "type": "string",
            "description": "The kind of computer (API 1.125.0): `desktop`, `laptop`, `mini_pc`, `all_in_one`, `server`, `raspberry_pi`, `board`, `virtual`, or empty when unknown (open set)."
          },
          "machine": {
            "type": "string",
            "description": "Maker and model, e.g. `Lenovo ThinkCentre M720q` (API 1.125.0)."
          },
          "memory": {
            "$ref": "#/components/schemas/HealthMemoryInfo"
          },
          "ram_bytes": {
            "type": "integer"
          },
          "swap_bytes": {
            "type": "integer"
          },
          "gpus": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "vendor",
                "name"
              ],
              "properties": {
                "vendor": {
                  "type": "string",
                  "enum": [
                    "nvidia",
                    "amd",
                    "intel",
                    "apple",
                    "other"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "driver": {
                  "type": "string"
                },
                "kernel_module": {
                  "type": "string",
                  "description": "The running NVIDIA kernel module version (Linux)."
                },
                "memory_bytes": {
                  "type": "integer"
                },
                "memory_used_bytes": {
                  "type": "integer"
                },
                "temp_c": {
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                }
              }
            }
          },
          "disks": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "device",
                "fs",
                "mount",
                "roles",
                "total_bytes",
                "free_bytes",
                "used_pct",
                "read_only"
              ],
              "properties": {
                "device": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "size_bytes": {
                  "type": "integer"
                },
                "rotational": {
                  "type": "boolean"
                },
                "fs": {
                  "type": "string"
                },
                "mount": {
                  "type": "string"
                },
                "roles": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "`os`, `recordings`, `db` or `data`."
                  }
                },
                "total_bytes": {
                  "type": "integer"
                },
                "free_bytes": {
                  "type": "integer"
                },
                "used_pct": {
                  "type": "number"
                },
                "read_only": {
                  "type": "boolean"
                },
                "health": {
                  "type": "string",
                  "description": "The disk's own health verdict when the OS reports one."
                }
              }
            }
          },
          "network": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "name",
                "kind",
                "up"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "ethernet",
                    "wifi",
                    "vpn",
                    "virtual",
                    "loopback"
                  ]
                },
                "up": {
                  "type": "boolean"
                },
                "speed_mbps": {
                  "type": "integer"
                },
                "addrs": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "usb": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "kind",
                "name"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "description": "`zigbee`, `bluetooth`, `audio`, `camera`, `storage` or `serial`."
                },
                "vendor_id": {
                  "type": "string"
                },
                "product_id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "version": {
            "type": "string"
          },
          "postgres": {
            "type": "string"
          },
          "db_mode": {
            "type": "string"
          },
          "hal_runners": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "service",
                "hostname",
                "last_seen"
              ],
              "properties": {
                "service": {
                  "type": "string"
                },
                "hostname": {
                  "type": "string"
                },
                "last_seen": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              }
            }
          },
          "memory_profile": {
            "$ref": "#/components/schemas/MemoryProfile"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "HealthMemoryInfo": {
        "type": "object",
        "additionalProperties": false,
        "description": "The installed memory as far as the system tells (API 1.125.0).",
        "properties": {
          "type": {
            "type": "string",
            "description": "`DDR3`, `DDR4`, `DDR5`, `LPDDR4`, `LPDDR5`, … (open set)."
          },
          "form": {
            "type": "string",
            "description": "`dimm` (desktop), `sodimm` (laptop / mini PC) or `soldered`."
          },
          "speed_mts": {
            "type": "integer"
          },
          "slots_total": {
            "type": "integer"
          },
          "slots_used": {
            "type": "integer"
          },
          "module_bytes": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "HealthUpgrade": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "reason",
          "options"
        ],
        "description": "One hardware upgrade suggestion (API 1.125.0).",
        "properties": {
          "kind": {
            "type": "string",
            "description": "`memory`, `cpu_heat`, `cpu_load`, `video_decode`, `disk_space`, `disk_health` or `disk_speed` (open set)."
          },
          "reason": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "description": "2–3 options, the most convenient first.",
            "items": {
              "$ref": "#/components/schemas/HealthUpgradeOption"
            }
          }
        }
      },
      "HealthUpgradeOption": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "level",
          "title",
          "why",
          "price_min_usd",
          "price_max_usd"
        ],
        "properties": {
          "level": {
            "type": "string",
            "enum": [
              "convenient",
              "better",
              "pro"
            ]
          },
          "title": {
            "type": "string"
          },
          "why": {
            "type": "string"
          },
          "price_min_usd": {
            "type": "integer",
            "minimum": 0,
            "description": "About this much, in US dollars (0 and 0: free)."
          },
          "price_max_usd": {
            "type": "integer",
            "minimum": 0
          },
          "url": {
            "type": "string",
            "description": "An Amazon search for the exact spec (absent when there is nothing to buy)."
          }
        }
      },
      "HealthUpgrades": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "report_id",
          "checked_at",
          "hardware",
          "upgrades"
        ],
        "properties": {
          "report_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "hardware": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "form_factor",
              "cpu_model",
              "ram_bytes",
              "memory"
            ],
            "properties": {
              "form_factor": {
                "type": "string"
              },
              "machine": {
                "type": "string"
              },
              "cpu_model": {
                "type": "string"
              },
              "ram_bytes": {
                "type": "integer"
              },
              "memory": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/HealthMemoryInfo"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "upgrades": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HealthUpgrade"
            }
          }
        }
      },
      "HealthDisks": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "checked_at",
          "disks"
        ],
        "properties": {
          "checked_at": {
            "type": "string",
            "format": "date-time"
          },
          "disks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HealthDisk"
            }
          },
          "bench_skipped": {
            "type": "string",
            "description": "Why the speed test did not run now (the server was busy)."
          }
        }
      },
      "HealthDisk": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "device",
          "mount",
          "roles",
          "total_bytes",
          "free_bytes",
          "used_pct",
          "bench",
          "io",
          "need_write_mbps",
          "cameras",
          "speed_status",
          "speed_note",
          "forecast"
        ],
        "properties": {
          "device": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "mount": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "`os`, `recordings`, `db` or `data`."
            }
          },
          "rotational": {
            "type": "boolean"
          },
          "total_bytes": {
            "type": "integer"
          },
          "free_bytes": {
            "type": "integer"
          },
          "used_pct": {
            "type": "number"
          },
          "bench": {
            "description": "The last speed test (null before the first).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/HealthDiskBench"
              },
              {
                "type": "null"
              }
            ]
          },
          "io": {
            "description": "How busy the disk is now (null when the OS does not tell).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/HealthDiskIO"
              },
              {
                "type": "null"
              }
            ]
          },
          "need_write_mbps": {
            "type": [
              "number",
              "null"
            ],
            "description": "What the cameras write in MB/s (recordings disk)."
          },
          "cameras": {
            "type": "integer",
            "description": "The cameras writing to it."
          },
          "speed_status": {
            "type": "string",
            "enum": [
              "ok",
              "warn",
              "unknown"
            ]
          },
          "speed_note": {
            "type": "string"
          },
          "forecast": {
            "$ref": "#/components/schemas/HealthDiskForecast"
          }
        }
      },
      "HealthDiskBench": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "measured_at",
          "write_mbps",
          "read_mbps",
          "latency_ms"
        ],
        "properties": {
          "measured_at": {
            "type": "string",
            "format": "date-time"
          },
          "write_mbps": {
            "type": [
              "number",
              "null"
            ]
          },
          "read_mbps": {
            "type": [
              "number",
              "null"
            ],
            "description": "Null where the cache cannot be bypassed (Windows)."
          },
          "latency_ms": {
            "type": [
              "number",
              "null"
            ],
            "description": "Median time of a 4 KiB write made durable."
          },
          "error": {
            "type": "string"
          }
        }
      },
      "HealthDiskIO": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "util_pct",
          "read_mbps",
          "write_mbps",
          "total_mbps",
          "await_ms"
        ],
        "properties": {
          "util_pct": {
            "type": [
              "number",
              "null"
            ]
          },
          "read_mbps": {
            "type": [
              "number",
              "null"
            ]
          },
          "write_mbps": {
            "type": [
              "number",
              "null"
            ]
          },
          "total_mbps": {
            "type": [
              "number",
              "null"
            ],
            "description": "Read plus write where the OS does not split them (macOS)."
          },
          "await_ms": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      },
      "HealthDiskForecast": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "growth_bytes_per_day",
          "growth_source",
          "days_left",
          "full_at",
          "stable",
          "stable_used_bytes",
          "text"
        ],
        "properties": {
          "growth_bytes_per_day": {
            "type": [
              "number",
              "null"
            ]
          },
          "growth_source": {
            "type": "string",
            "description": "`measured`, `cameras` or empty (unknown)."
          },
          "days_left": {
            "type": [
              "number",
              "null"
            ]
          },
          "full_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "stable": {
            "type": "boolean",
            "description": "Retention deletes old footage before the disk fills; it settles at `stable_used_bytes`."
          },
          "stable_used_bytes": {
            "type": [
              "number",
              "null"
            ]
          },
          "retention_days": {
            "type": "integer"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "ClientErrorPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientError"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ClientErrorResolve": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "note": {
            "type": "string",
            "maxLength": 2000,
            "description": "What was fixed (optional)."
          }
        }
      },
      "ClientErrorsResolved": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "resolved"
        ],
        "properties": {
          "resolved": {
            "type": "integer"
          }
        }
      },
      "WebhookPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhook"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "WebhookCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "url": {
            "type": "string",
            "maxLength": 2048
          },
          "event_types": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/EventType"
            }
          },
          "camera_ids": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "enabled": {
            "type": "boolean",
            "default": true
          },
          "allow_insecure": {
            "type": "boolean",
            "default": false,
            "description": "Allows private (LAN) targets and plain http to them. Needs an admin session or an admin-scoped key."
          }
        }
      },
      "WebhookUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "url": {
            "type": "string",
            "maxLength": 2048
          },
          "event_types": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/EventType"
            }
          },
          "camera_ids": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "allow_insecure": {
            "type": "boolean"
          }
        }
      },
      "Delivery": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "webhook_id",
          "event_id",
          "event_type",
          "status",
          "attempts",
          "next_attempt_at",
          "last_attempt_at",
          "last_status_code",
          "last_error",
          "duration_ms",
          "created_at",
          "delivered_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "webhook_id": {
            "type": "integer"
          },
          "event_id": {
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "`held`: kept while the webhook is disabled; resumes on re-enable.",
            "enum": [
              "pending",
              "delivering",
              "succeeded",
              "failed",
              "held"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "next_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the next attempt is due (pending only)."
          },
          "last_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_status_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Error class: timeout, refused, tls, dns, blocked, connection, http_error."
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "DeliveryPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Delivery"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "APIKey": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "prefix",
          "user_id",
          "username",
          "scoped",
          "scopes",
          "status",
          "created_at",
          "last_used_at",
          "expires_at",
          "revoked_at",
          "human_in_the_loop"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string",
            "description": "Public part of the key, `vgk_<key_id>`."
          },
          "user_id": {
            "type": "integer"
          },
          "username": {
            "type": "string"
          },
          "scoped": {
            "type": "boolean",
            "description": "`false` for a legacy key (works on /api too; implicit scopes from its read-only flag)."
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Scope"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Updated at most once a minute."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "human_in_the_loop": {
            "$ref": "#/components/schemas/HumanInTheLoopOverride"
          }
        }
      },
      "APIKeyUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "human_in_the_loop"
        ],
        "properties": {
          "human_in_the_loop": {
            "$ref": "#/components/schemas/HumanInTheLoopOverride"
          }
        }
      },
      "APIKeyCreated": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "prefix",
          "user_id",
          "username",
          "scoped",
          "scopes",
          "status",
          "created_at",
          "last_used_at",
          "expires_at",
          "revoked_at",
          "human_in_the_loop",
          "key"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "user_id": {
            "type": "integer"
          },
          "username": {
            "type": "string"
          },
          "scoped": {
            "type": "boolean"
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Scope"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "human_in_the_loop": {
            "$ref": "#/components/schemas/HumanInTheLoopOverride"
          },
          "key": {
            "type": "string",
            "description": "The full key. Shown only once; store it now."
          }
        }
      },
      "APIKeyPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/APIKey"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "APIKeyCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "scopes"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "scopes": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/Scope"
            }
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "At most 10 years ahead. Use this or `expires_in_days`; neither = no expiry."
          },
          "expires_in_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3650
          }
        }
      },
      "AlertRule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "camera_name",
          "name",
          "description",
          "type",
          "severity",
          "enabled",
          "cooldown_seconds",
          "video_rule",
          "audio_rule",
          "email_enabled",
          "email_recipients",
          "telegram_enabled",
          "line_enabled",
          "last_fired_at",
          "created_at",
          "updated_at",
          "warnings",
          "require_detector_confirmation",
          "speaker"
        ],
        "properties": {
          "speaker": {
            "$ref": "#/components/schemas/RuleSpeaker"
          },
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "camera_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "description": "What the rule is about, for people (shown with its alerts)."
          },
          "type": {
            "type": "string",
            "enum": [
              "video",
              "audio",
              "video_and_audio",
              "none"
            ],
            "description": "What the rule is checked against (`none`: neither rule text is set; it never fires)."
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "cooldown_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Minimum time between two alerts of the rule; `null` = the severity's default, `0` = none."
          },
          "video_rule": {
            "type": [
              "string",
              "null"
            ],
            "description": "What to look for in the camera's clips, in plain words."
          },
          "audio_rule": {
            "type": [
              "string",
              "null"
            ],
            "description": "What to listen for in the camera's transcripts, in plain words."
          },
          "email_enabled": {
            "type": "boolean"
          },
          "email_recipients": {
            "type": [
              "string",
              "null"
            ],
            "description": "Comma-separated addresses; `null` when not set or hidden (only admins and operators with a user session see them)."
          },
          "telegram_enabled": {
            "type": "boolean",
            "description": "The rule also sends a Telegram message (System → Integrations → Telegram). API 1.26.0."
          },
          "line_enabled": {
            "type": "boolean",
            "description": "The rule also sends a LINE message (System → Integrations → LINE). API 1.26.0."
          },
          "last_fired_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "warnings": {
            "type": "array",
            "description": "`ai_not_enabled`: the camera's AI is off, so the rule does not fire until it is switched on (`POST /cameras/{camera_id}/actions/enable-ai`). Open set.",
            "items": {
              "type": "string"
            }
          },
          "require_detector_confirmation": {
            "type": "boolean",
            "description": "For a rule about people (its name or video rule names a person, someone, an intruder, …), alert only when the camera's person-capable object detector, if one was running on the camera during the clip, reported a person in it; otherwise the Guardian entry is kept with the rule in its `unconfirmed_alerts`. Without such a detector, or when it was not running, the rule alerts as usual. Default `true`. API 1.13.0."
          }
        }
      },
      "AlertRulePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertRule"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RoomAlertRule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "room_id",
          "room_name",
          "name",
          "description",
          "type",
          "severity",
          "enabled",
          "cooldown_seconds",
          "video_rule",
          "audio_rule",
          "email_enabled",
          "email_recipients",
          "telegram_enabled",
          "line_enabled",
          "last_fired_at",
          "created_at",
          "updated_at",
          "warnings",
          "require_detector_confirmation",
          "speaker"
        ],
        "properties": {
          "speaker": {
            "$ref": "#/components/schemas/RuleSpeaker"
          },
          "id": {
            "type": "integer"
          },
          "room_id": {
            "type": "integer"
          },
          "room_name": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "video",
              "audio",
              "video_and_audio",
              "none"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "cooldown_seconds": {
            "type": [
              "integer",
              "null"
            ]
          },
          "video_rule": {
            "type": [
              "string",
              "null"
            ]
          },
          "audio_rule": {
            "type": [
              "string",
              "null"
            ]
          },
          "email_enabled": {
            "type": "boolean"
          },
          "email_recipients": {
            "type": [
              "string",
              "null"
            ],
            "description": "Hidden (`null`) as for camera rules."
          },
          "telegram_enabled": {
            "type": "boolean",
            "description": "The rule also sends a Telegram message (System → Integrations → Telegram). API 1.26.0."
          },
          "line_enabled": {
            "type": "boolean",
            "description": "The rule also sends a LINE message (System → Integrations → LINE). API 1.26.0."
          },
          "last_fired_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "warnings": {
            "type": "array",
            "description": "`room_not_guardian`: the room's `ai_mode` is `live`, so the rule is not checked. Open set.",
            "items": {
              "type": "string"
            }
          },
          "require_detector_confirmation": {
            "type": "boolean"
          }
        }
      },
      "RoomAlertRulePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoomAlertRule"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AlertRuleCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "description"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "No control characters."
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ],
            "default": "normal"
          },
          "enabled": {
            "type": "boolean",
            "default": true
          },
          "cooldown_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 86400,
            "description": "`0`, or 60 to 86400; `null` (default) = the severity's default."
          },
          "video_rule": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4096
          },
          "audio_rule": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4096
          },
          "email_enabled": {
            "type": "boolean",
            "default": false,
            "description": "User sessions only."
          },
          "email_recipients": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1024,
            "description": "Comma-separated e-mail addresses (at most 10). Admin and operator sessions only."
          },
          "telegram_enabled": {
            "type": "boolean",
            "default": false,
            "description": "Send to the Telegram channel set up in System → Integrations. API 1.26.0."
          },
          "line_enabled": {
            "type": "boolean",
            "default": false,
            "description": "Send to the LINE channel set up in System → Integrations. API 1.26.0."
          },
          "require_detector_confirmation": {
            "type": "boolean",
            "default": true,
            "description": "See `AlertRule.require_detector_confirmation`."
          }
        }
      },
      "AlertRuleUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Only the fields sent change.",
        "properties": {
          "speaker": {
            "$ref": "#/components/schemas/RuleSpeakerUpdate"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "cooldown_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 86400
          },
          "video_rule": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4096
          },
          "audio_rule": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4096
          },
          "email_enabled": {
            "type": "boolean"
          },
          "email_recipients": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1024
          },
          "telegram_enabled": {
            "type": "boolean"
          },
          "line_enabled": {
            "type": "boolean"
          },
          "require_detector_confirmation": {
            "type": "boolean"
          }
        }
      },
      "LabelAlertRule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "label",
          "severity",
          "enabled",
          "created_at",
          "speaker"
        ],
        "properties": {
          "speaker": {
            "$ref": "#/components/schemas/RuleSpeaker"
          },
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": "`true`: detections of the label are alerts."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LabelAlertRulePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelAlertRule"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "LabelAlertRuleCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "label"
        ],
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "A detector label (`person`, `car`, …)."
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ],
            "default": "normal"
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "LabelAlertRuleUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "speaker": {
            "$ref": "#/components/schemas/RuleSpeakerUpdate"
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "CameraLabel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "label",
          "service_name",
          "source",
          "promoted",
          "severity",
          "label_alert_rule_id",
          "results_only"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "service_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The AI service that emitted it."
          },
          "source": {
            "type": "string",
            "enum": [
              "hal_events",
              "detections",
              "rule"
            ]
          },
          "promoted": {
            "type": "boolean",
            "description": "An enabled label alert rule makes it an alert."
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "label_alert_rule_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "results_only": {
            "type": "boolean",
            "description": "API 1.106.0. Every service that reported the label on this camera is a community add-on that cannot raise alerts on it (it was not granted `alerts:write`, the label is not in a namespace it owns, or it is no longer installed), and the camera has no alert with that label: a label alert rule on it never fires. `false` for every other label."
          }
        }
      },
      "CameraLabelPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CameraLabel"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MotionRule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "name",
          "rule_type",
          "geometry",
          "label_filter",
          "enabled",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "rule_type": {
            "type": "string",
            "enum": [
              "line",
              "zone"
            ]
          },
          "geometry": {
            "type": "array",
            "description": "Points `[x, y]`, normalised (0..1, origin top left).",
            "items": {
              "type": "array",
              "minItems": 2,
              "maxItems": 2,
              "items": {
                "type": "number"
              }
            }
          },
          "label_filter": {
            "type": "string",
            "description": "`any`, `person` or `vehicle`."
          },
          "enabled": {
            "type": "boolean"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "MotionRulePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MotionRule"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MotionRuleCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "rule_type",
          "geometry"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "rule_type": {
            "type": "string",
            "enum": [
              "line",
              "zone"
            ]
          },
          "geometry": {
            "type": "array",
            "minItems": 2,
            "maxItems": 32,
            "items": {
              "type": "array",
              "minItems": 2,
              "maxItems": 2,
              "items": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              }
            }
          },
          "label_filter": {
            "type": "string",
            "enum": [
              "any",
              "person",
              "vehicle"
            ],
            "default": "any"
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "MotionRuleUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "rule_type": {
            "type": "string",
            "enum": [
              "line",
              "zone"
            ]
          },
          "geometry": {
            "type": "array",
            "minItems": 2,
            "maxItems": 32,
            "items": {
              "type": "array",
              "minItems": 2,
              "maxItems": 2,
              "items": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              }
            }
          },
          "label_filter": {
            "type": "string",
            "enum": [
              "any",
              "person",
              "vehicle"
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "AnalyticsPoint": {
        "type": "array",
        "description": "A point `[x, y]`, normalised (0..1, origin top left).",
        "minItems": 2,
        "maxItems": 2,
        "items": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      },
      "AnalyticsClassList": {
        "type": [
          "array",
          "null"
        ],
        "description": "The classes counted; `null` = the camera's classes.",
        "items": {
          "type": "string",
          "enum": [
            "person",
            "car",
            "truck",
            "bus",
            "motorbike",
            "bicycle"
          ]
        }
      },
      "AnalyticsLine": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "name",
          "a",
          "b",
          "in_label",
          "out_label",
          "classes",
          "anchor",
          "band",
          "enabled",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "a": {
            "$ref": "#/components/schemas/AnalyticsPoint"
          },
          "b": {
            "$ref": "#/components/schemas/AnalyticsPoint"
          },
          "in_label": {
            "type": "string",
            "description": "Name of the \"in\" direction (for example \"Enter\")."
          },
          "out_label": {
            "type": "string",
            "description": "Name of the \"out\" direction."
          },
          "classes": {
            "$ref": "#/components/schemas/AnalyticsClassList"
          },
          "anchor": {
            "type": "string",
            "enum": [
              "foot",
              "centre"
            ],
            "description": "Which point of an object crosses: its foot (bottom centre) or centre."
          },
          "band": {
            "type": "number",
            "description": "Dead band around the line (image fraction) against double counts."
          },
          "enabled": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AnalyticsLinePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsLine"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AnalyticsLineCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "name",
          "a",
          "b"
        ],
        "properties": {
          "camera_id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "a": {
            "$ref": "#/components/schemas/AnalyticsPoint"
          },
          "b": {
            "$ref": "#/components/schemas/AnalyticsPoint"
          },
          "in_label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "default": "In"
          },
          "out_label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "default": "Out"
          },
          "classes": {
            "$ref": "#/components/schemas/AnalyticsClassList"
          },
          "anchor": {
            "type": "string",
            "enum": [
              "foot",
              "centre"
            ],
            "default": "foot"
          },
          "band": {
            "type": "number",
            "minimum": 0.005,
            "maximum": 0.2,
            "default": 0.02
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "AnalyticsLineUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "a": {
            "$ref": "#/components/schemas/AnalyticsPoint"
          },
          "b": {
            "$ref": "#/components/schemas/AnalyticsPoint"
          },
          "in_label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "out_label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "classes": {
            "$ref": "#/components/schemas/AnalyticsClassList"
          },
          "anchor": {
            "type": "string",
            "enum": [
              "foot",
              "centre"
            ]
          },
          "band": {
            "type": "number",
            "minimum": 0.005,
            "maximum": 0.2
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "AnalyticsZone": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "name",
          "polygon",
          "kind",
          "classes",
          "anchor",
          "min_dwell_sec",
          "capacity",
          "enabled",
          "created_at",
          "updated_at",
          "queue_min_wait_sec",
          "reserved_schedule",
          "max_stay_min"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "polygon": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsPoint"
            }
          },
          "kind": {
            "type": "string",
            "enum": [
              "zone",
              "queue",
              "bay"
            ],
            "description": "`zone` (visits and dwell), `queue` (also the waits, `getAnalyticsQueues`) or `bay` (a parking bay: taken or free, `getAnalyticsBays`); other kinds may be added (API 1.30.0)."
          },
          "classes": {
            "$ref": "#/components/schemas/AnalyticsClassList"
          },
          "anchor": {
            "type": "string",
            "enum": [
              "foot",
              "centre"
            ]
          },
          "min_dwell_sec": {
            "type": "number",
            "description": "Shorter stays are not counted as visits."
          },
          "capacity": {
            "type": [
              "integer",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "queue_min_wait_sec": {
            "type": "number",
            "description": "Queue zones: someone in the zone this long counts as queued."
          },
          "reserved_schedule": {
            "$ref": "#/components/schemas/AnalyticsWeekly"
          },
          "max_stay_min": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Bays: the longest allowed stay (minutes; `bay_overstay` rules)."
          }
        }
      },
      "AnalyticsZonePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsZone"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AnalyticsZoneCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "name",
          "polygon"
        ],
        "properties": {
          "camera_id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "polygon": {
            "type": "array",
            "minItems": 3,
            "items": {
              "$ref": "#/components/schemas/AnalyticsPoint"
            }
          },
          "classes": {
            "$ref": "#/components/schemas/AnalyticsClassList"
          },
          "anchor": {
            "type": "string",
            "enum": [
              "foot",
              "centre"
            ],
            "default": "foot"
          },
          "min_dwell_sec": {
            "type": "number",
            "minimum": 0,
            "maximum": 3600,
            "default": 2,
            "description": "Default 30 for a bay."
          },
          "capacity": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 100000
          },
          "enabled": {
            "type": "boolean",
            "default": true
          },
          "kind": {
            "type": "string",
            "enum": [
              "zone",
              "queue",
              "bay"
            ],
            "default": "zone",
            "description": "A bay counts vehicles only (no person or bicycle class)."
          },
          "queue_min_wait_sec": {
            "type": "number",
            "minimum": 1,
            "maximum": 600,
            "default": 10
          },
          "reserved_schedule": {
            "$ref": "#/components/schemas/AnalyticsWeekly"
          },
          "max_stay_min": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 10080
          }
        }
      },
      "AnalyticsZoneUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "polygon": {
            "type": "array",
            "minItems": 3,
            "items": {
              "$ref": "#/components/schemas/AnalyticsPoint"
            }
          },
          "classes": {
            "$ref": "#/components/schemas/AnalyticsClassList"
          },
          "anchor": {
            "type": "string",
            "enum": [
              "foot",
              "centre"
            ]
          },
          "min_dwell_sec": {
            "type": "number",
            "minimum": 0,
            "maximum": 3600
          },
          "capacity": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 100000
          },
          "enabled": {
            "type": "boolean"
          },
          "kind": {
            "type": "string",
            "enum": [
              "zone",
              "queue",
              "bay"
            ]
          },
          "queue_min_wait_sec": {
            "type": "number",
            "minimum": 1,
            "maximum": 600
          },
          "reserved_schedule": {
            "$ref": "#/components/schemas/AnalyticsWeekly"
          },
          "max_stay_min": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 10080
          }
        }
      },
      "AnalyticsAreaLine": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "line_id",
          "sign"
        ],
        "properties": {
          "line_id": {
            "type": "integer",
            "minimum": 1
          },
          "sign": {
            "type": "integer",
            "enum": [
              1,
              -1
            ],
            "description": "1: the line's \"in\" enters the area; -1: it leaves it."
          }
        }
      },
      "AnalyticsArea": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "site_id",
          "capacity",
          "reset_at",
          "sort_order",
          "lines",
          "zones",
          "open_hours"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "capacity": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reset_at": {
            "type": "string",
            "description": "Local time (HH:MM) the occupancy resets to 0 every day."
          },
          "sort_order": {
            "type": "integer"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsAreaLine"
            }
          },
          "zones": {
            "type": "array",
            "description": "Zone ids.",
            "items": {
              "type": "integer"
            }
          },
          "open_hours": {
            "$ref": "#/components/schemas/AnalyticsWeekly"
          }
        }
      },
      "AnalyticsAreaPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsArea"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AnalyticsAreaCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "capacity": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 100000
          },
          "reset_at": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
            "default": "04:00"
          },
          "sort_order": {
            "type": "integer",
            "default": 0
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "lines": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/AnalyticsAreaLine"
            }
          },
          "zones": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "open_hours": {
            "$ref": "#/components/schemas/AnalyticsWeekly"
          }
        }
      },
      "AnalyticsAreaUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "capacity": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 100000
          },
          "reset_at": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
          },
          "sort_order": {
            "type": "integer"
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "lines": {
            "type": [
              "array",
              "null"
            ],
            "description": "Replaces the area's lines (`null` = none).",
            "items": {
              "$ref": "#/components/schemas/AnalyticsAreaLine"
            }
          },
          "zones": {
            "type": [
              "array",
              "null"
            ],
            "description": "Replaces the area's zones (`null` = none).",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "open_hours": {
            "$ref": "#/components/schemas/AnalyticsWeekly"
          }
        }
      },
      "AnalyticsCameraSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "enabled",
          "classes",
          "detect_fps",
          "source_token_id",
          "stop_speed",
          "lines",
          "zones",
          "calibration",
          "metres_per_unit"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "enabled": {
            "type": "boolean",
            "description": "Analytics runs on this camera (counts toward the add-on's licence)."
          },
          "classes": {
            "type": "array",
            "description": "The classes the camera's lines and zones count unless they list their own.",
            "items": {
              "type": "string",
              "enum": [
                "person",
                "car",
                "truck",
                "bus",
                "motorbike",
                "bicycle"
              ]
            }
          },
          "detect_fps": {
            "type": [
              "number",
              "null"
            ],
            "description": "Detection rate asked of the detector; null = 3 per second, or 5 when the camera counts a vehicle class and has an enabled line."
          },
          "source_token_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The detector (Vision Engine token) whose tracks are used; null = the first to report. A source token that is revoked or no longer assigned to the camera counts as unset, so another detector of the camera takes over."
          },
          "stop_speed": {
            "type": "number",
            "description": "Below this speed (image fractions per second) an object counts as stopped."
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsLine"
            }
          },
          "zones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsZone"
            }
          },
          "calibration": {
            "$ref": "#/components/schemas/AnalyticsCalibration"
          },
          "metres_per_unit": {
            "type": [
              "number",
              "null"
            ],
            "description": "Metres per normalised image unit, from the calibration; null without one."
          }
        }
      },
      "AnalyticsCameraUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "classes": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "person",
                "car",
                "truck",
                "bus",
                "motorbike",
                "bicycle"
              ]
            }
          },
          "detect_fps": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0.5,
            "maximum": 15
          },
          "stop_speed": {
            "type": "number",
            "minimum": 0.001,
            "maximum": 0.5
          },
          "source_token_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "An active detector (Vision Engine token) assigned to the camera, else 400; null resets the source so the next detector to report becomes it."
          },
          "calibration": {
            "$ref": "#/components/schemas/AnalyticsCalibration"
          }
        }
      },
      "AnalyticsOccupancySet": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "set_to"
        ],
        "properties": {
          "set_to": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          }
        }
      },
      "AnalyticsAreaOccupancy": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "area_id",
          "name",
          "occupancy",
          "capacity",
          "free",
          "source",
          "since",
          "bays"
        ],
        "properties": {
          "area_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "occupancy": {
            "type": "integer"
          },
          "capacity": {
            "type": [
              "integer",
              "null"
            ]
          },
          "free": {
            "type": [
              "integer",
              "null"
            ],
            "description": "capacity − occupancy (never below 0); null without a capacity."
          },
          "source": {
            "type": "string",
            "enum": [
              "lines",
              "zones",
              "bays",
              "none"
            ],
            "description": "`lines` (in minus out), `zones` (who is in the zones now), `bays` (an area of parking bays only: the vehicles in them, with `bays`; API 1.30.0) or `none` (no lines or zones yet)."
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "description": "Last reset or correction (zones, bays: the time of the reading)."
          },
          "bays": {
            "$ref": "#/components/schemas/AnalyticsBayCount"
          }
        }
      },
      "AnalyticsOccupancy": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "areas"
        ],
        "properties": {
          "areas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsAreaOccupancy"
            }
          }
        }
      },
      "AnalyticsCountPoint": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "t",
          "in",
          "out",
          "visits",
          "covered_pct"
        ],
        "properties": {
          "t": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the step."
          },
          "in": {
            "type": "integer"
          },
          "out": {
            "type": "integer"
          },
          "visits": {
            "type": "integer",
            "description": "Zone visits started in the step (area and camera counts)."
          },
          "covered_pct": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          }
        }
      },
      "AnalyticsCounts": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "tz",
          "class",
          "in",
          "out",
          "covered_pct",
          "step",
          "series",
          "by_class"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "tz": {
            "type": "string",
            "description": "The server's time zone (IANA name; empty when unknown)."
          },
          "class": {
            "type": "string"
          },
          "in": {
            "type": "integer"
          },
          "out": {
            "type": "integer"
          },
          "covered_pct": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "Share of the period the detector was watching the cameras involved (0–100). Below 100, say so when you report the numbers."
          },
          "step": {
            "type": [
              "string",
              "null"
            ]
          },
          "series": {
            "type": [
              "array",
              "null"
            ],
            "description": "One point per step; null without `step`.",
            "items": {
              "$ref": "#/components/schemas/AnalyticsCountPoint"
            }
          },
          "by_class": {
            "type": "object",
            "description": "\"in\" per class.",
            "additionalProperties": {
              "type": "integer"
            }
          }
        }
      },
      "AnalyticsZoneDwell": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "zone_id",
          "name",
          "camera_id",
          "visits",
          "avg_ms",
          "median_ms",
          "hist",
          "stopped_pct"
        ],
        "properties": {
          "zone_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "camera_id": {
            "type": "integer"
          },
          "visits": {
            "type": "integer"
          },
          "avg_ms": {
            "type": "integer"
          },
          "median_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "hist": {
            "type": "array",
            "description": "Visits per dwell bin (bounds in `hist_bounds_ms`; the last bin is everything longer).",
            "items": {
              "type": "integer"
            }
          },
          "stopped_pct": {
            "type": "number",
            "description": "Share of the dwell time spent stopped (0–100)."
          }
        }
      },
      "AnalyticsDwell": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "tz",
          "class",
          "hist_bounds_ms",
          "zones"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "tz": {
            "type": "string"
          },
          "class": {
            "type": "string"
          },
          "hist_bounds_ms": {
            "type": "array",
            "description": "Upper bounds of the histogram bins (milliseconds).",
            "items": {
              "type": "integer"
            }
          },
          "zones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsZoneDwell"
            }
          }
        }
      },
      "AnalyticsHeatmap": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "from",
          "to",
          "tz",
          "class",
          "layer",
          "w",
          "h",
          "cells",
          "max"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "tz": {
            "type": "string"
          },
          "class": {
            "type": "string"
          },
          "layer": {
            "type": "string",
            "enum": [
              "pass",
              "stop"
            ]
          },
          "w": {
            "type": "integer"
          },
          "h": {
            "type": "integer"
          },
          "cells": {
            "type": "array",
            "description": "`w` × `h` values, row-major (x first).",
            "items": {
              "type": "integer",
              "minimum": 0
            }
          },
          "max": {
            "type": "integer"
          }
        }
      },
      "AnalyticsDayWindows": {
        "type": "array",
        "description": "`[\"HH:MM\", \"HH:MM\"]` windows of one day (end exclusive; an end before the start runs past midnight).",
        "maxItems": 8,
        "items": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
          }
        }
      },
      "AnalyticsWeekly": {
        "type": [
          "object",
          "null"
        ],
        "description": "Weekly time windows in the server's time zone, per day (`mon` … `sun`); a missing day is closed. `null` (or `{}` on input) = always.",
        "additionalProperties": false,
        "properties": {
          "mon": {
            "$ref": "#/components/schemas/AnalyticsDayWindows"
          },
          "tue": {
            "$ref": "#/components/schemas/AnalyticsDayWindows"
          },
          "wed": {
            "$ref": "#/components/schemas/AnalyticsDayWindows"
          },
          "thu": {
            "$ref": "#/components/schemas/AnalyticsDayWindows"
          },
          "fri": {
            "$ref": "#/components/schemas/AnalyticsDayWindows"
          },
          "sat": {
            "$ref": "#/components/schemas/AnalyticsDayWindows"
          },
          "sun": {
            "$ref": "#/components/schemas/AnalyticsDayWindows"
          }
        }
      },
      "AnalyticsCalibration": {
        "type": [
          "object",
          "null"
        ],
        "description": "A known distance drawn on the camera's image (`a` to `b`, `metres` long) that turns image movement into speed; `null` = none (no speeds).",
        "additionalProperties": false,
        "required": [
          "a",
          "b",
          "metres"
        ],
        "properties": {
          "a": {
            "$ref": "#/components/schemas/AnalyticsPoint"
          },
          "b": {
            "$ref": "#/components/schemas/AnalyticsPoint"
          },
          "metres": {
            "type": "number",
            "minimum": 0.1,
            "maximum": 1000
          }
        }
      },
      "AnalyticsBayCount": {
        "type": [
          "object",
          "null"
        ],
        "description": "Free and total parking bays of an area counted by its bays (`source` `bays`); else null.",
        "additionalProperties": false,
        "required": [
          "free",
          "total"
        ],
        "properties": {
          "free": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "AnalyticsQueuePoint": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "t",
          "avg_wait_ms",
          "waited",
          "queue_max"
        ],
        "properties": {
          "t": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the step."
          },
          "avg_wait_ms": {
            "type": "integer"
          },
          "waited": {
            "type": "integer",
            "description": "Queued visits that started in the step."
          },
          "queue_max": {
            "type": "integer",
            "description": "The longest queue seen in the step."
          }
        }
      },
      "AnalyticsQueueZone": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "zone_id",
          "name",
          "camera_id",
          "queued_now",
          "waited",
          "avg_wait_ms",
          "max_wait_ms",
          "median_wait_ms",
          "service_level_pct",
          "series"
        ],
        "properties": {
          "zone_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "camera_id": {
            "type": "integer"
          },
          "queued_now": {
            "type": "integer",
            "description": "People queued in the zone now."
          },
          "waited": {
            "type": "integer",
            "description": "Queued visits in the period."
          },
          "avg_wait_ms": {
            "type": "integer"
          },
          "max_wait_ms": {
            "type": "integer"
          },
          "median_wait_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "service_level_pct": {
            "type": [
              "number",
              "null"
            ],
            "description": "Share that waited under 60 s (0–100); null without waits."
          },
          "series": {
            "type": [
              "array",
              "null"
            ],
            "description": "One point per step; null without `step`.",
            "items": {
              "$ref": "#/components/schemas/AnalyticsQueuePoint"
            }
          }
        }
      },
      "AnalyticsQueues": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "tz",
          "step",
          "zones"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "tz": {
            "type": "string"
          },
          "step": {
            "type": [
              "string",
              "null"
            ]
          },
          "zones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsQueueZone"
            }
          }
        }
      },
      "AnalyticsBusyHours": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "tz",
          "class",
          "metric",
          "days",
          "max"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "tz": {
            "type": "string"
          },
          "class": {
            "type": "string"
          },
          "metric": {
            "type": "string",
            "enum": [
              "in"
            ],
            "description": "What is averaged."
          },
          "days": {
            "type": "array",
            "description": "7 rows (Monday first) of 24 hourly averages (local hours).",
            "minItems": 7,
            "maxItems": 7,
            "items": {
              "type": "array",
              "minItems": 24,
              "maxItems": 24,
              "items": {
                "type": "number",
                "minimum": 0
              }
            }
          },
          "max": {
            "type": "number",
            "description": "The largest value of the matrix."
          }
        }
      },
      "AnalyticsSpeedClass": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "avg_mps",
          "max_mps",
          "count"
        ],
        "properties": {
          "avg_mps": {
            "type": "number"
          },
          "max_mps": {
            "type": "number"
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "AnalyticsSpeedPoint": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "t",
          "avg_mps",
          "max_mps",
          "count"
        ],
        "properties": {
          "t": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the step."
          },
          "avg_mps": {
            "type": "number"
          },
          "max_mps": {
            "type": "number"
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "AnalyticsSpeed": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "tz",
          "class",
          "calibrated",
          "avg_mps",
          "max_mps",
          "count",
          "by_class",
          "step",
          "series"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "tz": {
            "type": "string"
          },
          "class": {
            "type": "string"
          },
          "calibrated": {
            "type": "boolean",
            "description": "A camera of the scope has a calibration; false: no speed is measured."
          },
          "avg_mps": {
            "type": "number",
            "description": "Average speed (m/s, an estimate); 0 without crossings."
          },
          "max_mps": {
            "type": "number"
          },
          "count": {
            "type": "integer",
            "description": "Crossings with a measured speed."
          },
          "by_class": {
            "type": "object",
            "description": "Per class, whatever `class` is.",
            "additionalProperties": {
              "$ref": "#/components/schemas/AnalyticsSpeedClass"
            }
          },
          "step": {
            "type": [
              "string",
              "null"
            ]
          },
          "series": {
            "type": [
              "array",
              "null"
            ],
            "description": "One point per step; null without `step`.",
            "items": {
              "$ref": "#/components/schemas/AnalyticsSpeedPoint"
            }
          }
        }
      },
      "AnalyticsFlow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "from_name",
          "to_name",
          "count"
        ],
        "properties": {
          "from": {
            "type": "string",
            "description": "`line:<id>` or `zone:<id>`."
          },
          "to": {
            "type": "string"
          },
          "from_name": {
            "type": "string"
          },
          "to_name": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "AnalyticsPath": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "track_id",
          "class",
          "start",
          "end",
          "points"
        ],
        "properties": {
          "track_id": {
            "type": "integer"
          },
          "class": {
            "type": "string"
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "points": {
            "type": "array",
            "description": "Foot points `[x, y]` (normalised to the image, origin top left; may lie slightly outside 0..1).",
            "items": {
              "type": "array",
              "minItems": 2,
              "maxItems": 2,
              "items": {
                "type": "number"
              }
            }
          }
        }
      },
      "AnalyticsPaths": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "from",
          "to",
          "tz",
          "class",
          "paths",
          "flows",
          "truncated"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "tz": {
            "type": "string"
          },
          "class": {
            "type": "string"
          },
          "paths": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsPath"
            }
          },
          "flows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsFlow"
            }
          },
          "truncated": {
            "type": "boolean",
            "description": "More tracks started in the period than `limit`."
          }
        }
      },
      "AnalyticsFlows": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "from",
          "to",
          "tz",
          "class",
          "tracks",
          "flows",
          "truncated"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "tz": {
            "type": "string"
          },
          "class": {
            "type": "string"
          },
          "tracks": {
            "type": "integer",
            "description": "The tracks the flows were counted over."
          },
          "flows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsFlow"
            }
          },
          "truncated": {
            "type": "boolean",
            "description": "More tracks started in the period than `limit`."
          }
        }
      },
      "AnalyticsBay": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "zone_id",
          "camera_id",
          "name",
          "taken",
          "since",
          "stay_ms",
          "class",
          "stays",
          "avg_stay_ms",
          "median_stay_ms",
          "occupied_pct"
        ],
        "properties": {
          "zone_id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "taken": {
            "type": "boolean"
          },
          "since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Start of the current stay while taken."
          },
          "stay_ms": {
            "type": "integer",
            "description": "Length of the current stay; 0 when free."
          },
          "class": {
            "type": "string",
            "description": "The vehicle class while taken; \"\" when free."
          },
          "stays": {
            "type": "integer",
            "description": "Finished stays that started in the period."
          },
          "avg_stay_ms": {
            "type": "integer"
          },
          "median_stay_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "occupied_pct": {
            "type": "number",
            "description": "Share of the watched time the bay was taken (0–100)."
          }
        }
      },
      "AnalyticsBays": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "tz",
          "free",
          "total",
          "bays"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "tz": {
            "type": "string"
          },
          "free": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "bays": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsBay"
            }
          }
        }
      },
      "AnalyticsAlertKind": {
        "type": "string",
        "enum": [
          "capacity",
          "queue_length",
          "queue_wait",
          "loitering",
          "wrong_direction",
          "tailgating",
          "speed",
          "no_bays_free",
          "zone_empty",
          "line_below",
          "bay_reserved",
          "bay_overstay"
        ]
      },
      "AnalyticsAlertChannels": {
        "type": "object",
        "description": "Where a firing goes besides the Alerts list.",
        "additionalProperties": false,
        "properties": {
          "push": {
            "type": "boolean",
            "description": "Push notifications to the app. Default true."
          },
          "email": {
            "type": [
              "array",
              "null"
            ],
            "description": "Addresses that get an email (at most 10).",
            "maxItems": 10,
            "items": {
              "type": "string"
            }
          },
          "webhook": {
            "type": "boolean",
            "description": "Marks the fire as an alert: sidebar badge, floor plan, alert-only lists and webhooks. Default true."
          },
          "telegram": {
            "type": "boolean"
          },
          "line": {
            "type": "boolean"
          },
          "snapshot": {
            "type": "boolean",
            "description": "Attach a live frame (line and zone targets)."
          }
        }
      },
      "AnalyticsAlertRule": {
        "type": "object",
        "description": "An analytics alert rule. A rule is deleted together with its zone, line or area.",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "kind",
          "zone_id",
          "line_id",
          "area_id",
          "camera_id",
          "params",
          "schedule",
          "channels",
          "severity",
          "cooldown_sec",
          "enabled",
          "last_fired_at",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/AnalyticsAlertKind"
          },
          "zone_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "line_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "area_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "params": {
            "type": "object",
            "description": "The kind's parameters with their defaults filled in."
          },
          "schedule": {
            "$ref": "#/components/schemas/AnalyticsWeekly"
          },
          "channels": {
            "$ref": "#/components/schemas/AnalyticsAlertChannels"
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "cooldown_sec": {
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "last_fired_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AnalyticsAlertRulePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsAlertRule"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AnalyticsAlertRuleCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "kind"
        ],
        "description": "Give exactly the target the kind needs (`zone_id`, `line_id`, `area_id` or `camera_id`).",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "kind": {
            "$ref": "#/components/schemas/AnalyticsAlertKind"
          },
          "zone_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "line_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "area_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "params": {
            "type": "object",
            "description": "The kind's parameters (see the description); missing ones take their defaults."
          },
          "schedule": {
            "$ref": "#/components/schemas/AnalyticsWeekly"
          },
          "channels": {
            "$ref": "#/components/schemas/AnalyticsAlertChannels"
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ],
            "default": "normal"
          },
          "cooldown_sec": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400,
            "default": 300
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "AnalyticsAlertRuleUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "kind": {
            "$ref": "#/components/schemas/AnalyticsAlertKind"
          },
          "zone_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "line_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "area_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "params": {
            "type": "object"
          },
          "schedule": {
            "$ref": "#/components/schemas/AnalyticsWeekly"
          },
          "channels": {
            "$ref": "#/components/schemas/AnalyticsAlertChannels"
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "cooldown_sec": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "AnalyticsAlertEvent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "rule_id",
          "rule_name",
          "kind",
          "camera_id",
          "fired_at",
          "value",
          "message",
          "detection_id"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "rule_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "null once the rule is deleted."
          },
          "rule_name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "fired_at": {
            "type": "string",
            "format": "date-time"
          },
          "value": {
            "type": [
              "number",
              "null"
            ],
            "description": "The measured number (occupancy %, people queued, seconds, km/h, …)."
          },
          "message": {
            "type": "string"
          },
          "detection_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The alert (`/alerts/{alert_id}`) it raised."
          }
        }
      },
      "AnalyticsAlertEvents": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "tz",
          "events"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "tz": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsAlertEvent"
            }
          }
        }
      },
      "AnalyticsDisplaySettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "lang",
          "open_text",
          "full_text",
          "show_count",
          "open_color",
          "full_color",
          "logo_url"
        ],
        "properties": {
          "lang": {
            "type": "string",
            "description": "The page's language (a tag such as `en` or `pt-BR`)."
          },
          "open_text": {
            "type": "string",
            "description": "Shown while there is room."
          },
          "full_text": {
            "type": "string",
            "description": "Shown while the area is full."
          },
          "show_count": {
            "type": "boolean",
            "description": "Show the number of free places."
          },
          "open_color": {
            "type": "string",
            "description": "Background while there is room (`#rrggbb`)."
          },
          "full_color": {
            "type": "string",
            "description": "Background while full (`#rrggbb`)."
          },
          "logo_url": {
            "type": "string",
            "description": "An https logo; \"\" = none."
          }
        }
      },
      "AnalyticsDisplaySettingsInput": {
        "type": [
          "object",
          "null"
        ],
        "description": "The display's settings; missing or blank fields take the defaults.",
        "additionalProperties": false,
        "properties": {
          "lang": {
            "type": "string",
            "maxLength": 35,
            "default": "en"
          },
          "open_text": {
            "type": "string",
            "maxLength": 80,
            "default": "Please come in"
          },
          "full_text": {
            "type": "string",
            "maxLength": 80,
            "default": "Please wait"
          },
          "show_count": {
            "type": "boolean",
            "default": true
          },
          "open_color": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "default": "#15803d"
          },
          "full_color": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "default": "#b91c1c"
          },
          "logo_url": {
            "type": "string",
            "maxLength": 2048,
            "description": "An https address."
          }
        }
      },
      "AnalyticsDisplay": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "area_id",
          "name",
          "settings",
          "created_at",
          "last_seen_at",
          "revoked_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "area_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "settings": {
            "$ref": "#/components/schemas/AnalyticsDisplaySettings"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_seen_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the page last asked for the state."
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AnalyticsDisplayPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsDisplay"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AnalyticsDisplayCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "area_id",
          "name"
        ],
        "properties": {
          "area_id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "settings": {
            "$ref": "#/components/schemas/AnalyticsDisplaySettingsInput"
          },
          "base_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "`http(s)://host[:port]` the screen opens this server at; default the server's public address while remote access is on (else required)."
          }
        }
      },
      "AnalyticsDisplayCreated": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "display",
          "token",
          "url",
          "qr_png"
        ],
        "properties": {
          "display": {
            "$ref": "#/components/schemas/AnalyticsDisplay"
          },
          "token": {
            "type": "string",
            "description": "The display's secret token. Shown only here."
          },
          "url": {
            "type": "string",
            "description": "The page to open on the screen (`<base_url>/display/<token>`). Shown only here."
          },
          "qr_png": {
            "type": "string",
            "description": "A QR code of `url` (`data:image/png;base64,…`)."
          }
        }
      },
      "UpgradeCartItem": {
        "type": "object",
        "properties": {
          "service": {
            "type": "string",
            "description": "Canonical service name, e.g. core-ai, hal-video."
          },
          "camera_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "reason": {
            "type": "string",
            "enum": [
              "not_found",
              "disabled",
              "already_on",
              "not_installed",
              "failed"
            ],
            "description": "In `skipped` only — why these cameras were not switched on (1.89.1)."
          },
          "error": {
            "type": "string",
            "description": "In `skipped` with reason `failed`: the error (1.89.1)."
          }
        },
        "required": [
          "service",
          "camera_ids"
        ]
      },
      "UpgradeCartSkip": {
        "type": "object",
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "not_found",
              "disabled",
              "already_on"
            ]
          }
        },
        "required": [
          "camera_id",
          "service",
          "reason"
        ]
      },
      "UpgradeCartAddResponse": {
        "type": "object",
        "properties": {
          "cart": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/UpgradeCart"
              },
              {
                "type": "null"
              }
            ]
          },
          "skipped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpgradeCartSkip"
            }
          }
        },
        "required": [
          "cart",
          "skipped"
        ]
      },
      "UpgradeCart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "open, checkout (its link was issued and the cart was edited after; kept for the return trip), paid, applied, partial, timeout."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpgradeCartItem"
            }
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "checked_out_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the checkout link was issued (1.89.1)."
          },
          "paid_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "applied_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "applied": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpgradeCartItem"
            }
          },
          "skipped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpgradeCartItem"
            }
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "items"
        ]
      },
      "UpgradeCartResponse": {
        "type": "object",
        "properties": {
          "cart": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/UpgradeCart"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "cart"
        ]
      },
      "UpgradeCartItemsRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "service": {
            "type": "string"
          },
          "camera_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        },
        "required": [
          "service",
          "camera_ids"
        ]
      },
      "CheckoutUrlResponse": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "url"
        ]
      },
      "FreeForm": {
        "type": "object",
        "description": "A view whose fields follow the web app (ignore fields you do not know)."
      },
      "Queued": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "queued"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "queued": {
            "type": "boolean"
          }
        }
      },
      "AvailableStream": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "name",
          "stream",
          "stream_url",
          "client",
          "client_ip",
          "audio_device"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "camera",
              "audio"
            ]
          },
          "name": {
            "type": "string"
          },
          "stream": {
            "type": "string"
          },
          "stream_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "client": {
            "type": "string"
          },
          "client_ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "audio_device": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AvailableStreamPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AvailableStream"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CameraCatalogTemplate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "url",
          "main",
          "kind",
          "protocol",
          "verified",
          "notes"
        ],
        "description": "A camera catalogue stream URL template, filled for a camera: its address when known (else the literal `{host}`), never the login. An rtsp/http URL carries none (add `user:password@`, the password URL-encoded); a login in a query string stays `{user}` / `{pass}`.",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "main": {
            "type": "boolean",
            "description": "The main (full-resolution) stream; false for a sub stream."
          },
          "kind": {
            "type": "string",
            "enum": [
              "video",
              "snapshot",
              "mjpeg",
              "audio"
            ]
          },
          "protocol": {
            "type": "string",
            "enum": [
              "rtsp",
              "rtsps",
              "http",
              "https",
              "rtmp"
            ]
          },
          "verified": {
            "type": "boolean",
            "description": "Checked on the manufacturer's own documentation."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CameraCatalogMatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "brand_id",
          "brand",
          "model",
          "name",
          "matched_by",
          "rtsp",
          "verified",
          "source",
          "notes",
          "credential_hint",
          "default_username",
          "type",
          "ptz",
          "likely_brands",
          "templates"
        ],
        "description": "What the camera catalogue recognised a device as (API 1.31.0).",
        "properties": {
          "brand_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "`null` for a module maker's MAC prefix (brand unknown)."
          },
          "brand": {
            "type": [
              "string",
              "null"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "description": "The catalogued model; `null` when only the brand is known."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"<brand> <model>\" (or the brand): a name for the camera."
          },
          "matched_by": {
            "type": "string",
            "enum": [
              "model",
              "model_pattern",
              "brand",
              "oui",
              "oui_shared",
              "module_hint"
            ],
            "description": "`model`: the model string matched a catalogued model or alias; `model_pattern`: the brand's model-name pattern matched an unlisted model; `brand`: the maker's name; `oui`: the MAC prefix is the brand's; `oui_shared`: the MAC prefix is the brand's but shared with its other products (phones, routers): a hint, not proof of a camera; `module_hint`: a camera/Wi-Fi module maker's prefix, brand unknown (`likely_brands`)."
          },
          "rtsp": {
            "type": "string",
            "enum": [
              "yes",
              "no",
              "firmware-dependent",
              "via-hub",
              "model-dependent"
            ],
            "description": "Does it stream locally: `no` = app/cloud only (Vigiora cannot record it); `via-hub` = through its hub or base station; `model-dependent` = the brand has both kinds."
          },
          "verified": {
            "type": "boolean",
            "description": "The model's (else the brand's) facts were checked on `source`."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "The manufacturer page the facts come from."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "credential_hint": {
            "type": [
              "string",
              "null"
            ],
            "description": "The brand's login advice (user-facing English)."
          },
          "default_username": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "bullet, turret, dome, ptz, doorbell, cube, battery, robot, …"
          },
          "ptz": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "likely_brands": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "For `module_hint`, the brands this prefix was seen on."
          },
          "templates": {
            "type": "array",
            "description": "The video stream templates for the model (else the brand's defaults), main streams first; empty when it has no local stream.",
            "items": {
              "$ref": "#/components/schemas/CameraCatalogTemplate"
            }
          }
        }
      },
      "CameraCatalogEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "brand_id",
          "brand",
          "model",
          "name",
          "aliases",
          "family",
          "type",
          "resolution",
          "connectivity",
          "rtsp",
          "onvif_profile",
          "ptz",
          "audio",
          "verified",
          "source",
          "notes",
          "credential_hint",
          "default_username",
          "rtsp_port",
          "templates"
        ],
        "description": "A camera catalogue model, or a brand (`model` null). Templates keep `{host}`.",
        "properties": {
          "brand_id": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `model` to `detectCamera`."
          },
          "name": {
            "type": "string"
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "family": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolution": {
            "type": [
              "string",
              "null"
            ]
          },
          "connectivity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "poe",
              "wifi",
              "both",
              "4g",
              "ethernet",
              null
            ]
          },
          "rtsp": {
            "type": "string",
            "enum": [
              "yes",
              "no",
              "firmware-dependent",
              "via-hub",
              "model-dependent"
            ]
          },
          "onvif_profile": {
            "type": [
              "string",
              "null"
            ]
          },
          "ptz": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "audio": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "mic",
              "two-way",
              "none",
              null
            ]
          },
          "verified": {
            "type": "boolean"
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "credential_hint": {
            "type": [
              "string",
              "null"
            ]
          },
          "default_username": {
            "type": [
              "string",
              "null"
            ]
          },
          "rtsp_port": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The brand's default RTSP port."
          },
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CameraCatalogTemplate"
            }
          }
        }
      },
      "CameraCatalogEntryPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CameraCatalogEntry"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CameraCatalogBrand": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "aliases",
          "website",
          "rtsp",
          "rtsp_port",
          "onvif_port",
          "onvif",
          "default_username",
          "credential_hint",
          "notes",
          "verified",
          "source",
          "models"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "website": {
            "type": [
              "string",
              "null"
            ]
          },
          "rtsp": {
            "type": "string",
            "enum": [
              "yes",
              "no",
              "firmware-dependent",
              "model-dependent"
            ],
            "description": "`yes`: every model streams locally; `no`: none does; `model-dependent`: some do."
          },
          "rtsp_port": {
            "type": [
              "integer",
              "null"
            ]
          },
          "onvif_port": {
            "type": [
              "integer",
              "null"
            ]
          },
          "onvif": {
            "type": "boolean",
            "description": "Its cameras offer ONVIF."
          },
          "default_username": {
            "type": [
              "string",
              "null"
            ]
          },
          "credential_hint": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "verified": {
            "type": "boolean"
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "models": {
            "type": "integer",
            "description": "Catalogued models."
          }
        }
      },
      "CameraCatalogBrandPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CameraCatalogBrand"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "HardwareID": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mac",
          "vendor",
          "last_ip",
          "last_seen_at",
          "sources",
          "last_event"
        ],
        "properties": {
          "mac": {
            "type": [
              "string",
              "null"
            ]
          },
          "vendor": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_seen_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "source",
                "mac",
                "vendor",
                "last_ip",
                "learned_at",
                "last_seen_at"
              ],
              "properties": {
                "source": {
                  "type": "string",
                  "description": "`main`, `sub` or `onvif`."
                },
                "mac": {
                  "type": "string"
                },
                "vendor": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "last_ip": {
                  "type": "string"
                },
                "learned_at": {
                  "type": "string"
                },
                "last_seen_at": {
                  "type": "string"
                }
              }
            }
          },
          "last_event": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": false,
            "required": [
              "kind",
              "old_ip",
              "new_ip",
              "detail",
              "created_at"
            ],
            "properties": {
              "kind": {
                "type": "string"
              },
              "old_ip": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "new_ip": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "detail": {
                "type": "string"
              },
              "created_at": {
                "type": "string"
              }
            }
          }
        }
      },
      "AIService": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "service_name",
          "label",
          "description",
          "kind",
          "enabled",
          "plan_limited",
          "requires_any",
          "dependency_met",
          "missing_dependencies",
          "soft_requires",
          "soft_dependencies_missing",
          "config",
          "config_fields",
          "warnings"
        ],
        "properties": {
          "service_name": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "`virtual` (runs in this server) or `real` (an enrolled service)."
          },
          "enabled": {
            "type": "boolean"
          },
          "plan_limited": {
            "type": "boolean",
            "description": "The plan caps how many cameras may use it."
          },
          "requires_any": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dependency_met": {
            "type": "boolean"
          },
          "missing_dependencies": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "soft_requires": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "soft_dependencies_missing": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "config": {
            "type": "object",
            "description": "The settings in effect (values as stored, strings)."
          },
          "config_fields": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "key",
                "type",
                "label",
                "help",
                "min",
                "max",
                "default"
              ],
              "properties": {
                "key": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "description": "`slider` (number), `bool`, `text`, `textarea`."
                },
                "label": {
                  "type": "string"
                },
                "help": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "min": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "max": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "default": {
                  "description": "Default value."
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "description": "`no_motion_trigger` (on `core-ai`): Guardian needs motion detection on this camera. Open set.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AIServicePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AIService"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AIServiceUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "config"
        ],
        "properties": {
          "config": {
            "type": "object",
            "description": "Setting key → value (`null` = default). Keys from `config_fields`."
          }
        }
      },
      "PTZPresetCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "token": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Overwrite this preset."
          },
          "dwell_seconds": {
            "type": "integer",
            "minimum": 3,
            "maximum": 3600,
            "description": "API 1.56.0. Seconds a patrol stays here."
          }
        }
      },
      "PTZProbeResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "method",
          "pan_tilt",
          "zoom",
          "max_presets"
        ],
        "properties": {
          "method": {
            "type": [
              "string",
              "null"
            ],
            "description": "`onvif`, `isapi`; `null` = no PTZ found."
          },
          "pan_tilt": {
            "type": "boolean"
          },
          "zoom": {
            "type": "string",
            "enum": [
              "optical",
              "digital"
            ]
          },
          "max_presets": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "ReferenceFrame": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "size_bytes"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "size_bytes": {
            "type": "integer"
          }
        }
      },
      "ReferenceComparison": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "description",
          "descriptions",
          "changes_detected"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "description": {
            "type": "string",
            "description": "In the requested language (`Accept-Language`), else English."
          },
          "descriptions": {
            "type": [
              "object",
              "null"
            ]
          },
          "changes_detected": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "QRBox": {
        "type": "object",
        "additionalProperties": false,
        "description": "A rectangle normalised to the picture (0-1, top-left origin).",
        "required": [
          "x",
          "y",
          "w",
          "h"
        ],
        "properties": {
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "w": {
            "type": "number"
          },
          "h": {
            "type": "number"
          }
        }
      },
      "QRCorners": {
        "type": "array",
        "description": "The code's corners normalised to the picture, bottom-left, top-left, top-right, bottom-right: the finder pattern centres and the fourth corner of their parallelogram (3.5 modules inside the outer edge). Empty when unknown.",
        "items": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": {
            "type": "number"
          }
        }
      },
      "QRCodeRead": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "camera_name",
          "payload",
          "seen_at",
          "bbox",
          "corners",
          "frame_width",
          "frame_height",
          "alert_id",
          "internal"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "camera_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "payload": {
            "type": "string",
            "description": "The text in the code (at most 4096 bytes)."
          },
          "seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "bbox": {
            "$ref": "#/components/schemas/QRBox"
          },
          "corners": {
            "$ref": "#/components/schemas/QRCorners"
          },
          "frame_width": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The picture width in px (the code is bbox.w times this)."
          },
          "frame_height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "alert_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The alert the read became (null for internal beacons)."
          },
          "internal": {
            "type": "boolean",
            "description": "An internal floor-plan walkthrough beacon (vigiora-wt:)."
          }
        }
      },
      "QRCodeReadPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QRCodeRead"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "QRScanResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "codes"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "codes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "payload",
                "bbox",
                "corners",
                "frame_width",
                "frame_height",
                "recorded",
                "read_id",
                "alert_id"
              ],
              "properties": {
                "payload": {
                  "type": "string"
                },
                "bbox": {
                  "$ref": "#/components/schemas/QRBox"
                },
                "corners": {
                  "$ref": "#/components/schemas/QRCorners"
                },
                "frame_width": {
                  "type": "integer"
                },
                "frame_height": {
                  "type": "integer"
                },
                "recorded": {
                  "type": "boolean",
                  "description": "False when the same code was recorded on this camera in the last minute."
                },
                "read_id": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "alert_id": {
                  "type": [
                    "integer",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "PlateReading": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "plates"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "plates": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "plate",
                "confidence",
                "country"
              ],
              "properties": {
                "plate": {
                  "type": "string"
                },
                "confidence": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "country": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "WeatherReadingV1": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "sky",
          "precip",
          "fog",
          "is_night",
          "ground_wet",
          "confidence"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "sky": {
            "type": "string",
            "enum": [
              "clear",
              "partly_cloudy",
              "overcast",
              "unknown"
            ]
          },
          "precip": {
            "type": "string",
            "enum": [
              "none",
              "rain",
              "snow",
              "unknown"
            ]
          },
          "fog": {
            "type": "boolean"
          },
          "is_night": {
            "type": "boolean"
          },
          "ground_wet": {
            "type": "boolean"
          },
          "confidence": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      },
      "WeatherSummaryV1": {
        "type": "object",
        "additionalProperties": false,
        "description": "Current weather for the whole server: the freshest camera-vision reading (conditions actually seen) blended with an open-meteo temperature and an auto-resolved location. source=none means nothing is available.",
        "required": [
          "condition",
          "precip",
          "fog",
          "ground_wet",
          "is_night",
          "source"
        ],
        "properties": {
          "temp_c": {
            "type": [
              "integer",
              "null"
            ]
          },
          "condition": {
            "type": "string",
            "enum": [
              "clear",
              "partly_cloudy",
              "overcast",
              "unknown"
            ]
          },
          "precip": {
            "type": "string",
            "enum": [
              "none",
              "rain",
              "snow",
              "unknown"
            ]
          },
          "fog": {
            "type": "boolean"
          },
          "ground_wet": {
            "type": "boolean"
          },
          "is_night": {
            "type": "boolean"
          },
          "location": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "vision",
              "api",
              "mixed",
              "none"
            ]
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "as_of": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SiteCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1024
          },
          "parent_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The branch a zone belongs to."
          }
        }
      },
      "SiteUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1024
          },
          "parent_id": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "GroupWrite": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Required on create."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1024
          },
          "user_ids": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "type": "integer"
            }
          },
          "camera_grants": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "camera_id",
                "permission"
              ],
              "properties": {
                "camera_id": {
                  "type": "integer"
                },
                "permission": {
                  "type": "string",
                  "enum": [
                    "viewer",
                    "operator",
                    "manager"
                  ]
                }
              }
            }
          },
          "site_grants": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "site_id",
                "permission"
              ],
              "properties": {
                "site_id": {
                  "type": "integer"
                },
                "permission": {
                  "type": "string",
                  "enum": [
                    "viewer",
                    "operator",
                    "manager"
                  ]
                },
                "include_zones": {
                  "type": "boolean",
                  "default": true
                }
              }
            }
          }
        }
      },
      "LayoutWrite": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Required on create."
          },
          "cells": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "$ref": "#/components/schemas/LayoutCell"
            }
          }
        }
      },
      "LayoutSequence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "layout_ids",
          "interval_seconds"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "layout_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "interval_seconds": {
            "type": "integer"
          }
        }
      },
      "LayoutSequencePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LayoutSequence"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "LayoutSequenceCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "layout_ids"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "layout_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "type": "integer"
            }
          },
          "interval_seconds": {
            "type": "integer",
            "minimum": 2,
            "maximum": 3600,
            "default": 10
          }
        }
      },
      "FaceRename": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        }
      },
      "RoomWrite": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Required on create."
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "instruction": {
            "type": "string",
            "maxLength": 4096,
            "description": "What AI Live watches for."
          },
          "environment": {
            "type": "string",
            "enum": [
              "retail",
              "security",
              "reception",
              "home",
              "custom"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "video",
              "audio",
              "both"
            ]
          },
          "interval_seconds": {
            "type": "integer",
            "minimum": 2,
            "maximum": 300
          },
          "wake_word": {
            "type": "string",
            "maxLength": 64
          },
          "timezone": {
            "type": "string",
            "description": "IANA zone name."
          },
          "stt_provider": {
            "type": "string",
            "enum": [
              "auto",
              "whisper",
              "deepgram",
              "gemini"
            ]
          },
          "speech_microphone": {
            "type": "string",
            "pattern": "^(auto|all|[1-9][0-9]{0,9})$",
            "description": "API 1.115.0. See `Room.speech_microphone`: `auto`, `all` or a camera id of the room as text."
          },
          "ai_actuation_enabled": {
            "type": "boolean"
          },
          "ai_ptz_enabled": {
            "type": "boolean"
          },
          "ai_speak_enabled": {
            "type": "boolean"
          },
          "ai_rules": {
            "type": "string",
            "maxLength": 8192
          },
          "ai_mode": {
            "type": "string",
            "enum": [
              "live",
              "guardian",
              "both"
            ],
            "description": "See `Room.ai_mode` (default `live`). Switching to `guardian` stops the room's AI Live session."
          },
          "ai_live_classic": {
            "type": "boolean",
            "description": "See `Room.ai_live_classic`."
          },
          "ai_live_coalesce_seconds": {
            "type": "integer",
            "minimum": 3,
            "maximum": 600
          },
          "ai_live_keepalive_seconds": {
            "type": "integer",
            "minimum": 30,
            "maximum": 3600
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "virtual"
            ],
            "description": "API 1.38.0. `manual` (default) or `virtual` (a collection of cameras and devices from different rooms). A `plan` room's source cannot be changed: remove its polygon from the floor plan instead."
          },
          "device_entity_ids": {
            "type": "array",
            "maxItems": 30,
            "description": "API 1.38.0. Replaces the room's Home Assistant devices: device keys of entities exposed to Vigiora (`GET /integrations/home-assistant/devices`), each once. `400 validation_error` for a key that is not an exposed device, or when the server has no Home Assistant devices.",
            "items": {
              "type": "string"
            }
          },
          "cameras": {
            "type": "array",
            "maxItems": 32,
            "description": "Replaces the cameras a user put in the room; the cameras the floor plan manages (`managed`) stay. A managed camera named here takes the role sent.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "camera_id"
              ],
              "properties": {
                "camera_id": {
                  "type": "integer"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "video",
                    "audio",
                    "both"
                  ],
                  "default": "both"
                },
                "is_primary": {
                  "type": "boolean",
                  "default": false
                }
              }
            }
          }
        }
      },
      "STTProvider": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "available",
          "note"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "available": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "STTProviderPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/STTProvider"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "InventoryItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 256
          },
          "price": {
            "type": "string",
            "maxLength": 64
          },
          "location": {
            "type": "string",
            "maxLength": 256
          },
          "notes": {
            "type": "string",
            "maxLength": 1024
          }
        }
      },
      "RoomInventory": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "room_id",
          "count",
          "items"
        ],
        "properties": {
          "room_id": {
            "type": "integer"
          },
          "count": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InventoryItem"
            }
          }
        }
      },
      "InventoryReplace": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 5000,
            "items": {
              "$ref": "#/components/schemas/InventoryItem"
            }
          }
        }
      },
      "CameraSpeaker": {
        "type": "object",
        "additionalProperties": false,
        "description": "API 1.54.0. The camera's speaker as the background speaker check found it (every local camera: when added, when it comes back online, and daily; `checkCameraSpeaker` checks now). `voice`: a speaker Vigiora can send voice to (the camera's audio backchannel; push-to-talk, text to speech and alert announcements); `siren`: a speaker in hardware that Vigiora can only sound the camera's own siren / audio alarm on (through the camera's API: Reolink, Hikvision); `none`; `unknown`: not checked yet, or the camera is streamed by a vigiora-client.",
        "required": [
          "kind",
          "siren",
          "checked_at"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "voice",
              "siren",
              "none",
              "unknown"
            ]
          },
          "siren": {
            "type": "boolean",
            "description": "The camera's own siren can be sounded through its API."
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "RuleSpeaker": {
        "type": "object",
        "additionalProperties": false,
        "description": "API 1.54.0. Play this rule's alerts on camera speakers. `mode`: `default` follows the server setting (`getAlertSpeakerSettings`: alerts at or above `min_severity` play its sound on the alert's camera), `off` never, or a sound (`announcement` = text to speech of `message`, `chime`, `siren`). `cameras`: the alert's camera, every camera of its room (a room rule: the room's cameras), or `camera_ids`. Only cameras with a speaker play. Quiet hours, the arm mode, the cooldown and an operator's live talk apply to every alert.",
        "required": [
          "mode",
          "cameras",
          "camera_ids",
          "volume",
          "message"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "default",
              "off",
              "announcement",
              "chime",
              "siren"
            ]
          },
          "cameras": {
            "type": "string",
            "enum": [
              "alert_camera",
              "room",
              "chosen"
            ]
          },
          "camera_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "maxItems": 16
          },
          "volume": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 2,
            "description": "`null` = the server setting."
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "The announcement, with `{label}`, `{camera}` and `{room}`; `null` = the server setting."
          }
        }
      },
      "RuleSpeakerUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "API 1.54.0. Only the fields sent change (see RuleSpeaker). `chosen` needs `camera_ids` (operator permission on each).",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "default",
              "off",
              "announcement",
              "chime",
              "siren"
            ]
          },
          "cameras": {
            "type": "string",
            "enum": [
              "alert_camera",
              "room",
              "chosen"
            ]
          },
          "camera_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "maxItems": 16
          },
          "volume": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 2
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          }
        }
      },
      "AlertSpeakerSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "result",
          "sound",
          "camera_ids",
          "at"
        ],
        "properties": {
          "result": {
            "type": "string",
            "enum": [
              "played",
              "skipped",
              "failed"
            ]
          },
          "sound": {
            "type": "string",
            "enum": [
              "announcement",
              "chime",
              "siren"
            ]
          },
          "camera_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AlertSpeakerQuietHours": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "start",
          "end"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "start": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
            "description": "Box time, HH:MM."
          },
          "end": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
            "description": "Box time, HH:MM (before `start` = overnight)."
          }
        }
      },
      "AlertSpeakerPanel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entity_id",
          "name",
          "state"
        ],
        "properties": {
          "entity_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "description": "`armed_away`, `armed_home`, `disarmed`, `triggered`, … (Home Assistant)."
          }
        }
      },
      "AlertSpeakerSettings": {
        "type": "object",
        "additionalProperties": false,
        "description": "API 1.54.0. Alerts on camera speakers. `enabled` with `min_severity` (default `high`, the emergency and important level): alerts of rules left on `default` play `sound` on the alert's camera. A camera Vigiora cannot send audio to sounds its own siren only when the sound is `siren` or `use_camera_siren` is on. `max_seconds` caps each play (3–15), `repeats` 1–3, `cooldown_seconds` is the rest between alert plays on a camera. No automatic play in `quiet_hours`; `arm_mode` `armed` / `away` plays only while the Home Assistant alarm panel (`arm_entity`, else any shared panel) is armed / armed away; an unknown state does not play. An operator's live talk always wins. Every play, skip and failure is recorded (`listAlertSpeakerPlays`) and audit-logged.",
        "required": [
          "enabled",
          "min_severity",
          "sound",
          "use_camera_siren",
          "language",
          "message",
          "volume",
          "max_seconds",
          "repeats",
          "cooldown_seconds",
          "quiet_hours",
          "arm_mode",
          "arm_entity",
          "arm_state",
          "arm_panels",
          "tts_available",
          "default_messages"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "min_severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "sound": {
            "type": "string",
            "enum": [
              "announcement",
              "chime",
              "siren"
            ]
          },
          "use_camera_siren": {
            "type": "boolean"
          },
          "language": {
            "type": "string",
            "description": "Language of the announcement (en, es, th, lo, …)."
          },
          "message": {
            "type": "string",
            "maxLength": 200,
            "description": "`\"\"` = the built-in text of `language` (`default_messages`)."
          },
          "volume": {
            "type": "number",
            "minimum": 0,
            "maximum": 2
          },
          "max_seconds": {
            "type": "integer",
            "minimum": 3,
            "maximum": 15
          },
          "repeats": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3
          },
          "cooldown_seconds": {
            "type": "integer",
            "minimum": 30,
            "maximum": 3600
          },
          "quiet_hours": {
            "$ref": "#/components/schemas/AlertSpeakerQuietHours"
          },
          "arm_mode": {
            "type": "string",
            "enum": [
              "any",
              "armed",
              "away"
            ]
          },
          "arm_entity": {
            "type": [
              "string",
              "null"
            ]
          },
          "arm_state": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "state",
              "entity"
            ],
            "properties": {
              "state": {
                "type": "string"
              },
              "entity": {
                "type": "string"
              }
            }
          },
          "arm_panels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertSpeakerPanel"
            }
          },
          "tts_available": {
            "type": "boolean",
            "description": "Announcements need the Vigiora AI gateway; without it the chime plays."
          },
          "default_messages": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "AlertSpeakerSettingsUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "API 1.54.0. Only the fields sent change.",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "min_severity": {
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "sound": {
            "type": "string",
            "enum": [
              "announcement",
              "chime",
              "siren"
            ]
          },
          "use_camera_siren": {
            "type": "boolean"
          },
          "language": {
            "type": "string",
            "maxLength": 12
          },
          "message": {
            "type": "string",
            "maxLength": 200
          },
          "volume": {
            "type": "number",
            "minimum": 0,
            "maximum": 2
          },
          "max_seconds": {
            "type": "integer",
            "minimum": 3,
            "maximum": 15
          },
          "repeats": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3
          },
          "cooldown_seconds": {
            "type": "integer",
            "minimum": 30,
            "maximum": 3600
          },
          "quiet_hours": {
            "$ref": "#/components/schemas/AlertSpeakerQuietHours"
          },
          "arm_mode": {
            "type": "string",
            "enum": [
              "any",
              "armed",
              "away"
            ]
          },
          "arm_entity": {
            "type": [
              "string",
              "null"
            ],
            "description": "An `alarm_control_panel.` entity id; `null` = any shared panel."
          }
        }
      },
      "SpeakerCamera": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "camera_name",
          "kind",
          "voice",
          "siren",
          "siren_via",
          "room_name",
          "checked_at"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "camera_name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "voice",
              "siren"
            ]
          },
          "voice": {
            "type": "boolean"
          },
          "siren": {
            "type": "boolean"
          },
          "siren_via": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "reolink",
              "isapi",
              null
            ]
          },
          "room_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "SpeakerCameraList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SpeakerCamera"
            }
          }
        }
      },
      "AlertSpeakerTest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "sound"
        ],
        "properties": {
          "camera_id": {
            "type": "integer",
            "minimum": 1
          },
          "sound": {
            "type": "string",
            "enum": [
              "announcement",
              "chime",
              "siren"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "volume": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 2
          }
        }
      },
      "AlertSpeakerPlayResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "sound",
          "via",
          "result",
          "reason",
          "duration_ms"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "sound": {
            "type": "string",
            "enum": [
              "announcement",
              "chime",
              "siren"
            ]
          },
          "via": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "backchannel",
              "reolink",
              "isapi",
              null
            ]
          },
          "result": {
            "type": "string",
            "enum": [
              "played",
              "skipped",
              "failed"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it was skipped or failed, or a note on a play: `quiet_hours`, `not_armed`, `arm_state_unknown`, `cooldown`, `busy`, `operator_talking`, `no_speaker`, `no_voice_speaker` (only the camera's siren, not asked for), `interrupted_by_talk`, `unavailable`, `camera_failed`, `tts_unavailable` (the chime played instead), `hushed` (Stop all sounds was used in the last 10 minutes), `siren_limit` (the camera's siren already sounded 60 s in the last 10 minutes), `camera_no_answer` (the camera did not answer the siren's \"on\"; it may be sounding, so Vigiora sends the off anyway: see stop_state), `stopped` (Stop all sounds cut the play short), `siren_not_off` (the camera's last siren was not confirmed off yet: no new siren until it is stopped or dismissed). Open set."
          },
          "duration_ms": {
            "type": "integer"
          },
          "run_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "API 1.105.0. A camera siren's stored run (see GET /sounds/active); null for other sounds."
          },
          "stop_state": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "sounding",
              "self_ending",
              "stopping",
              "stopped",
              "stop_failed",
              "dismissed",
              null
            ],
            "description": "API 1.105.0. The truth about a camera siren, live: `self_ending` (the camera plays a few cycles and stops by itself), `sounding` (on, its off is due at its time), `stopping` (an off was sent and not confirmed yet; the siren may still be sounding and Vigiora keeps retrying), `stopped` (the camera confirmed the off), `stop_failed` (no confirmed off within 24 hours), `dismissed` (a person said it is quiet). Null for other sounds or a siren that never started."
          },
          "stop_attempts": {
            "type": "integer",
            "minimum": 0,
            "description": "API 1.105.0. Offs sent so far for the siren run."
          }
        }
      },
      "AlertSpeakerPlay": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "at",
          "alert_id",
          "camera_id",
          "camera_name",
          "rule_type",
          "rule_id",
          "sound",
          "via",
          "result",
          "reason",
          "duration_ms",
          "test"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "alert_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "camera_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "rule_type": {
            "type": "string",
            "enum": [
              "label",
              "guardian",
              "default",
              "test",
              "manual"
            ],
            "description": "`manual`: a person or an agent started the siren (API 1.105.0)."
          },
          "rule_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "sound": {
            "type": "string",
            "enum": [
              "announcement",
              "chime",
              "siren"
            ]
          },
          "via": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "backchannel",
              "reolink",
              "isapi",
              null
            ]
          },
          "result": {
            "type": "string",
            "enum": [
              "played",
              "skipped",
              "failed"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "See AlertSpeakerPlayResult."
          },
          "duration_ms": {
            "type": "integer"
          },
          "test": {
            "type": "boolean"
          },
          "run_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "API 1.105.0. A camera siren's stored run (see GET /sounds/active); null for other sounds."
          },
          "stop_state": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "sounding",
              "self_ending",
              "stopping",
              "stopped",
              "stop_failed",
              "dismissed",
              null
            ],
            "description": "API 1.105.0. The truth about a camera siren, live: `self_ending` (the camera plays a few cycles and stops by itself), `sounding` (on, its off is due at its time), `stopping` (an off was sent and not confirmed yet; the siren may still be sounding and Vigiora keeps retrying), `stopped` (the camera confirmed the off), `stop_failed` (no confirmed off within 24 hours), `dismissed` (a person said it is quiet). Null for other sounds or a siren that never started."
          },
          "stop_attempts": {
            "type": "integer",
            "minimum": 0,
            "description": "API 1.105.0. Offs sent so far for the siren run."
          }
        }
      },
      "AlertSpeakerPlayPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertSpeakerPlay"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "SoundRun": {
        "type": "object",
        "additionalProperties": false,
        "description": "A siren run Vigiora stored before sounding it (API 1.105.0). `way`: reolink, isapi (camera sirens), ha (a Home Assistant siren). `mode`: times (the device stops by itself), manual (on until Vigiora's off), duration (Home Assistant siren with a duration, and a stored off). `source`: who started it (label, guardian, default, test, manual for alert-speaker plays; rule, api, chat, things, … for Home Assistant). See GET /sounds/active for `state`.",
        "required": [
          "id",
          "camera_id",
          "entity_id",
          "name",
          "way",
          "mode",
          "source",
          "state",
          "started_at",
          "stop_by",
          "attempts",
          "last_error",
          "stopped_at",
          "length_set_by_device"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "entity_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Home Assistant entity (way ha)."
          },
          "name": {
            "type": "string"
          },
          "way": {
            "type": "string",
            "enum": [
              "reolink",
              "isapi",
              "ha"
            ]
          },
          "mode": {
            "type": "string",
            "description": "times | manual | duration (\"\" while starting). Open set."
          },
          "source": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "starting",
              "sounding",
              "self_ending",
              "stopping",
              "stopped",
              "ended",
              "not_started",
              "stop_failed",
              "dismissed"
            ]
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "stop_by": {
            "type": "string",
            "format": "date-time",
            "description": "When its off is due (or it ends by itself)."
          },
          "attempts": {
            "type": "integer",
            "minimum": 0,
            "description": "Offs sent so far."
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "stopped_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "length_set_by_device": {
            "type": "boolean",
            "description": "A self-ending play of one cycle; the device decides how long it plays (`stop_by` is an estimate)."
          }
        }
      },
      "ActiveSounds": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "hushed_until"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SoundRun"
            }
          },
          "hushed_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "StopAllSoundsResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "stopped",
          "stopping",
          "ending",
          "hushed_until"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SoundRun"
            },
            "description": "The sounds that were open."
          },
          "stopped": {
            "type": "integer",
            "minimum": 0,
            "description": "Confirmed off."
          },
          "stopping": {
            "type": "integer",
            "minimum": 0,
            "description": "Not confirmed yet; still retried (may be sounding)."
          },
          "ending": {
            "type": "integer",
            "minimum": 0,
            "description": "Short self-ending plays whose camera did not take the off (or has none, like Hikvision): they end by themselves within seconds; not retried."
          },
          "hushed_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Automatic sounds stay off until then (only when an admin or operator stopped all; else null)."
          }
        }
      },
      "CameraSirenStart": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 600,
            "description": "Wanted length (default 10). Vigiora plays at most 15 s, and at most 60 s per camera in 10 minutes."
          }
        }
      },
      "CameraSirenStopResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "confirmed",
          "data"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "confirmed": {
            "type": "boolean",
            "description": "The camera confirmed the off (or nothing needed one)."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SoundRun"
            },
            "description": "The camera's runs that were open."
          }
        }
      },
      "OutputDevice": {
        "type": "object",
        "additionalProperties": false,
        "description": "API 1.54.0. One physical device Vigiora can act with (\"Tools\" in the web app): a speaker (`source` camera, usb, cast: an output, `output_id`), a camera's own siren (`id` `camera-siren:<camera_id>`), or a Home Assistant / Zigbee device shared with Vigiora for control (`device_key`, `entity_id`; control it with `setIoTDeviceEntity`). `capabilities` names what it can do (open set).",
        "required": [
          "id",
          "type",
          "source",
          "name",
          "camera_id",
          "camera_name",
          "client_id",
          "room_ids",
          "room_names",
          "capabilities",
          "state",
          "enabled",
          "auto",
          "note",
          "output_id",
          "device_key",
          "entity_id"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "`speaker`, `siren`, `light`, `switch`, `lock`, `cover`, `fan`, `climate`, `button`, `other` (open set)."
          },
          "source": {
            "type": "string",
            "description": "`camera`, `usb`, `cast`, `home_assistant` (open set)."
          },
          "name": {
            "type": "string"
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "camera_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "client_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "room_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "room_names": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`speak`, `play_audio`, `chime`, `siren`, `on_off`, `brightness`, `colour`, `open_close`, `lock`, `press`, `set` (open set)."
          },
          "state": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "online",
              "summary"
            ],
            "properties": {
              "online": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "summary": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "auto": {
            "type": "boolean",
            "description": "Added by Vigiora itself (a camera's speaker or siren)."
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "output_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "device_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "entity_id": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "OutputDeviceList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutputDevice"
            }
          }
        }
      },
      "Output": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "kind",
          "client_id",
          "camera_id",
          "device",
          "volume",
          "enabled",
          "is_default",
          "auto"
        ],
        "properties": {
          "auto": {
            "type": "boolean",
            "description": "API 1.54.0. A camera speaker Vigiora added by itself for a camera with a speaker (the background speaker check); deleting it is remembered, it is not added again."
          },
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "`camera_backchannel`, `usb` or `cast` (open set)."
          },
          "client_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "device": {
            "type": [
              "string",
              "null"
            ]
          },
          "volume": {
            "type": "number"
          },
          "enabled": {
            "type": "boolean"
          },
          "is_default": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "In a room list: the room's default speaker."
          }
        }
      },
      "OutputPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Output"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "OutputCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "kind"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "kind": {
            "type": "string",
            "enum": [
              "camera_backchannel",
              "usb",
              "cast"
            ]
          },
          "client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Required for `usb` and `cast`. Optional for `camera_backchannel`: `null`, `\"\"` or absent means this server delivers through its own go2rtc (a camera with no vigiora-client)."
          },
          "camera_id": {
            "type": "integer"
          },
          "device": {
            "type": "string",
            "maxLength": 256
          },
          "volume": {
            "type": "number",
            "minimum": 0,
            "maximum": 2,
            "default": 1
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "OutputUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Camera speakers only (API 1.12): the vigiora-client that plays it, or `null` (or `\"\"`) for this server."
          },
          "device": {
            "type": "string",
            "maxLength": 256
          },
          "volume": {
            "type": "number",
            "minimum": 0,
            "maximum": 2
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "RoomOutputsUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output_ids"
        ],
        "properties": {
          "output_ids": {
            "type": "array",
            "maxItems": 32,
            "items": {
              "type": "integer"
            }
          },
          "default_output_id": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "RoomActuation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "kind",
          "source",
          "args",
          "ok",
          "error",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "kind": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "args": {
            "type": "object"
          },
          "ok": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RoomActuationPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoomActuation"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RoomSpeak": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "output_id": {
            "type": "integer"
          },
          "all": {
            "type": "boolean",
            "default": false
          },
          "volume": {
            "type": "number",
            "minimum": 0,
            "maximum": 2
          }
        }
      },
      "RoomPlayAudio": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "audio_base64",
          "mime_type"
        ],
        "properties": {
          "audio_base64": {
            "type": "string"
          },
          "mime_type": {
            "type": "string",
            "enum": [
              "audio/mpeg",
              "audio/wav",
              "audio/ogg",
              "audio/webm",
              "audio/mp4",
              "audio/aac"
            ]
          },
          "output_id": {
            "type": "integer"
          },
          "all": {
            "type": "boolean",
            "default": false
          },
          "volume": {
            "type": "number",
            "minimum": 0,
            "maximum": 2
          }
        }
      },
      "RoomPTZMove": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "pan": {
            "type": "number",
            "minimum": -1,
            "maximum": 1,
            "default": 0
          },
          "tilt": {
            "type": "number",
            "minimum": -1,
            "maximum": 1,
            "default": 0
          },
          "zoom": {
            "type": "number",
            "minimum": -1,
            "maximum": 1,
            "default": 0
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5000,
            "default": 400
          }
        }
      },
      "ActuationResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ok",
          "details"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "details": {
            "type": "object",
            "description": "What the service reported (open set)."
          }
        }
      },
      "AILiveSession": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "room_id",
          "session_id"
        ],
        "properties": {
          "room_id": {
            "type": "integer"
          },
          "session_id": {
            "type": "integer"
          }
        }
      },
      "RoomAILiveStart": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "instruction": {
            "type": "string",
            "maxLength": 4096
          },
          "mode": {
            "type": "string",
            "enum": [
              "video",
              "audio",
              "both"
            ]
          },
          "interval_seconds": {
            "type": "integer",
            "minimum": 2,
            "maximum": 300
          }
        }
      },
      "Stopped": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "room_id",
          "stopped"
        ],
        "properties": {
          "room_id": {
            "type": "integer"
          },
          "stopped": {
            "type": "boolean"
          }
        }
      },
      "AILiveMessages": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "messages"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "The session state (open set)."
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "text",
                "audio_excerpt",
                "suggestions",
                "tool_context",
                "created_at"
              ],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "text": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "audio_excerpt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "suggestions": {
                  "description": "The card's suggestions (open shape)."
                },
                "tool_context": {
                  "description": "Context the AI used (open shape)."
                },
                "created_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "AILiveFeedback": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "suggestion_text",
          "action"
        ],
        "properties": {
          "message_id": {
            "type": "integer"
          },
          "suggestion_type": {
            "type": "string",
            "maxLength": 64
          },
          "suggestion_text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          },
          "action": {
            "type": "string",
            "enum": [
              "used",
              "dismissed"
            ]
          }
        }
      },
      "FeedbackRecorded": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "room_id",
          "recorded"
        ],
        "properties": {
          "room_id": {
            "type": "integer"
          },
          "recorded": {
            "type": "boolean"
          }
        }
      },
      "AILiveDigest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "room_id",
          "date",
          "digest"
        ],
        "properties": {
          "room_id": {
            "type": "integer"
          },
          "date": {
            "type": "string"
          },
          "digest": {
            "type": "string"
          }
        }
      },
      "OutputTest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 500
          }
        }
      },
      "OutputTested": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output_id",
          "played"
        ],
        "properties": {
          "output_id": {
            "type": "integer"
          },
          "played": {
            "type": "boolean"
          }
        }
      },
      "ClientAudioOutputs": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "client_id",
          "audio_outputs",
          "cast_devices"
        ],
        "properties": {
          "client_id": {
            "type": "string"
          },
          "audio_outputs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cast_devices": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "BriefingReviewed": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "item_id",
          "reviewed"
        ],
        "properties": {
          "item_id": {
            "type": "string"
          },
          "reviewed": {
            "type": "boolean"
          }
        }
      },
      "Conversation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "scope",
          "title",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "type": "string",
            "enum": [
              "camera",
              "all"
            ]
          },
          "title": {
            "type": "string"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ConversationPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Conversation"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ConversationCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "camera_id": {
            "type": "integer"
          }
        }
      },
      "ConversationUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        }
      },
      "ConversationMessage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "role",
          "text",
          "tool_calls",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "role": {
            "type": "string",
            "description": "`user`, `assistant` (open set)."
          },
          "text": {
            "type": [
              "string",
              "null"
            ]
          },
          "tool_calls": {
            "description": "What the assistant looked up (open shape)."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ConversationMessagePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversationMessage"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Transcript": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "text",
          "language",
          "started_at",
          "ended_at",
          "duration_seconds",
          "has_audio"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "text": {
            "type": "string"
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "duration_seconds": {
            "type": [
              "number",
              "null"
            ]
          },
          "has_audio": {
            "type": "boolean"
          }
        }
      },
      "TranscriptPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Transcript"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CameraAILiveSession": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "user_id",
          "instruction",
          "mode",
          "active",
          "interval_seconds",
          "created_at",
          "ended_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "user_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "instruction": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "interval_seconds": {
            "type": "integer"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CameraAILiveSessionPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CameraAILiveSession"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CameraAILiveStart": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "instruction": {
            "type": "string",
            "maxLength": 4096
          },
          "mode": {
            "type": "string",
            "enum": [
              "video",
              "audio",
              "both"
            ]
          },
          "interval_seconds": {
            "type": "integer",
            "minimum": 3,
            "maximum": 300
          }
        }
      },
      "AILiveStopped": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ai_live_session_id",
          "stopped"
        ],
        "properties": {
          "ai_live_session_id": {
            "type": "integer"
          },
          "stopped": {
            "type": "boolean"
          }
        }
      },
      "AILiveModeSet": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "video",
              "audio",
              "both"
            ]
          }
        }
      },
      "AILiveModeResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ai_live_session_id",
          "mode",
          "applied_live"
        ],
        "properties": {
          "ai_live_session_id": {
            "type": "integer"
          },
          "mode": {
            "type": "string"
          },
          "applied_live": {
            "type": "boolean",
            "description": "The running loop picked it up at once."
          }
        }
      },
      "AILiveMessage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "text",
          "audio_excerpt",
          "suggestions",
          "tool_context",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "text": {
            "type": [
              "string",
              "null"
            ]
          },
          "audio_excerpt": {
            "type": [
              "string",
              "null"
            ]
          },
          "suggestions": {
            "description": "Open shape."
          },
          "tool_context": {
            "description": "Open shape."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AILiveMessagePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AILiveMessage"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AlertRecording": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "alert_id",
          "event_at",
          "recording_id",
          "seek_seconds",
          "segment_start",
          "segment_end",
          "in_gap",
          "pending",
          "guardian_entry_id",
          "guardian_clip_start"
        ],
        "properties": {
          "alert_id": {
            "type": "integer"
          },
          "event_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The alert's moment."
          },
          "recording_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The segment containing the alert's moment (or the next one when it falls in a gap of under 2 minutes)."
          },
          "seek_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Offset of the moment into the segment (0 in a gap)."
          },
          "segment_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "segment_end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "in_gap": {
            "type": "boolean"
          },
          "pending": {
            "type": "boolean",
            "description": "The moment is in the segment being recorded now; it can be played in a few minutes (API 1.49.0, with event_at, segment_start, segment_end, in_gap and guardian_clip_start)."
          },
          "guardian_entry_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The Guardian entry whose clip shows the moment."
          },
          "guardian_clip_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When that clip starts."
          }
        }
      },
      "RecordingDays": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "month",
          "days"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "month": {
            "type": "string"
          },
          "days": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CamerasWithRecordings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_ids"
        ],
        "properties": {
          "camera_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "ClipPreflight": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_ids",
          "from",
          "to"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "single",
              "mosaic"
            ],
            "default": "single",
            "description": "`single`: one clip per camera. `mosaic` (1.43.0): one video of 2–9 cameras; the answer then counts one clip, estimates its size (`estimate`) and says whether tiles can carry camera names (`mosaic_labels`)."
          },
          "camera_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "items": {
              "type": "integer"
            }
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DetectionEvent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "raw_label",
          "source",
          "service",
          "hal_token_id",
          "track_id",
          "start_time",
          "end_time",
          "count",
          "peak_confidence",
          "alert_id",
          "bbox",
          "attributes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Opaque (`d…` a detection event, `h…` a Vision Engine report)."
          },
          "label": {
            "type": "string",
            "description": "Grouped label (`face`, `plate`, `line`, `zone`, or as reported)."
          },
          "raw_label": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "description": "`core-ai` (this server's detections) or the Vision Engine service name. Open set."
          },
          "service": {
            "type": [
              "string",
              "null"
            ]
          },
          "hal_token_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The reporting Vision Engine service instance."
          },
          "track_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "count": {
            "type": "integer"
          },
          "peak_confidence": {
            "type": "number"
          },
          "alert_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "bbox": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": false,
            "required": [
              "x",
              "y",
              "w",
              "h"
            ],
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              },
              "w": {
                "type": "number"
              },
              "h": {
                "type": "number"
              }
            }
          },
          "attributes": {
            "type": [
              "object",
              "null"
            ],
            "description": "The Vision Engine report as sent (at most 2 KB; else null)."
          }
        }
      },
      "DetectionBoxes": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "boxes",
          "truncated"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "boxes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DetectionBox"
            }
          },
          "truncated": {
            "type": "boolean"
          }
        }
      },
      "DetectionBox": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "t",
          "label",
          "confidence",
          "x",
          "y",
          "w",
          "h",
          "track_id",
          "source"
        ],
        "properties": {
          "t": {
            "type": "string",
            "format": "date-time",
            "description": "When the frame was captured."
          },
          "label": {
            "type": "string",
            "description": "As stored: a class (`car`), `face:<name>` or `plate:<text>`."
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "x": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Left edge, as a fraction of the frame width."
          },
          "y": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Top edge, as a fraction of the frame height."
          },
          "w": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "h": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "track_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "description": "`track` (Analytics) or the detection service (`hal-objects`, `hal-face`, ...)."
          }
        }
      },
      "DetectionEventPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DetectionEvent"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RemoteAccessUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "Client": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "hostname",
          "status",
          "version",
          "last_seen_at",
          "created_at",
          "camera_ids",
          "camera_count",
          "timezone",
          "timezone_utc_offset_seconds",
          "timezone_override",
          "effective_timezone",
          "clock_relay"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "hostname": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "description": "`online`, `offline` (open set)."
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_seen_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "camera_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "camera_count": {
            "type": "integer"
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "description": "API 1.50.0. The IANA zone the client computer reports (vigiora-client 1.16.0+; `null` = not reported)."
          },
          "timezone_utc_offset_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "description": "API 1.50.0. The client's UTC offset when it last reported."
          },
          "timezone_override": {
            "type": [
              "string",
              "null"
            ],
            "description": "API 1.50.0. The admin's zone for this client's cameras (`PATCH /clients/{client_id}`); `null` = the reported one."
          },
          "effective_timezone": {
            "type": [
              "string",
              "null"
            ],
            "description": "API 1.50.0. The zone this client's cameras' clocks are set to (override, else reported; `null` = the server's)."
          },
          "clock_relay": {
            "type": "boolean",
            "description": "API 1.50.0. The client relays camera clock checks and fixes to its cameras (on the Vigiora network, client 1.16.0 or newer)."
          }
        }
      },
      "ClientUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "timezone_override": {
            "type": [
              "string",
              "null"
            ],
            "description": "An IANA zone (`Europe/Rome`) for this client's cameras' clocks; `null` or `\"\"` = the zone the client reports."
          }
        }
      },
      "ClientPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Client"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ClientActionQueued": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "client_id",
          "action",
          "queued"
        ],
        "properties": {
          "client_id": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "queued": {
            "type": "boolean"
          }
        }
      },
      "ClientCameraCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "stream_url": {
            "type": "string"
          },
          "sub_stream_url": {
            "type": "string"
          },
          "source_type": {
            "type": "string",
            "enum": [
              "rtsp",
              "usb_audio"
            ],
            "default": "rtsp"
          },
          "audio_device": {
            "type": "string",
            "maxLength": 256
          },
          "wake_word_enabled": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "ConnectedAppUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "human_in_the_loop": {
            "type": "string",
            "enum": [
              "inherit",
              "on",
              "off"
            ]
          }
        }
      },
      "ToolWrite": {
        "type": "object",
        "description": "The web app's external tool definition (name, kind, URL, method, schema, cameras, credentials)."
      },
      "Server": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "site_address",
          "version",
          "edition",
          "install",
          "timezone",
          "api_version",
          "camera_catalog_version",
          "features",
          "time",
          "ai"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable for the installation (use it as a unique id)."
          },
          "name": {
            "type": "string",
            "description": "The Vigiora site name when enrolled, else the host name."
          },
          "site_address": {
            "type": [
              "string",
              "null"
            ],
            "description": "https://<site>.vigiora.com while remote access is on."
          },
          "version": {
            "type": "string"
          },
          "edition": {
            "type": "string",
            "enum": [
              "self_hosted",
              "hosted"
            ]
          },
          "install": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "native",
              "docker",
              null
            ]
          },
          "timezone": {
            "type": "string",
            "description": "IANA time zone of the server."
          },
          "api_version": {
            "type": "string",
            "description": "This document's version."
          },
          "camera_catalog_version": {
            "type": "string",
            "description": "API 1.31.0. The version of the embedded camera catalogue (`GET /cameras/catalog`)."
          },
          "features": {
            "type": "array",
            "description": "Optional capabilities (an open set): alerts_summary, camera_speak, floor_plans, guardian_presence, guardian_trash, home_assistant, home_assistant_devices, motion_events, mqtt, chat_notifications, picture_links, presence_events, server_identity, signed_media_urls, stream_url, things, things_event_format, analytics_alerts, analytics_bays, analytics_display, analytics_queues, camera_catalog, transcript_translate, bluetooth, camera_storage, system_capacity, probe_consoles, guardian_triggers, recording_in_progress, automations, chat_approvals (API 1.113.0: Guardian chat actions wait for the user's approval, `pending_actions`), motion_zones (API 1.119.0: `listMotionZones`), branding (API 1.120.0: `getBranding`), feedback_program (API 1.128.0: `getProgram`, `sendFeedback`).",
            "items": {
              "type": "string"
            }
          },
          "time": {
            "type": "string",
            "format": "date-time",
            "description": "The server's clock."
          },
          "ai": {
            "$ref": "#/components/schemas/AIAvailability"
          }
        }
      },
      "AIAvailability": {
        "type": "object",
        "additionalProperties": false,
        "description": "API 1.34.2. Whether AI features (Guardian descriptions and chat, AI Live, recaps, AI views, floor plans) work now. `unavailable` while the AI provider refuses calls (`provider_402`: its account is out of credit; `provider_429`: it is rate-limiting this server; `provider_5xx`: it is failing), while Vigiora cloud refuses this server (`quota_exceeded`, `subscription_inactive`, `over_plan`, `node_unauthorized`, `ai_token_unavailable`, `ai_token_rejected`) or when the server is not connected to Vigiora cloud (`not_configured`); `degraded` while the provider is being probed again or a secondary provider is paused. AI resumes by itself: the server probes the provider once per `retry_at`. `allowance_used` (API 1.113.0): the Vigiora account's monthly AI allowance is used up (the gateway answered `quota_exceeded`); every AI feature that uses Vigiora cloud AI pauses until `resumes_at` (the first day of next month, UTC) or until AI is added to more cameras, and the server checks at most every 15 minutes (`retry_at`); chat on the server's own AI model keeps working. The gateway's `auto_reserved` (automatic descriptions stopped at 70% of the allowance) pauses only the automatic descriptions and is not a reason here; its `rate_limited`, or a 429 without a code, is rate-limiting.",
        "required": [
          "status",
          "reason",
          "since",
          "retry_at",
          "first_failure_at",
          "resumes_at",
          "route"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "degraded",
              "unavailable"
            ]
          },
          "first_failure_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the provider first refused in this pause (kept across server restarts); null when ok."
          },
          "route": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "gateway",
              "own_key",
              null
            ],
            "description": "How this server reaches its AI provider: gateway (Vigiora's cloud AI gateway with Vigiora's provider keys) or own_key (a provider key of its own); null when not configured."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why (an open set: provider_402, provider_429, provider_5xx, allowance_used, quota_exceeded, subscription_inactive, over_plan, node_unauthorized, ai_token_unavailable, ai_token_rejected, rate_limited, plugin_not_entitled, not_configured); null when ok."
          },
          "resumes_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "With reason allowance_used: when the monthly AI allowance starts again (the first day of next month, 00:00 UTC); adding AI to more cameras resumes it sooner. Null otherwise. API 1.113.0."
          },
          "since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the provider stopped accepting calls."
          },
          "retry_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the server next tries the provider."
          }
        }
      },
      "AlertSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "unacknowledged",
          "alerts",
          "by_severity",
          "cameras",
          "latest_at",
          "latest_id"
        ],
        "properties": {
          "unacknowledged": {
            "type": "integer"
          },
          "alerts": {
            "type": "integer",
            "description": "Unacknowledged detections an alert rule promoted (is_alert)."
          },
          "by_severity": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "cameras": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CameraAlertSummary"
            }
          },
          "latest_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "latest_id": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "CameraAlertSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "camera_name",
          "unacknowledged",
          "alerts",
          "by_severity"
        ],
        "properties": {
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "camera_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "unacknowledged": {
            "type": "integer"
          },
          "alerts": {
            "type": "integer"
          },
          "by_severity": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          }
        }
      },
      "StreamURLRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ttl_seconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 3600,
            "default": 600
          },
          "quality": {
            "type": "string",
            "enum": [
              "main",
              "sub"
            ],
            "default": "main"
          },
          "format": {
            "type": "string",
            "enum": [
              "mpegts",
              "fmp4"
            ],
            "default": "mpegts"
          }
        }
      },
      "StreamURL": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "hls_url",
          "rtsp_url",
          "webrtc",
          "quality",
          "format",
          "expires_at",
          "ttl_seconds"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "hls_url": {
            "type": "string",
            "description": "Relative to the server base URL (/api/v1/media/…/stream.m3u8)."
          },
          "rtsp_url": {
            "type": "null"
          },
          "webrtc": {
            "type": "null"
          },
          "quality": {
            "type": "string",
            "enum": [
              "main",
              "sub"
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "mpegts",
              "fmp4"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "ttl_seconds": {
            "type": "integer"
          }
        }
      },
      "MediaURLRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ttl_seconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 3600,
            "default": 600
          }
        }
      },
      "MediaURL": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "url",
          "expires_at",
          "ttl_seconds"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "url": {
            "type": "string",
            "description": "Relative to the server base URL (/api/v1/media/…/image)."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "ttl_seconds": {
            "type": "integer"
          }
        }
      },
      "CameraSpeak": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "volume": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1
          }
        }
      },
      "CameraSpeakResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ok",
          "camera_id",
          "output_id"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "camera_id": {
            "type": "integer"
          },
          "output_id": {
            "type": "integer"
          }
        }
      },
      "CameraTalk": {
        "type": "object",
        "additionalProperties": false,
        "description": "Live push-to-talk (API 1.44.0): whether an operator can speak from the browser's microphone through the camera's speaker. The web app opens a WebRTC session on the live-view WebSocket (`/go2rtc/api/ws`, legacy API) whose offer carries a `sendonly` audio track; go2rtc forwards it to the camera's ONVIF audio backchannel (PCMU/PCMA/Opus as the camera offers). `available` needs `has_speaker` and a camera this server streams itself (`client_id` null): a vigiora-client's camera has no backchannel through the server (`client_streamed`). Text to speech (`speakOnCamera`) is separate and works for both. Admin or operator role and operator permission on the camera, as for `speakOnCamera`; read-only API keys cannot open the WebSocket.",
        "required": [
          "available",
          "reason"
        ],
        "properties": {
          "available": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "no_speaker",
              "client_streamed",
              null
            ],
            "description": "Why not (`null` when available)."
          }
        }
      },
      "Thing": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "name",
          "parent_id",
          "site_id",
          "room_ids",
          "online",
          "manufacturer",
          "model",
          "capabilities",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "`<kind>:<id>` (`server` for the server; `ha:<entity_id>` for a Home Assistant entity); stable."
          },
          "kind": {
            "type": "string",
            "enum": [
              "server",
              "camera",
              "microphone",
              "speaker",
              "room",
              "area",
              "external"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "vigiora",
              "home-assistant"
            ],
            "description": "Catalogue 1.1: `home-assistant` for Home Assistant entities exposed to Vigiora (kind `external`)."
          },
          "name": {
            "type": "string"
          },
          "parent_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "A camera speaker's camera, else `server`; null for the server."
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "room_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "online": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "manufacturer": {
            "type": [
              "string",
              "null"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ThingCapability"
            }
          }
        }
      },
      "ThingCapability": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "version",
          "state",
          "commands",
          "events"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "state": {
            "type": "object",
            "description": "The capability's state (its state_schema)."
          },
          "commands": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ThingList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor",
          "catalog_version"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Thing"
            }
          },
          "next_cursor": {
            "type": "null"
          },
          "catalog_version": {
            "type": "string"
          }
        }
      },
      "ThingsCatalog": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "kinds",
          "capabilities",
          "envelope"
        ],
        "properties": {
          "version": {
            "type": "string"
          },
          "kinds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CapabilitySpec"
            }
          },
          "envelope": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "CapabilitySpec": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "version",
          "description",
          "kinds",
          "state_schema",
          "commands",
          "events"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "kinds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "state_schema": {
            "type": "object"
          },
          "commands": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommandSpec"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventSpec"
            }
          }
        }
      },
      "CommandSpec": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "description",
          "operations",
          "scope",
          "roles",
          "hitl",
          "params_schema"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "operations": {
            "type": "object",
            "description": "Thing kind → the operationId the command runs.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "scope": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hitl": {
            "type": "string",
            "enum": [
              "none",
              "confirm"
            ]
          },
          "params_schema": {
            "type": "object"
          }
        }
      },
      "EventSpec": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "description",
          "data_schema"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "data_schema": {
            "type": "object"
          }
        }
      },
      "ThingCommandResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "thing_id",
          "command",
          "operation_id",
          "result"
        ],
        "properties": {
          "thing_id": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "operation_id": {
            "type": "string"
          },
          "result": {
            "description": "The operation's response body."
          }
        }
      },
      "HomeAssistantCheck": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status",
          "detail",
          "command"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "`os`, `memory`, `disk`, `port`, `docker` or `helper`."
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "warn",
              "fail",
              "action_needed",
              "unsupported"
            ]
          },
          "detail": {
            "type": "string"
          },
          "command": {
            "type": [
              "string",
              "null"
            ],
            "description": "A command a person runs once in a terminal on the server (it asks for the administrator password there, never in Vigiora)."
          }
        }
      },
      "HomeAssistantJobStep": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Install: `checks`, `prepare`, `integration_files`, `container`, `start`, `onboarding`, `restart`, `api_key`, `config_entry`, `verify`; update: `checks`, `integration_files`, `container`, `start`, `verify`; update_integration: `integration_files`, `restart`, `verify`; restart: `restart`, `start`; uninstall: `api_key`, `container`."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "done",
              "failed",
              "skipped"
            ]
          }
        }
      },
      "HomeAssistantJob": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "action",
          "state",
          "steps",
          "log",
          "error",
          "started_at",
          "finished_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "action": {
            "type": "string",
            "enum": [
              "install",
              "update",
              "update_integration",
              "restart",
              "uninstall",
              "setup_zigbee"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "running",
              "succeeded",
              "failed"
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HomeAssistantJobStep"
            }
          },
          "log": {
            "type": "array",
            "description": "What happened, oldest first (never secrets). The web app's \"Copy log\" copies these lines.",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "HomeAssistantStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "state",
          "version",
          "latest_version",
          "available_versions",
          "update_available",
          "url",
          "access",
          "running",
          "container_state",
          "helper",
          "prechecks",
          "setup_command",
          "owner_username",
          "owner_password_available",
          "api_key_id",
          "config_entry_id",
          "integration",
          "last_error",
          "last_backup",
          "zigbee",
          "job"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "none",
              "managed",
              "external"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "not_installed",
              "installing",
              "installed",
              "failed",
              "updating",
              "uninstalling",
              "connected"
            ]
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Home Assistant version Vigiora installed."
          },
          "latest_version": {
            "type": "string",
            "description": "The newest version this Vigiora release can install."
          },
          "available_versions": {
            "type": "array",
            "description": "The pinned versions (image digests recorded by Vigiora), oldest first.",
            "items": {
              "type": "string"
            }
          },
          "update_available": {
            "type": "boolean"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where to open Home Assistant on the LAN."
          },
          "access": {
            "type": "string",
            "enum": [
              "lan_only"
            ],
            "description": "Home Assistant is reachable on the LAN only (not through the site address)."
          },
          "running": {
            "type": "boolean"
          },
          "container_state": {
            "type": [
              "string",
              "null"
            ]
          },
          "devices": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Host USB serial dongles (Zigbee, Z-Wave; /dev/ttyACM*, /dev/ttyUSB*) passed into the managed container."
          },
          "devices_pending": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Dongles on the host the container was not created with; a restart recreates it with them."
          },
          "helper": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "installed",
              "version",
              "protocol",
              "remove_command"
            ],
            "properties": {
              "installed": {
                "type": "boolean"
              },
              "version": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "protocol": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The helper's request/status protocol (null when it is not installed). API 1.22.0."
              },
              "remove_command": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Set while the helper is installed and Home Assistant is not: the one-time command that removes the helper (its systemd units and binary) from the server. Docker stays installed; a Home Assistant configuration folder left behind moves to a backup folder, never deleted. Null otherwise. API 1.22.0."
              }
            }
          },
          "prechecks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HomeAssistantCheck"
            }
          },
          "setup_command": {
            "type": "string",
            "description": "The one-time command that prepares the server (Docker, the helper)."
          },
          "owner_username": {
            "type": [
              "string",
              "null"
            ]
          },
          "owner_password_available": {
            "type": "boolean",
            "description": "The generated owner password has not been shown yet (`…/actions/reveal-owner-password`)."
          },
          "api_key_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The \"Home Assistant (local)\" API key."
          },
          "config_entry_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "integration": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "embedded",
              "version",
              "commit",
              "installed_commit",
              "update_available"
            ],
            "properties": {
              "embedded": {
                "type": "boolean",
                "description": "This server carries the Vigiora integration."
              },
              "version": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "commit": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "installed_commit": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "update_available": {
                "type": "boolean",
                "description": "The Home Assistant Vigiora installed runs another Vigiora integration than this server carries (`…/actions/update-integration`). API 1.22.0."
              }
            }
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_backup": {
            "type": [
              "string",
              "null"
            ],
            "description": "The folder the last uninstall moved Home Assistant's configuration to."
          },
          "zigbee": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "available",
              "configured",
              "port",
              "radio_type",
              "last_error"
            ],
            "description": "Zigbee (ZHA) in the Home Assistant Vigiora installed: set up by Vigiora itself when a USB Zigbee coordinator is in the container (`…/actions/setup-zigbee`). API 1.37.0.",
            "properties": {
              "available": {
                "type": "boolean",
                "description": "A USB serial dongle is passed into the container."
              },
              "configured": {
                "type": "boolean",
                "description": "Home Assistant has a ZHA config entry."
              },
              "port": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The serial port Vigiora configured (null when ZHA was set up by someone else)."
              },
              "radio_type": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The zigpy radio type Vigiora configured (`ezsp`, `znp`, `deconz`; null = probed by Home Assistant or set up by someone else)."
              },
              "last_error": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Why the last Zigbee setup failed."
              }
            }
          },
          "job": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/HomeAssistantJob"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "HomeAssistantZigbeePermit": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "duration_seconds",
          "open",
          "until",
          "seconds_left",
          "ieee"
        ],
        "description": "The Zigbee pairing window (API 1.39.0: open, until, seconds_left, ieee).",
        "properties": {
          "duration_seconds": {
            "type": "integer",
            "description": "How long pairing stays open once opened."
          },
          "open": {
            "type": "boolean",
            "description": "Pairing is open now (as Vigiora opened it)."
          },
          "until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it closes."
          },
          "seconds_left": {
            "type": "integer",
            "description": "Seconds left (0 when closed)."
          },
          "ieee": {
            "type": [
              "string",
              "null"
            ],
            "description": "The router pairing goes through (null = any)."
          }
        }
      },
      "HomeAssistantZigbeePermitRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ieee": {
            "type": "string",
            "pattern": "^([0-9a-fA-F]{2}:){7}[0-9a-fA-F]{2}$",
            "description": "Pair through this router (a mains-powered device) instead of the whole network."
          }
        }
      },
      "HomeAssistantZigbeeRename": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          }
        }
      },
      "HomeAssistantZigbeeEntity": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entity_id",
          "name",
          "domain",
          "kind",
          "state",
          "access",
          "useful",
          "present"
        ],
        "properties": {
          "entity_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "kind": {
            "type": [
              "string",
              "null"
            ],
            "description": "The device class (door, motion, temperature, battery…)."
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "description": "The state as the bridge reports it (null = not reported)."
          },
          "access": {
            "type": "string",
            "enum": [
              "none",
              "read",
              "control"
            ],
            "description": "The bridge's access."
          },
          "useful": {
            "type": "boolean",
            "description": "Vigiora shares this entity automatically."
          },
          "present": {
            "type": "boolean",
            "description": "The bridge reports the entity now."
          }
        }
      },
      "HomeAssistantZigbeeDevice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ieee",
          "nwk",
          "name",
          "user_name",
          "manufacturer",
          "model",
          "device_reg_id",
          "power_source",
          "lqi",
          "rssi",
          "last_seen",
          "available",
          "coordinator",
          "device_type",
          "area_id",
          "entities",
          "exposed",
          "auto_exposed",
          "hidden",
          "first_seen_at",
          "can_identify"
        ],
        "properties": {
          "ieee": {
            "type": "string",
            "description": "The Zigbee address."
          },
          "nwk": {
            "type": "integer",
            "description": "The network address."
          },
          "name": {
            "type": "string",
            "description": "The user's name, else the model's."
          },
          "user_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "manufacturer": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "device_reg_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Home Assistant's device registry id."
          },
          "power_source": {
            "type": "string"
          },
          "lqi": {
            "type": [
              "integer",
              "null"
            ]
          },
          "rssi": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_seen": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the device last talked (RFC 3339)."
          },
          "available": {
            "type": "boolean"
          },
          "coordinator": {
            "type": "boolean",
            "description": "The USB stick itself."
          },
          "device_type": {
            "type": "string",
            "description": "Coordinator, Router or EndDevice."
          },
          "area_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "entities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HomeAssistantZigbeeEntity"
            }
          },
          "exposed": {
            "type": "boolean",
            "description": "At least one entity is shared with Vigiora."
          },
          "auto_exposed": {
            "type": "boolean",
            "description": "Vigiora shared it itself."
          },
          "hidden": {
            "type": "boolean",
            "description": "An admin hid it; never shared automatically again."
          },
          "first_seen_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When Vigiora first listed it."
          },
          "can_identify": {
            "type": "boolean",
            "description": "The device has an identify button."
          }
        }
      },
      "HomeAssistantZigbeeDevices": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "devices",
          "permit",
          "refreshed_at",
          "bridge_connected"
        ],
        "properties": {
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HomeAssistantZigbeeDevice"
            }
          },
          "permit": {
            "$ref": "#/components/schemas/HomeAssistantZigbeePermit"
          },
          "refreshed_at": {
            "type": "string",
            "format": "date-time"
          },
          "bridge_connected": {
            "type": "boolean",
            "description": "The bridge reports the managed Home Assistant's entities (sharing works)."
          }
        }
      },
      "IoTValue": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "entity_id",
          "value",
          "unit"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "description": "The signal kind (temperature, door, motion…)."
          },
          "entity_id": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "unit": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "IoTEntity": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entity_id",
          "name",
          "domain",
          "device_class",
          "state",
          "unit",
          "summary",
          "last_changed",
          "present",
          "supported",
          "controllable",
          "sensitive",
          "access",
          "signal",
          "signal_auto",
          "signal_override",
          "room_ids",
          "managed_room_ids",
          "camera_ids",
          "trigger_ids",
          "rule_ids",
          "control",
          "light",
          "entity_category"
        ],
        "properties": {
          "entity_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "device_class": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": [
              "string",
              "null"
            ]
          },
          "unit": {
            "type": [
              "string",
              "null"
            ]
          },
          "summary": {
            "type": [
              "string",
              "null"
            ],
            "description": "The state in words."
          },
          "last_changed": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "present": {
            "type": "boolean",
            "description": "Home Assistant reports the entity now."
          },
          "supported": {
            "type": "boolean",
            "description": "Vigiora can use this kind of entity."
          },
          "controllable": {
            "type": "boolean"
          },
          "sensitive": {
            "type": "boolean",
            "description": "A lock, alarm panel or siren."
          },
          "access": {
            "type": "string",
            "enum": [
              "none",
              "read",
              "control"
            ],
            "description": "What Vigiora may do with it."
          },
          "signal": {
            "type": "string",
            "description": "The effective signal kind."
          },
          "signal_auto": {
            "type": "string",
            "description": "The automatic kind (domain and device class)."
          },
          "signal_override": {
            "type": [
              "string",
              "null"
            ],
            "description": "The admin's kind (null = automatic)."
          },
          "room_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Rooms it feeds as a signal."
          },
          "managed_room_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "The rooms of `room_ids` the floor plan put it in (the device's pin is inside the room's outline). API 1.40.0."
          },
          "camera_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Cameras it is linked to."
          },
          "trigger_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Camera triggers that use it."
          },
          "rule_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Alert rules whose actions use it."
          },
          "control": {
            "description": "API 1.47.0. What the entity is as a control and how to change it (null when Home Assistant does not report it now).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/IoTControl"
              },
              {
                "type": "null"
              }
            ]
          },
          "light": {
            "description": "API 1.47.0. A light's state (lights only).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/IoTLight"
              },
              {
                "type": "null"
              }
            ]
          },
          "entity_category": {
            "type": [
              "string",
              "null"
            ],
            "description": "API 1.47.0. Home Assistant's entity_category: `config` (a setting) or `diagnostic`; null = a plain reading or control."
          }
        }
      },
      "IoTControl": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "role",
          "primary",
          "device_class",
          "fields",
          "commands"
        ],
        "description": "An entity's control description (API 1.47.0), derived from its domain, device class, unit, attributes and entity_category. Render a widget per `kind`; an unknown kind is shown as a read-only value.",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "light",
              "switch",
              "cover",
              "lock",
              "alarm",
              "siren",
              "number",
              "select",
              "button",
              "sensor_numeric",
              "sensor_state",
              "binary",
              "text",
              "readonly"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "control",
              "setting",
              "reading",
              "diagnostic"
            ],
            "description": "`control` an everyday control, `setting` a device setting (entity_category config), `reading` a value, `diagnostic` a technical value."
          },
          "primary": {
            "type": "boolean",
            "description": "The entity that stands for its device on a tile."
          },
          "device_class": {
            "type": [
              "string",
              "null"
            ]
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IoTControlField"
            }
          },
          "commands": {
            "type": "array",
            "description": "Commands for `setIoTDeviceEntity` (`open`, `close`, `stop`, `press`, `lock`, `unlock`).",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "IoTControlField": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "type",
          "writable",
          "value",
          "min",
          "max",
          "step",
          "unit",
          "options"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "on, brightness_pct, rgb, color_name, color_temp_kelvin, effect, position, state, locked, code, mode, value, option, message, title."
          },
          "type": {
            "type": "string",
            "enum": [
              "boolean",
              "integer",
              "number",
              "color",
              "enum",
              "string",
              "secret"
            ],
            "description": "`color` is [r, g, b] (0–255 each); `secret` is write-only (a code)."
          },
          "writable": {
            "type": "boolean"
          },
          "value": {
            "description": "The current value (null = unknown or off)."
          },
          "min": {
            "type": [
              "number",
              "null"
            ]
          },
          "max": {
            "type": [
              "number",
              "null"
            ]
          },
          "step": {
            "type": [
              "number",
              "null"
            ]
          },
          "unit": {
            "type": [
              "string",
              "null"
            ]
          },
          "options": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "max_length": {
            "type": "integer"
          }
        }
      },
      "IoTLight": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "on",
          "brightness_pct",
          "color_modes",
          "color_mode",
          "supports_brightness",
          "supports_color",
          "supports_color_temp",
          "rgb",
          "hs",
          "color_temp_kelvin",
          "min_kelvin",
          "max_kelvin",
          "effect",
          "effects"
        ],
        "description": "A Home Assistant light (API 1.47.0). Brightness and colour are null while the light is off.",
        "properties": {
          "on": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "brightness_pct": {
            "type": [
              "integer",
              "null"
            ],
            "description": "0–100 (0 while off)."
          },
          "color_modes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Home Assistant's supported_color_modes (onoff, brightness, color_temp, hs, xy, rgb, rgbw, rgbww, white)."
          },
          "color_mode": {
            "type": [
              "string",
              "null"
            ]
          },
          "supports_brightness": {
            "type": "boolean"
          },
          "supports_color": {
            "type": "boolean"
          },
          "supports_color_temp": {
            "type": "boolean"
          },
          "rgb": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer"
            }
          },
          "hs": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "number"
            }
          },
          "color_temp_kelvin": {
            "type": [
              "integer",
              "null"
            ]
          },
          "min_kelvin": {
            "type": [
              "integer",
              "null"
            ]
          },
          "max_kelvin": {
            "type": [
              "integer",
              "null"
            ]
          },
          "effect": {
            "type": [
              "string",
              "null"
            ]
          },
          "effects": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "IoTPrimary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entity_id",
          "name",
          "access",
          "control"
        ],
        "description": "The entity that stands for a device on its tile (API 1.47.0).",
        "properties": {
          "entity_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "access": {
            "type": "string",
            "enum": [
              "none",
              "read",
              "control"
            ]
          },
          "control": {
            "$ref": "#/components/schemas/IoTControl"
          }
        }
      },
      "IoTEntitySet": {
        "type": "object",
        "additionalProperties": false,
        "description": "Give `values` or `command` (a lock takes `code` in values with either).",
        "properties": {
          "command": {
            "type": "string",
            "maxLength": 32
          },
          "values": {
            "type": "object",
            "description": "Field name → new value (only writable fields of the entity's `control`)."
          },
          "acknowledge_sensitive": {
            "type": "boolean",
            "description": "A person confirmed this action on a lock, alarm panel or siren."
          }
        }
      },
      "IoTLightEffect": {
        "type": "object",
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "blink",
              "pulse",
              "strobe",
              "sos"
            ],
            "description": "The effect to run."
          },
          "duration_s": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300,
            "description": "Whole run in seconds (0 → 10, max 300)."
          },
          "period_ms": {
            "type": "integer",
            "description": "One on/off cycle in milliseconds (0 → per-kind default; clamped 120–10000)."
          },
          "rgb": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 255
            },
            "minItems": 3,
            "maxItems": 3,
            "description": "Colour for blink/pulse as [r, g, b]; omit to keep the light's own colour."
          },
          "rgb2": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 255
            },
            "minItems": 3,
            "maxItems": 3,
            "description": "Pulse's second colour as [r, g, b]; omit to pulse the colour against off."
          },
          "brightness_pct": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "0 keeps the light's own brightness."
          }
        }
      },
      "IoTLightEffectResult": {
        "type": "object",
        "required": [
          "id",
          "entity_id",
          "kind",
          "started",
          "ends"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The running effect's id."
          },
          "entity_id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "started": {
            "type": "string",
            "format": "date-time"
          },
          "ends": {
            "type": "string",
            "format": "date-time",
            "description": "When the effect will end on its own."
          }
        }
      },
      "AutoLightAction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "camera_name",
          "room_id",
          "room_name",
          "device",
          "entity_id",
          "device_name",
          "enabled",
          "after_dark",
          "cooldown_seconds",
          "announced_at",
          "last_fired_at",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "camera_name": {
            "type": "string"
          },
          "room_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "room_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "device": {
            "type": "string",
            "description": "The light's device key."
          },
          "entity_id": {
            "type": "string"
          },
          "device_name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "after_dark": {
            "type": "boolean",
            "description": "Only act between sunset and sunrise."
          },
          "cooldown_seconds": {
            "type": "integer",
            "description": "How long the light stays on before it is put back."
          },
          "announced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the staff were told the light was linked."
          },
          "last_fired_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AutoLightActionPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutoLightAction"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "IoTEntitySetResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entity_id",
          "command",
          "service",
          "log_id",
          "device"
        ],
        "properties": {
          "entity_id": {
            "type": "string"
          },
          "command": {
            "type": "string",
            "description": "The bridge command that ran (`light.set`, `cover.open`, …)."
          },
          "service": {
            "type": "string",
            "description": "The Home Assistant service called (`light.turn_on`)."
          },
          "log_id": {
            "type": "integer",
            "description": "The action log entry."
          },
          "device": {
            "$ref": "#/components/schemas/IoTDevice"
          }
        }
      },
      "IoTEntityPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IoTEntity"
            }
          },
          "next_cursor": {
            "type": "null"
          }
        }
      },
      "IoTZigbee": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ieee",
          "lqi",
          "rssi",
          "last_seen",
          "power_source",
          "available",
          "coordinator",
          "can_identify",
          "hidden",
          "auto_exposed",
          "first_seen_at"
        ],
        "properties": {
          "ieee": {
            "type": "string"
          },
          "lqi": {
            "type": [
              "integer",
              "null"
            ]
          },
          "rssi": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_seen": {
            "type": [
              "string",
              "null"
            ]
          },
          "power_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "available": {
            "type": "boolean"
          },
          "coordinator": {
            "type": "boolean"
          },
          "can_identify": {
            "type": "boolean"
          },
          "hidden": {
            "type": "boolean"
          },
          "auto_exposed": {
            "type": "boolean"
          },
          "first_seen_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "IoTDevice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "instance_id",
          "instance_name",
          "device_id",
          "name",
          "manufacturer",
          "model",
          "area",
          "source",
          "zigbee",
          "online",
          "battery",
          "low_battery",
          "signal",
          "shared",
          "shared_entities",
          "entity_count",
          "types",
          "headline",
          "room_ids",
          "managed_room_ids",
          "camera_ids",
          "primary"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "`<instance id>:<Home Assistant device id>`, or `<instance id>:<entity id>` for an entity without a device."
          },
          "instance_id": {
            "type": "integer"
          },
          "instance_name": {
            "type": "string"
          },
          "device_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Home Assistant's device registry id."
          },
          "name": {
            "type": "string"
          },
          "manufacturer": {
            "type": [
              "string",
              "null"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "area": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "home_assistant",
              "zigbee",
              "loona"
            ],
            "description": "`loona` (API 1.64.0): the Loona pet robot."
          },
          "zigbee": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/IoTZigbee"
              },
              {
                "type": "null"
              }
            ]
          },
          "online": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "A reading arrives (null = no entity to tell)."
          },
          "battery": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Battery percent when known."
          },
          "low_battery": {
            "type": "boolean",
            "description": "Battery under 20 %."
          },
          "signal": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Zigbee link quality (LQI) when known."
          },
          "shared": {
            "type": "boolean",
            "description": "At least one entity is shared with Vigiora."
          },
          "shared_entities": {
            "type": "integer"
          },
          "entity_count": {
            "type": "integer"
          },
          "types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "sensor",
                "binary_sensor",
                "switch_light",
                "lock_cover",
                "climate",
                "button",
                "camera_linked",
                "coordinator"
              ]
            }
          },
          "headline": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "$ref": "#/components/schemas/IoTValue"
            }
          },
          "room_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "managed_room_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "API 1.40.0. The rooms of `room_ids` the device is in because its pin is inside the room's outline on a floor plan (`floor_plans`); a `room_ids` update cannot take it out of those (move the pin on the plan)."
          },
          "camera_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "primary": {
            "description": "API 1.47.0. The entity that stands for the device on a tile (null = none).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/IoTPrimary"
              },
              {
                "type": "null"
              }
            ]
          },
          "entities": {
            "type": "array",
            "description": "In the detail (`GET /iot/devices/{iot_device_id}`, the writes' answers) only.",
            "items": {
              "$ref": "#/components/schemas/IoTEntity"
            }
          },
          "floor_plans": {
            "type": "array",
            "description": "API 1.40.0. The device's pins on floor plans; in the detail only.",
            "items": {
              "$ref": "#/components/schemas/IoTPlacement"
            }
          }
        }
      },
      "IoTPlacement": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "floor_plan_id",
          "floor_plan_name",
          "floor_number",
          "site_id",
          "site_name",
          "item_id",
          "x",
          "y",
          "entity_id",
          "room_id",
          "room_name"
        ],
        "properties": {
          "floor_plan_id": {
            "type": "integer"
          },
          "floor_plan_name": {
            "type": "string"
          },
          "floor_number": {
            "type": [
              "integer",
              "null"
            ]
          },
          "site_id": {
            "type": "integer"
          },
          "site_name": {
            "type": "string"
          },
          "item_id": {
            "type": "integer",
            "description": "The pin (`GET /floor-plans/{floor_plan_id}/items`)."
          },
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "entity_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The entity the pin shows (null = the headline value)."
          },
          "room_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The room whose outline holds the pin (null = none)."
          },
          "room_name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "IoTDevicePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IoTDevice"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "IoTZigbeeStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "available",
          "configured",
          "permit"
        ],
        "properties": {
          "available": {
            "type": "boolean",
            "description": "A Home Assistant Vigiora installed with a Zigbee stick exists."
          },
          "configured": {
            "type": "boolean",
            "description": "Zigbee (ZHA) is set up there (devices list, pairing works)."
          },
          "permit": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/HomeAssistantZigbeePermit"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "IoTMappingUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entity_id"
        ],
        "properties": {
          "entity_id": {
            "type": "string"
          },
          "signal": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "door",
              "motion",
              "occupancy",
              "vibration",
              "smoke",
              "moisture",
              "temperature",
              "humidity",
              "illuminance",
              "battery",
              "power",
              "switch",
              "light",
              "button",
              "lock",
              "cover",
              "climate",
              "unknown",
              null
            ],
            "description": "The kind (null = back to the automatic one)."
          }
        }
      },
      "IoTDeviceUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "room_ids": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The rooms the floor plan manages (`managed_room_ids`) stay whether listed or not (API 1.40.0)."
          },
          "camera_ids": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "mappings": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/IoTMappingUpdate"
            }
          }
        }
      },
      "BluetoothAdapter": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "address",
          "name",
          "powered",
          "discovering"
        ],
        "properties": {
          "address": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "powered": {
            "type": "boolean"
          },
          "discovering": {
            "type": "boolean"
          }
        }
      },
      "RunnerEnrolled": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "hostname",
          "enrolled_at",
          "last_used_at",
          "online",
          "last_seen_at",
          "model",
          "device",
          "ready"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "hostname": {
            "type": [
              "string",
              "null"
            ]
          },
          "enrolled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "online": {
            "type": "boolean",
            "description": "API 1.81.0. The runner sent a heartbeat in the last 90 seconds (they come every 20 s)."
          },
          "last_seen_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The runner's latest heartbeat."
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "description": "runner-vision only: the local vision model it chose for its hardware (e.g. LiquidAI/LFM3-VL-2B-GGUF:Q4_0)."
          },
          "device": {
            "type": [
              "string",
              "null"
            ],
            "description": "runner-vision only: where the model runs, gpu or cpu."
          },
          "ready": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "runner-vision only: the model is loaded and answering."
          }
        }
      },
      "RunnerState": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "enrolled"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "absent",
              "starting",
              "running",
              "crashed",
              "enrolled"
            ]
          },
          "enrolled": {
            "type": "boolean",
            "description": "A runner of this service has enrolled."
          }
        }
      },
      "Runner": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "service",
          "wire_service",
          "gated",
          "on_device",
          "enrolled"
        ],
        "properties": {
          "service": {
            "type": "string",
            "enum": [
              "runner-objects",
              "runner-plates",
              "runner-face",
              "runner-vision",
              "runner-robotnav"
            ]
          },
          "wire_service": {
            "type": "string",
            "description": "The service name on the HAL wire (hal-objects, hal-license-plate, hal-face, hal-vision)."
          },
          "gated": {
            "type": "boolean",
            "description": "Privacy or entitlement gated (plates, faces)."
          },
          "on_device": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RunnerState"
              },
              {
                "type": "null"
              }
            ]
          },
          "enrolled": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunnerEnrolled"
            }
          }
        }
      },
      "RunnerCapability": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "docker",
          "compose",
          "nvidia",
          "gpus",
          "can_install",
          "reason"
        ],
        "properties": {
          "docker": {
            "type": "boolean"
          },
          "compose": {
            "type": "boolean"
          },
          "nvidia": {
            "type": "boolean"
          },
          "gpus": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "can_install": {
            "type": "boolean",
            "description": "Docker, Compose and the NVIDIA runtime are all present."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why not."
          }
        }
      },
      "RunnerList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "runners",
          "on_device"
        ],
        "properties": {
          "runners": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Runner"
            }
          },
          "on_device": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RunnerCapability"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "RunnerInstallTokenCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "service"
        ],
        "properties": {
          "service": {
            "type": "string",
            "enum": [
              "runner-objects",
              "runner-plates",
              "runner-face",
              "runner-vision",
              "runner-robotnav"
            ]
          }
        }
      },
      "RunnerInstallToken": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "service",
          "token",
          "command",
          "expires_at"
        ],
        "properties": {
          "service": {
            "type": "string",
            "enum": [
              "runner-objects",
              "runner-plates",
              "runner-face",
              "runner-vision",
              "runner-robotnav"
            ]
          },
          "token": {
            "type": "string",
            "description": "The one-time install token, shown once."
          },
          "command": {
            "type": "string",
            "description": "The shell one-liner to run on the GPU machine; it carries the token."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AddonAuthor": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "description": "https only; left out when the catalogue gave none or an unsafe one."
          }
        }
      },
      "AddonPrice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model"
        ],
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "free",
              "per_camera_month",
              "per_server_month",
              "one_off"
            ]
          },
          "amount_usd": {
            "type": "number"
          }
        }
      },
      "AddonHardware": {
        "type": "object",
        "additionalProperties": false,
        "description": "What the add-on needs; every field is optional.",
        "properties": {
          "arch": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "amd64",
                "arm64"
              ]
            }
          },
          "os": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "linux",
                "macos",
                "windows"
              ]
            }
          },
          "cpu_min_cores": {
            "type": "number"
          },
          "ram_min_gb": {
            "type": "number"
          },
          "disk_min_gb": {
            "type": "number"
          },
          "gpu": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "required"
            ],
            "properties": {
              "required": {
                "type": "boolean"
              },
              "vendor": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "nvidia",
                    "amd",
                    "intel",
                    "apple"
                  ]
                }
              },
              "min_vram_gb": {
                "type": "number"
              }
            }
          },
          "devices": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "usb",
                "zigbee",
                "bluetooth",
                "serial",
                "microphone",
                "speaker"
              ]
            }
          },
          "notes": {
            "type": "string"
          }
        }
      },
      "AddonHardwareCheck": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "fits",
          "missing",
          "unknown",
          "needs_gpu"
        ],
        "properties": {
          "fits": {
            "type": "boolean",
            "description": "Nothing is missing (unknown facts do not count as missing)."
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "code",
                "need",
                "have",
                "sentence"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "arch",
                    "os",
                    "cores",
                    "ram",
                    "disk",
                    "gpu",
                    "gpu_vendor",
                    "vram",
                    "device",
                    "engine",
                    "nvidia_toolkit"
                  ],
                  "description": "engine and nvidia_toolkit apply to community add-ons: Linux with a native, rootful Docker Engine; for a GPU add-on an NVIDIA Container Toolkit 1.17.8 or newer."
                },
                "need": {
                  "type": "string"
                },
                "have": {
                  "type": "string"
                },
                "sentence": {
                  "type": "string",
                  "description": "For example \"needs a GPU with 6 GB; this server has none\"."
                }
              }
            }
          },
          "unknown": {
            "type": "array",
            "description": "Requirements the server could not confirm (for example a microphone that is not USB).",
            "items": {
              "type": "string"
            }
          },
          "needs_gpu": {
            "type": "boolean"
          },
          "warnings": {
            "type": "array",
            "description": "Shown, not blocking: for a GPU add-on, an NVIDIA Container Toolkit older than 1.17.8 (CVE-2025-23266, CVE-2025-23267).",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AddonManifest": {
        "type": "object",
        "additionalProperties": false,
        "description": "The add-on's manifest (vigiora-addon.yaml, format 1) as the server's validator read it.",
        "required": [
          "manifest",
          "id",
          "name",
          "summary",
          "version",
          "author",
          "licence",
          "categories",
          "vigiora",
          "hardware",
          "run",
          "permissions",
          "price"
        ],
        "properties": {
          "manifest": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "author": {
            "$ref": "#/components/schemas/AddonAuthor"
          },
          "licence": {
            "type": "string"
          },
          "homepage": {
            "type": "string"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "vigiora": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "min_version",
              "addon_api"
            ],
            "properties": {
              "min_version": {
                "type": "string"
              },
              "addon_api": {
                "type": "integer"
              }
            }
          },
          "hardware": {
            "$ref": "#/components/schemas/AddonHardware"
          },
          "run": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "kind",
              "compose",
              "source",
              "privileged",
              "network"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "compose"
                ]
              },
              "compose": {
                "type": "string"
              },
              "source": {
                "type": "string",
                "enum": [
                  "image",
                  "build"
                ]
              },
              "images": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "privileged": {
                "type": "boolean"
              },
              "network": {
                "type": "string",
                "enum": [
                  "none",
                  "outbound",
                  "host"
                ]
              },
              "ports": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              }
            }
          },
          "permissions": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "scopes"
            ],
            "properties": {
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "cameras:read",
                    "streams:read",
                    "events:write",
                    "alerts:write",
                    "recordings:read",
                    "faces:read",
                    "iot:read",
                    "iot:write"
                  ]
                }
              }
            }
          },
          "price": {
            "$ref": "#/components/schemas/AddonPrice"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "settings": {
            "type": "object",
            "description": "Reserved for a later phase (shape checked, not acted on)."
          },
          "ui": {
            "type": "object",
            "description": "Reserved for a later phase (shape checked, not acted on)."
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AddonInstall": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "version",
          "commit",
          "repository",
          "source",
          "machine",
          "state",
          "step",
          "service_name",
          "created_at",
          "updated_at",
          "scopes",
          "enrolled",
          "privileged",
          "reviewed"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "commit": {
            "type": "string",
            "description": "The commit that runs (the reviewed one for a catalogue add-on)."
          },
          "repository": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "community",
              "vigiora",
              "developer"
            ]
          },
          "machine": {
            "type": "string",
            "description": "`local` (this server) or `host:<id>` (a remembered SSH machine)."
          },
          "host_id": {
            "type": "integer"
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "fetching",
              "building",
              "pulling",
              "starting",
              "running",
              "failed",
              "removing",
              "suspended",
              "stopped"
            ]
          },
          "step": {
            "type": "string",
            "description": "What it is doing now, in words."
          },
          "error": {
            "type": "string",
            "description": "Why it failed (with the end of the build or start output)."
          },
          "service_name": {
            "type": "string",
            "description": "The name it enrols with (`addon-<id>`)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enrolled": {
            "type": "boolean"
          },
          "token_id": {
            "type": "integer"
          },
          "network": {
            "type": "string",
            "enum": [
              "none",
              "outbound",
              "host"
            ]
          },
          "privileged": {
            "type": "boolean"
          },
          "suspended_reason": {
            "type": "string"
          },
          "update_version": {
            "type": "string",
            "description": "A newer approved version (offered, never installed by itself)."
          },
          "reviewed": {
            "type": "boolean",
            "description": "False for an add-on installed in developer mode (not reviewed by Vigiora)."
          }
        }
      },
      "AddonList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "addons",
          "developer_mode"
        ],
        "properties": {
          "addons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddonInstall"
            }
          },
          "developer_mode": {
            "type": "boolean"
          }
        }
      },
      "AddonCatalogEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "summary",
          "version",
          "author",
          "categories",
          "hardware",
          "price",
          "by_vigiora",
          "icon",
          "builtin",
          "free",
          "hardware_check"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "author": {
            "$ref": "#/components/schemas/AddonAuthor"
          },
          "categories": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "hardware": {
            "$ref": "#/components/schemas/AddonHardware"
          },
          "price": {
            "$ref": "#/components/schemas/AddonPrice"
          },
          "by_vigiora": {
            "type": "boolean"
          },
          "icon": {
            "type": "string",
            "description": "The server's own address of the icon (a web-app session route), or empty."
          },
          "builtin": {
            "type": "boolean",
            "description": "One of Vigiora's four built-in runners."
          },
          "install_service": {
            "type": "string",
            "description": "For a built-in runner: its name for `POST /runners/install-token`."
          },
          "free": {
            "type": "boolean"
          },
          "hardware_check": {
            "$ref": "#/components/schemas/AddonHardwareCheck"
          },
          "installed_state": {
            "type": "string"
          }
        }
      },
      "AddonCatalog": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "addons",
          "suspended",
          "updated_at",
          "stale"
        ],
        "properties": {
          "addons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddonCatalogEntry"
            }
          },
          "suspended": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddonSuspension"
            }
          },
          "updated_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "stale": {
            "type": "boolean",
            "description": "The cloud could not be reached; this is the last list fetched (at `updated_at`)."
          },
          "error": {
            "type": "string"
          }
        }
      },
      "AddonSuspension": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "reason"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "AddonDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "summary",
          "version",
          "author",
          "categories",
          "hardware",
          "price",
          "by_vigiora",
          "icon",
          "manifest",
          "readme",
          "how_to",
          "screenshots",
          "repository",
          "commit",
          "builtin",
          "free",
          "reviewed",
          "hardware_check",
          "warnings",
          "installed",
          "fetched_at",
          "scopes_enforced"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "author": {
            "$ref": "#/components/schemas/AddonAuthor"
          },
          "categories": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "hardware": {
            "$ref": "#/components/schemas/AddonHardware"
          },
          "price": {
            "$ref": "#/components/schemas/AddonPrice"
          },
          "by_vigiora": {
            "type": "boolean"
          },
          "icon": {
            "type": "string"
          },
          "manifest": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AddonManifest"
              },
              {
                "type": "null"
              }
            ]
          },
          "problems": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "path",
                "message"
              ],
              "properties": {
                "path": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          },
          "readme": {
            "type": "string",
            "description": "Markdown; show it without HTML."
          },
          "how_to": {
            "type": "string",
            "description": "Markdown; show it without HTML."
          },
          "screenshots": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "repository": {
            "type": "string"
          },
          "commit": {
            "type": "string"
          },
          "builtin": {
            "type": "boolean"
          },
          "install_service": {
            "type": "string"
          },
          "free": {
            "type": "boolean"
          },
          "reviewed": {
            "type": "boolean"
          },
          "hardware_check": {
            "$ref": "#/components/schemas/AddonHardwareCheck"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "installed": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AddonInstall"
              },
              {
                "type": "null"
              }
            ]
          },
          "suspended_reason": {
            "type": "string"
          },
          "fetched_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "scopes_enforced": {
            "type": "object",
            "description": "For each manifest scope, whether this server enforces it today (false = no add-on route uses it yet).",
            "additionalProperties": {
              "type": "boolean"
            }
          }
        }
      },
      "AddonInstallCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "machine": {
            "type": "string",
            "description": "`local` or `host:<id>`; empty = the first machine that fits."
          }
        }
      },
      "BluetoothStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "available",
          "reason",
          "message",
          "adapter",
          "enabled",
          "scan_interval_minutes",
          "scan_seconds",
          "scanning",
          "last_scan",
          "next_scan_at",
          "devices",
          "new_today"
        ],
        "properties": {
          "available": {
            "type": "boolean",
            "description": "A scan can run here."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "not_supported",
              "no_dbus",
              "no_bluez",
              "no_adapter",
              "adapter_off",
              "denied",
              "disabled",
              null
            ],
            "description": "Why not (null when available)."
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "adapter": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BluetoothAdapter"
              },
              {
                "type": "null"
              }
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": "The hourly scan is on (`bluetooth_enabled`)."
          },
          "scan_interval_minutes": {
            "type": "integer",
            "description": "`bluetooth_scan_interval_minutes` (default 60)."
          },
          "scan_seconds": {
            "type": "integer",
            "description": "`bluetooth_scan_seconds`: how long one scan listens (default 20)."
          },
          "scanning": {
            "type": "boolean",
            "description": "A scan runs now."
          },
          "last_scan": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BluetoothScan"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_scan_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the next scheduled scan is due; null while disabled or unavailable."
          },
          "devices": {
            "type": "integer",
            "description": "Devices known, ignored ones excluded."
          },
          "new_today": {
            "type": "integer",
            "description": "Devices first seen in the last 24 hours."
          }
        }
      },
      "BluetoothScan": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "started_at",
          "finished_at",
          "duration_seconds",
          "devices_found",
          "new_devices",
          "adapter",
          "trigger",
          "error"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "duration_seconds": {
            "type": "integer"
          },
          "devices_found": {
            "type": "integer",
            "description": "Devices seen in this scan."
          },
          "new_devices": {
            "type": "integer",
            "description": "Of those, seen for the first time."
          },
          "adapter": {
            "type": "string",
            "description": "The adapter address."
          },
          "trigger": {
            "type": "string",
            "enum": [
              "schedule",
              "startup",
              "manual"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the scan failed; null when it ran."
          }
        }
      },
      "BluetoothScanPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BluetoothScan"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "BluetoothService": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "uuid",
          "name"
        ],
        "properties": {
          "uuid": {
            "type": "string",
            "description": "The 128-bit UUID, lower case."
          },
          "name": {
            "type": "string",
            "description": "The assigned name of a 16-bit service (Battery, Heart Rate, Google Fast Pair, Tile, Exposure Notification…), `0xABCD` for an unnamed one, the UUID itself otherwise."
          }
        }
      },
      "BluetoothReportItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "text"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "A stable code (the web app translates by it)."
          },
          "text": {
            "type": "string",
            "description": "The English text."
          }
        }
      },
      "BluetoothReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "label",
          "confidence",
          "data_available",
          "uses_for_vigiora",
          "notes",
          "reasons"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "phone",
              "watch",
              "earbuds",
              "speaker_tv",
              "tracker",
              "sensor",
              "smart_home",
              "computer",
              "car",
              "beacon",
              "unknown"
            ]
          },
          "label": {
            "type": "string",
            "description": "What it is, in words (iPhone, Galaxy Watch, Find My device, Environmental sensor…)."
          },
          "confidence": {
            "type": "string",
            "enum": [
              "high",
              "medium",
              "low"
            ]
          },
          "data_available": {
            "type": "array",
            "description": "What the device could provide.",
            "items": {
              "$ref": "#/components/schemas/BluetoothReportItem"
            }
          },
          "uses_for_vigiora": {
            "type": "array",
            "description": "What Vigiora could do with it.",
            "items": {
              "$ref": "#/components/schemas/BluetoothReportItem"
            }
          },
          "notes": {
            "type": "array",
            "description": "Caveats: rotating addresses, nothing is connected to, Exposure Notification beacons cannot be tracked.",
            "items": {
              "$ref": "#/components/schemas/BluetoothReportItem"
            }
          },
          "reasons": {
            "type": "array",
            "description": "The facts that decided the kind.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "BluetoothDevice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "address",
          "address_type",
          "random_address",
          "address_changes",
          "name",
          "kind",
          "label",
          "confidence",
          "rssi",
          "rssi_best",
          "tx_power",
          "manufacturer_id",
          "manufacturer",
          "manufacturer_data",
          "services",
          "service_data",
          "appearance",
          "class_of_device",
          "paired",
          "connected",
          "trusted",
          "first_seen_at",
          "last_seen_at",
          "seen_count",
          "new_today",
          "ignored",
          "note"
        ],
        "properties": {
          "address": {
            "type": "string",
            "description": "`AA:BB:CC:DD:EE:FF`."
          },
          "address_type": {
            "type": "string",
            "enum": [
              "public",
              "random"
            ]
          },
          "random_address": {
            "type": "boolean",
            "description": "A random (often rotating) address: the same device can come back under a new one."
          },
          "address_changes": {
            "type": "integer",
            "description": "Times the device came back under a new address and kept this entry."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The advertised name; null when the device has none."
          },
          "kind": {
            "type": "string",
            "enum": [
              "phone",
              "watch",
              "earbuds",
              "speaker_tv",
              "tracker",
              "sensor",
              "smart_home",
              "computer",
              "car",
              "beacon",
              "unknown"
            ]
          },
          "label": {
            "type": "string"
          },
          "confidence": {
            "type": "string",
            "enum": [
              "high",
              "medium",
              "low"
            ]
          },
          "rssi": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Signal at the last scan (dBm)."
          },
          "rssi_best": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The best signal ever seen (dBm)."
          },
          "tx_power": {
            "type": [
              "integer",
              "null"
            ]
          },
          "manufacturer_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The Bluetooth SIG company identifier."
          },
          "manufacturer": {
            "type": [
              "string",
              "null"
            ],
            "description": "The maker (`Company 0x1234` when the table does not know the id)."
          },
          "manufacturer_data": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last manufacturer-specific payload, hex."
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BluetoothService"
            }
          },
          "service_data": {
            "type": "object",
            "description": "The last service data by UUID, hex.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "appearance": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The GATT appearance value."
          },
          "class_of_device": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The classic class of device."
          },
          "paired": {
            "type": "boolean",
            "description": "BlueZ has it paired (the adapter's own pairings; Vigiora pairs nothing)."
          },
          "connected": {
            "type": "boolean"
          },
          "trusted": {
            "type": "boolean"
          },
          "first_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "seen_count": {
            "type": "integer"
          },
          "new_today": {
            "type": "boolean",
            "description": "First seen in the last 24 hours."
          },
          "ignored": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          },
          "report": {
            "$ref": "#/components/schemas/BluetoothReport",
            "description": "The report (the detail only)."
          }
        }
      },
      "BluetoothDevicePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BluetoothDevice"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "BluetoothDeviceUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "note": {
            "type": "string",
            "maxLength": 500
          },
          "ignored": {
            "type": "boolean"
          }
        }
      },
      "BluetoothScanRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "seconds": {
            "type": "integer",
            "minimum": 5,
            "maximum": 60,
            "description": "How long to listen (default the `bluetooth_scan_seconds` setting)."
          }
        }
      },
      "MemoryFact": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "subject",
          "fact",
          "confidence",
          "source_conversation_id",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "person",
              "habit",
              "experience",
              "preference",
              "other"
            ]
          },
          "subject": {
            "type": "string",
            "description": "Who or what the fact is about (may be empty)."
          },
          "fact": {
            "type": "string"
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "source_conversation_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The Guardian conversation it was learned in."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MemoryFactPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MemoryFact"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MemoryFactUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "person",
              "habit",
              "experience",
              "preference",
              "other"
            ]
          },
          "subject": {
            "type": "string",
            "maxLength": 200
          },
          "fact": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          }
        }
      },
      "TwoFactorStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "pending",
          "enabled_at",
          "recovery_codes_left",
          "available"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "A sign-in needs a code as well as the password."
          },
          "pending": {
            "type": "boolean",
            "description": "Being turned on: a secret exists, no code confirmed yet."
          },
          "enabled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "recovery_codes_left": {
            "type": "integer",
            "minimum": 0
          },
          "available": {
            "type": "boolean",
            "description": "The server can store two-factor secrets (its secret key is present)."
          }
        }
      },
      "TwoFactorPassword": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "password"
        ],
        "properties": {
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "description": "The caller's current password."
          }
        }
      },
      "TwoFactorCode": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The 6-digit code from the authenticator app."
          }
        }
      },
      "TwoFactorPasswordCode": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "password",
          "code"
        ],
        "properties": {
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "description": "The caller's current password."
          },
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "A 6-digit code from the app, or an unused recovery code (XXXX-XXXX-XXXX-XXXX; case, spaces and dashes do not matter)."
          }
        }
      },
      "TwoFactorEnrolment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "secret",
          "otpauth_uri"
        ],
        "properties": {
          "secret": {
            "type": "string",
            "description": "The shared secret, base32 without padding (for typing into the app)."
          },
          "otpauth_uri": {
            "type": "string",
            "description": "otpauth://totp/… link (SHA1, 6 digits, 30 seconds) to show as a QR code."
          }
        }
      },
      "TwoFactorRecoveryCodes": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "recovery_codes"
        ],
        "properties": {
          "recovery_codes": {
            "type": "array",
            "minItems": 10,
            "maxItems": 10,
            "items": {
              "type": "string",
              "description": "XXXX-XXXX-XXXX-XXXX; each works once."
            }
          }
        }
      },
      "TwoFactorConfirmed": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "recovery_codes"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "recovery_codes": {
            "type": "array",
            "minItems": 10,
            "maxItems": 10,
            "items": {
              "type": "string",
              "description": "XXXX-XXXX-XXXX-XXXX; each works once."
            }
          }
        }
      },
      "AccountSession": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "created_at",
          "last_used_at",
          "ip",
          "browser",
          "os",
          "current"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The session id (32 hex characters)."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the device signed in."
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Its last sign-in or token refresh."
          },
          "ip": {
            "type": "string",
            "description": "The address of that last use (empty if unknown)."
          },
          "browser": {
            "type": "string",
            "description": "Chrome, Safari, Firefox, Edge, …; empty when not recognised."
          },
          "os": {
            "type": "string",
            "description": "Windows, macOS, iOS, Android, Linux, …; empty when not recognised."
          },
          "current": {
            "type": "boolean",
            "description": "The session making this call."
          }
        }
      },
      "AccountSessionPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountSession"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AccountSessionsRevoked": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "revoked"
        ],
        "properties": {
          "revoked": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "PerceptionCoachSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "interval_seconds",
          "bar",
          "daily_cap"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "interval_seconds": {
            "type": "integer",
            "minimum": 1,
            "description": "A camera is audited at most this often (default 21600)."
          },
          "bar": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Above 0. A prompt scoring below this is rewritten or a rewrite suggested (default 0.75)."
          },
          "daily_cap": {
            "type": "integer",
            "minimum": 0,
            "description": "Model calls per UTC day across all cameras (default 200)."
          }
        }
      },
      "PerceptionCoachSettingsUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "interval_seconds": {
            "type": "integer",
            "minimum": 1
          },
          "bar": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Above 0."
          },
          "daily_cap": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "PerceptionCoachEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "monitor_id",
          "room_id",
          "prompt",
          "source",
          "score",
          "rationale",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "kind": {
            "type": "string",
            "enum": [
              "camera",
              "room"
            ],
            "description": "`camera`: a camera guardian prompt; `room`: a room's AI rules (API 1.69.0)."
          },
          "monitor_id": {
            "type": "integer",
            "description": "The camera id; 0 for a room entry."
          },
          "room_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The room id of a room entry; null for a camera entry (API 1.69.0)."
          },
          "prompt": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "human",
              "coach"
            ]
          },
          "score": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "The audit result behind the entry (`overall`, per-directive scores, `applied`, `note`); null for human rows."
          },
          "rationale": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PerceptionCoachStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "interval_seconds",
          "bar",
          "daily_cap",
          "calls_today",
          "recent"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "interval_seconds": {
            "type": "integer"
          },
          "bar": {
            "type": "number"
          },
          "daily_cap": {
            "type": "integer"
          },
          "calls_today": {
            "type": "integer",
            "description": "Model calls made this UTC day."
          },
          "recent": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PerceptionCoachEntry"
            }
          }
        }
      },
      "PerceptionCoachHistory": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entries"
        ],
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PerceptionCoachEntry"
            }
          }
        }
      },
      "PerceptionCoachPrompt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "prompt"
        ],
        "properties": {
          "prompt": {
            "type": "string",
            "description": "The AI guardian prompt now in force."
          }
        }
      },
      "LoonaDevice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sn",
          "model",
          "ip",
          "fw_version",
          "battery_pct",
          "online",
          "last_seen_at",
          "os",
          "mode",
          "iot_device_key"
        ],
        "properties": {
          "sn": {
            "type": "string",
            "description": "The robot serial (without the per-session suffix)."
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "ip": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where it was last seen."
          },
          "fw_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "battery_pct": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "online": {
            "type": "boolean",
            "description": "A session is open now."
          },
          "last_seen_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "os": {
            "type": [
              "string",
              "null"
            ]
          },
          "mode": {
            "type": [
              "string",
              "null"
            ],
            "description": "The current mode as the robot reports it."
          },
          "iot_device_key": {
            "type": "string",
            "description": "The robot's `key` on `GET /iot/devices`."
          }
        }
      },
      "LoonaStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "configured",
          "enabled",
          "keyi_user_id_set",
          "host",
          "robot_serial",
          "robot_ip",
          "online",
          "auto_turn",
          "paused",
          "rejected",
          "last_error",
          "device"
        ],
        "properties": {
          "configured": {
            "type": "boolean",
            "description": "Enabled and the KEYi account id stored; otherwise the integration is dormant."
          },
          "enabled": {
            "type": "boolean"
          },
          "keyi_user_id_set": {
            "type": "boolean",
            "description": "The account id is stored (its value is never returned)."
          },
          "host": {
            "type": "string",
            "description": "The KEYi region host sent to the robot."
          },
          "robot_serial": {
            "type": [
              "string",
              "null"
            ],
            "description": "The serial set by an admin (optional)."
          },
          "robot_ip": {
            "type": [
              "string",
              "null"
            ],
            "description": "The IP set by an admin (optional; skips discovery)."
          },
          "online": {
            "type": "boolean"
          },
          "auto_turn": {
            "type": "boolean",
            "description": "When a high-severity alert fires in a room the robot shares a floor plan with, the robot turns toward it (off by default)."
          },
          "paused": {
            "type": "boolean",
            "description": "Disconnected by the operator: the server will not redial until reconnected (distinct from merely asleep)."
          },
          "rejected": {
            "type": "boolean",
            "description": "The robot refused the account id."
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "device": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/LoonaDevice"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "LoonaDriveAction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "direction"
        ],
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "forward",
              "backward",
              "left",
              "right"
            ],
            "description": "Which way to nudge the robot."
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "How long to drive in milliseconds (clamped 100-3000; default ~400)."
          }
        }
      },
      "LoonaSpeakAction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "What the robot should say out loud."
          }
        }
      },
      "LoonaEmoteAction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "face",
              "find_people",
              "fondle",
              "listen_name",
              "mechanical"
            ],
            "description": "The canned expression / behaviour to play."
          }
        }
      },
      "LoonaSettingsUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Needs `keyi_user_id`."
          },
          "keyi_user_id": {
            "type": "string",
            "maxLength": 128,
            "description": "The KEYi (\"Hello Loona\" app) account user id."
          },
          "host": {
            "type": "string",
            "maxLength": 253,
            "description": "The KEYi region host (default `jploona.keyirobot.cn`)."
          },
          "robot_serial": {
            "type": "string",
            "maxLength": 128,
            "description": "Optional: the robot serial, so discovery can find it."
          },
          "robot_ip": {
            "type": "string",
            "maxLength": 45,
            "description": "Optional: the robot IP (skips discovery); empty clears it."
          },
          "auto_turn": {
            "type": "boolean",
            "description": "Turn the robot toward a room where a high-severity alert fires (off by default)."
          }
        }
      },
      "HomeAssistantInstance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url",
          "host",
          "port",
          "name",
          "version",
          "sources",
          "managed"
        ],
        "properties": {
          "url": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "mdns",
                "local",
                "scan"
              ]
            }
          },
          "managed": {
            "type": "boolean"
          }
        }
      },
      "HomeAssistantDiscovery": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "instances"
        ],
        "properties": {
          "instances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HomeAssistantInstance"
            }
          }
        }
      },
      "HomeAssistantInstallRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "string",
            "description": "One of `available_versions` (default: `latest_version`)."
          },
          "language": {
            "type": "string",
            "maxLength": 10,
            "description": "Home Assistant's language, e.g. `en`, `th`, `pt-BR` (default `en`)."
          },
          "latitude": {
            "type": "number",
            "minimum": -90,
            "maximum": 90
          },
          "longitude": {
            "type": "number",
            "minimum": -180,
            "maximum": 180
          },
          "unit_system": {
            "type": "string",
            "enum": [
              "metric",
              "us_customary"
            ],
            "description": "Default: `us_customary` for US, LR and MM, else `metric`."
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "ISO 3166-1 alpha-2."
          }
        }
      },
      "HomeAssistantUpdateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "string",
            "description": "One of `available_versions` (default: `latest_version`)."
          }
        }
      },
      "HomeAssistantConnectRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 300,
            "description": "The existing Home Assistant's address, e.g. `http://192.0.2.20:8123`."
          }
        }
      },
      "HomeAssistantConnection": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "api_key",
          "api_key_id",
          "scopes",
          "vigiora_url",
          "hacs_repository",
          "steps",
          "url"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Shown once."
          },
          "api_key_id": {
            "type": "integer"
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Scope"
            }
          },
          "vigiora_url": {
            "type": "string",
            "description": "The address to enter in the integration."
          },
          "hacs_repository": {
            "type": "string"
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "HomeAssistantOwnerCredentials": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "username",
          "password"
        ],
        "properties": {
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        }
      },
      "MqttStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "broker",
          "last_error",
          "connected_since",
          "retry_at",
          "published",
          "last_publish_at",
          "topic_root",
          "node_id",
          "things",
          "discovered"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "disabled",
              "connecting",
              "connected",
              "error",
              "no_secret_key"
            ]
          },
          "broker": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "connected_since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "retry_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "published": {
            "type": "integer",
            "description": "Messages published since the server started."
          },
          "last_publish_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "topic_root": {
            "type": [
              "string",
              "null"
            ],
            "description": "`<topic_prefix>/<node_id>` while on."
          },
          "node_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The node id in use (the setting or the server's slug)."
          },
          "things": {
            "type": "integer",
            "description": "Things with a retained state."
          },
          "discovered": {
            "type": "integer",
            "description": "Home Assistant discovery entities published."
          }
        }
      },
      "MqttIntegration": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "broker_url",
          "username",
          "password_set",
          "client_id",
          "topic_prefix",
          "node_id",
          "tls_verify",
          "discovery",
          "discovery_prefix",
          "allow_control",
          "qos",
          "updated_at",
          "status"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "broker_url": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "password_set": {
            "type": "boolean",
            "description": "A password is stored (never returned)."
          },
          "client_id": {
            "type": "string",
            "description": "Empty: `vigiora-<node_id>`."
          },
          "topic_prefix": {
            "type": "string"
          },
          "node_id": {
            "type": "string",
            "description": "Empty: the server's slug."
          },
          "tls_verify": {
            "type": "boolean"
          },
          "discovery": {
            "type": "boolean",
            "description": "Publish Home Assistant MQTT discovery."
          },
          "discovery_prefix": {
            "type": "string"
          },
          "allow_control": {
            "type": "boolean",
            "description": "Run Things commands from the command topic."
          },
          "qos": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/MqttStatus"
          }
        }
      },
      "MqttIntegrationUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Only the fields sent change.",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "broker_url": {
            "type": "string",
            "maxLength": 512,
            "description": "mqtt://, mqtts://, ws:// or wss://; no credentials in it."
          },
          "username": {
            "type": "string",
            "maxLength": 256
          },
          "password": {
            "type": "string",
            "maxLength": 1024,
            "description": "Never returned; empty clears it."
          },
          "client_id": {
            "type": "string",
            "maxLength": 64,
            "description": "Letters, digits, _ and -."
          },
          "topic_prefix": {
            "type": "string",
            "maxLength": 259,
            "description": "Up to 4 segments of letters, digits, _ and -; no wildcards."
          },
          "node_id": {
            "type": "string",
            "maxLength": 64,
            "description": "Lowercase letters, digits, _ and -."
          },
          "tls_verify": {
            "type": "boolean"
          },
          "discovery": {
            "type": "boolean"
          },
          "discovery_prefix": {
            "type": "string",
            "maxLength": 259
          },
          "allow_control": {
            "type": "boolean"
          },
          "qos": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2
          }
        }
      },
      "MqttTestResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "topic"
        ],
        "properties": {
          "topic": {
            "type": "string",
            "description": "Where the test message went."
          }
        }
      },
      "ChatStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "last_error",
          "last_sent_at",
          "sent",
          "suppressed"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "not_set_up",
              "disabled",
              "ready",
              "error"
            ]
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sent": {
            "type": "integer",
            "description": "Messages sent since the server started."
          },
          "suppressed": {
            "type": "integer",
            "description": "Alerts the 20-a-minute limit held back (summarised in one message)."
          }
        }
      },
      "AIModel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "preset",
          "base_url",
          "model",
          "api_key_set",
          "api_key_last4",
          "fallback_to_vigiora",
          "capabilities",
          "uses_vigiora_credits",
          "routed_features",
          "privacy",
          "presets",
          "default_ollama_url",
          "updated_at"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "vigiora",
              "ollama",
              "own_key"
            ]
          },
          "preset": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "openai",
              "gemini",
              "anthropic",
              "custom",
              null
            ]
          },
          "base_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "api_key_set": {
            "type": "boolean",
            "description": "An API key is stored (never returned)."
          },
          "api_key_last4": {
            "type": [
              "string",
              "null"
            ],
            "description": "The key's last 4 characters (keys longer than 8)."
          },
          "fallback_to_vigiora": {
            "type": "boolean",
            "description": "Requests the chosen model cannot do (pictures, tools) go to Vigiora cloud AI. Default false."
          },
          "capabilities": {
            "$ref": "#/components/schemas/AIModelCaps"
          },
          "uses_vigiora_credits": {
            "type": "boolean",
            "description": "False with an own model: its answers use no Vigiora AI credits."
          },
          "routed_features": {
            "type": "array",
            "description": "The features the chosen model answers (`guardian_chat`, `picture_descriptions`).",
            "items": {
              "type": "string"
            }
          },
          "privacy": {
            "type": "string",
            "description": "Where questions and pictures go with this choice."
          },
          "presets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AIModelPreset"
            }
          },
          "default_ollama_url": {
            "type": "string"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AIModelCaps": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "text",
          "pictures",
          "tools",
          "tested_at"
        ],
        "description": "What the last test (or a refused call) found; null = not known.",
        "properties": {
          "text": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "pictures": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "tools": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "tested_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AIModelPreset": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "base_url",
          "note"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "base_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AIModelUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Only the fields sent change.",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "vigiora",
              "ollama",
              "own_key"
            ]
          },
          "preset": {
            "type": "string",
            "enum": [
              "openai",
              "gemini",
              "anthropic",
              "custom"
            ]
          },
          "base_url": {
            "type": "string",
            "maxLength": 512
          },
          "model": {
            "type": "string",
            "maxLength": 200
          },
          "api_key": {
            "type": "string",
            "maxLength": 512,
            "description": "Write-only (never returned); empty clears it."
          },
          "fallback_to_vigiora": {
            "type": "boolean"
          }
        }
      },
      "AIModelCheck": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ok",
          "supported",
          "detail"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "supported": {
            "type": "boolean",
            "description": "False when the model cannot do it at all."
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "AIModelTestResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "model",
          "text",
          "pictures",
          "tools",
          "latency_ms"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "ollama",
              "own_key"
            ]
          },
          "model": {
            "type": "string"
          },
          "text": {
            "$ref": "#/components/schemas/AIModelCheck"
          },
          "pictures": {
            "$ref": "#/components/schemas/AIModelCheck"
          },
          "tools": {
            "$ref": "#/components/schemas/AIModelCheck"
          },
          "latency_ms": {
            "type": "integer",
            "description": "Time of the text check."
          }
        }
      },
      "AIModelList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "models"
        ],
        "properties": {
          "models": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ChatIntegration": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "service",
          "enabled",
          "token_set",
          "recipients",
          "pictures",
          "updated_at",
          "status"
        ],
        "properties": {
          "service": {
            "type": "string",
            "enum": [
              "telegram",
              "line"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "token_set": {
            "type": "boolean",
            "description": "A bot token is stored (never returned)."
          },
          "recipients": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pictures": {
            "type": "boolean",
            "description": "Send the entry's picture with the alert: Telegram as a photo, LINE as an image message through a public picture link (a share of kind `picture`, valid 7 days, revocable with `DELETE /shares/{share_id}`). LINE gets text while the server has no public address. Default true."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/ChatStatus"
          }
        }
      },
      "ChatIntegrationUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Only the fields sent change.",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "token": {
            "type": "string",
            "maxLength": 1024,
            "description": "The bot token (never returned); empty clears it."
          },
          "recipients": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "pictures": {
            "type": "boolean"
          }
        }
      },
      "ChatTestResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sent_to"
        ],
        "properties": {
          "sent_to": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "HomeAssistantBridgeStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "source",
          "url",
          "ha_version",
          "connected_since",
          "last_event_at",
          "last_error",
          "retry_at",
          "entities",
          "exposed",
          "managed_available",
          "human_in_the_loop",
          "instance_id",
          "instance_count"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "not_configured",
              "connecting",
              "connected",
              "auth_failed",
              "error",
              "no_secret_key",
              "disabled"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "none",
              "managed",
              "manual"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "ha_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "connected_since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_event_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "retry_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "entities": {
            "type": "integer"
          },
          "exposed": {
            "type": "integer"
          },
          "managed_available": {
            "type": "boolean"
          },
          "human_in_the_loop": {
            "type": "boolean"
          },
          "instance_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The instance these endpoints act on (1; null = none yet). API 1.29.0."
          },
          "instance_count": {
            "type": "integer",
            "description": "How many Home Assistant instances exist. API 1.29.0."
          }
        }
      },
      "HomeAssistantBridgeInstance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "enabled",
          "state",
          "source",
          "url",
          "ha_version",
          "connected_since",
          "last_event_at",
          "last_error",
          "retry_at",
          "entities",
          "exposed"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean",
            "description": "A disabled instance does not connect (state `disabled`)."
          },
          "state": {
            "type": "string",
            "enum": [
              "not_configured",
              "connecting",
              "connected",
              "auth_failed",
              "error",
              "no_secret_key",
              "disabled"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "none",
              "managed",
              "manual"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "ha_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "connected_since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_event_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "retry_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "entities": {
            "type": "integer"
          },
          "exposed": {
            "type": "integer"
          }
        }
      },
      "HomeAssistantBridgeInstancePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HomeAssistantBridgeInstance"
            }
          },
          "next_cursor": {
            "type": "null"
          }
        }
      },
      "HomeAssistantBridgeInstanceCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "source"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60,
            "description": "Unique (case-insensitive), e.g. \"Home\" or \"Shop\"."
          },
          "source": {
            "type": "string",
            "enum": [
              "managed",
              "manual"
            ]
          },
          "url": {
            "type": "string",
            "description": "manual: http(s)://host:8123"
          },
          "token": {
            "type": "string",
            "description": "manual: a long-lived access token (never returned)."
          }
        }
      },
      "HomeAssistantBridgeInstanceUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "HomeAssistantBridgeTest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "url": {
            "type": "string",
            "description": "With token: test these instead of the stored connection."
          },
          "token": {
            "type": "string",
            "description": "With url (never stored nor returned)."
          }
        }
      },
      "HomeAssistantBridgeTestResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ok",
          "ha_version",
          "error"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "ha_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "HomeAssistantBridgeConnect": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "managed",
              "manual"
            ]
          },
          "url": {
            "type": "string",
            "description": "manual: http(s)://host:8123"
          },
          "token": {
            "type": "string",
            "description": "manual: a long-lived access token (never returned)."
          }
        }
      },
      "HomeAssistantEntity": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "instance_id",
          "instance_name",
          "entity_id",
          "name",
          "area",
          "domain",
          "device_class",
          "state",
          "summary",
          "capability",
          "controllable",
          "sensitive",
          "access",
          "sensitive_ack",
          "present"
        ],
        "properties": {
          "instance_id": {
            "type": "integer",
            "description": "The Home Assistant instance (API 1.29.0)."
          },
          "instance_name": {
            "type": "string",
            "description": "The instance's name (API 1.29.0)."
          },
          "entity_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "area": {
            "type": [
              "string",
              "null"
            ]
          },
          "domain": {
            "type": "string"
          },
          "device_class": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": [
              "string",
              "null"
            ]
          },
          "summary": {
            "type": "string"
          },
          "capability": {
            "type": "string",
            "description": "The main capability (contact, motion, presence, onoff, lock, alarm_mode, siren, value, notify)."
          },
          "controllable": {
            "type": "boolean"
          },
          "sensitive": {
            "type": "boolean"
          },
          "access": {
            "type": "string",
            "enum": [
              "none",
              "read",
              "control"
            ]
          },
          "sensitive_ack": {
            "type": "boolean",
            "description": "An admin confirmed control of this sensitive device."
          },
          "present": {
            "type": "boolean"
          }
        }
      },
      "HomeAssistantEntityPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HomeAssistantEntity"
            }
          },
          "next_cursor": {
            "type": "null"
          }
        }
      },
      "HomeAssistantSetAccess": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "access"
        ],
        "properties": {
          "access": {
            "type": "string",
            "enum": [
              "none",
              "read",
              "control"
            ]
          },
          "confirm_sensitive": {
            "type": "boolean",
            "description": "Required to enable control of a lock, alarm panel or siren."
          }
        }
      },
      "HomeAssistantCapability": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "state",
          "commands"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "state": {
            "type": "object"
          },
          "commands": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "HomeAssistantChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "from",
          "to",
          "summary"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          }
        }
      },
      "HomeAssistantDevice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "thing_id",
          "instance_id",
          "instance_name",
          "entity_id",
          "name",
          "area",
          "domain",
          "device_class",
          "online",
          "access",
          "sensitive",
          "sensitive_ack",
          "summary",
          "ha_state",
          "last_changed",
          "capabilities",
          "camera_ids",
          "room_ids",
          "recent"
        ],
        "properties": {
          "thing_id": {
            "type": "string",
            "description": "The thing id (`ha:<device key>`)."
          },
          "instance_id": {
            "type": "integer",
            "description": "The Home Assistant instance (API 1.29.0)."
          },
          "instance_name": {
            "type": "string",
            "description": "The instance's name (API 1.29.0)."
          },
          "entity_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "area": {
            "type": [
              "string",
              "null"
            ]
          },
          "domain": {
            "type": "string"
          },
          "device_class": {
            "type": [
              "string",
              "null"
            ]
          },
          "online": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "access": {
            "type": "string",
            "enum": [
              "read",
              "control"
            ]
          },
          "sensitive": {
            "type": "boolean"
          },
          "sensitive_ack": {
            "type": "boolean"
          },
          "summary": {
            "type": "string"
          },
          "ha_state": {
            "type": "string"
          },
          "last_changed": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HomeAssistantCapability"
            }
          },
          "camera_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "room_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "recent": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HomeAssistantChange"
            }
          }
        }
      },
      "HomeAssistantDevicePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HomeAssistantDevice"
            }
          },
          "next_cursor": {
            "type": "null"
          }
        }
      },
      "HomeAssistantDeviceUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "camera_ids": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "room_ids": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          }
        }
      },
      "HomeAssistantCommand": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "command"
        ],
        "properties": {
          "command": {
            "type": "string",
            "description": "<capability>.<command>, e.g. onoff.turn_on."
          },
          "params": {
            "type": "object",
            "description": "The command's params (GET /thing-capabilities documents them)."
          },
          "acknowledge_sensitive": {
            "type": "boolean",
            "description": "Confirms an action on a lock, alarm panel or siren."
          }
        }
      },
      "HomeAssistantCommandResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "thing_id",
          "instance_id",
          "entity_id",
          "command",
          "service",
          "log_id"
        ],
        "properties": {
          "thing_id": {
            "type": "string"
          },
          "instance_id": {
            "type": "integer",
            "description": "The Home Assistant instance (API 1.29.0)."
          },
          "entity_id": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "service": {
            "type": "string",
            "description": "The Home Assistant service called (domain.service)."
          },
          "log_id": {
            "type": "integer"
          }
        }
      },
      "HomeAssistantRoomSignals": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "room_id",
          "entity_ids"
        ],
        "properties": {
          "room_id": {
            "type": "integer"
          },
          "entity_ids": {
            "type": "array",
            "description": "Device keys (`light.porch`, `2:light.porch`).",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "HomeAssistantRoomSignalsUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entity_ids"
        ],
        "properties": {
          "entity_ids": {
            "type": "array",
            "maxItems": 30,
            "description": "Device keys (`light.porch`, `2:light.porch`).",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "HomeAssistantTrigger": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "instance_id",
          "instance_name",
          "entity_id",
          "camera_id",
          "to_state",
          "cooldown_seconds",
          "enabled",
          "last_fired_at",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "instance_id": {
            "type": "integer",
            "description": "The Home Assistant instance (API 1.29.0)."
          },
          "instance_name": {
            "type": "string",
            "description": "The instance's name (API 1.29.0)."
          },
          "entity_id": {
            "type": "string"
          },
          "camera_id": {
            "type": "integer"
          },
          "to_state": {
            "type": [
              "string",
              "null"
            ]
          },
          "cooldown_seconds": {
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "last_fired_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "HomeAssistantTriggerPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HomeAssistantTrigger"
            }
          },
          "next_cursor": {
            "type": "null"
          }
        }
      },
      "HomeAssistantTriggerCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entity_id",
          "camera_id"
        ],
        "properties": {
          "instance_id": {
            "type": "integer",
            "minimum": 1,
            "description": "The entity's instance (default 1, or the prefix of a device key in entity_id). API 1.29.0."
          },
          "entity_id": {
            "type": "string",
            "description": "An entity id or a device key."
          },
          "camera_id": {
            "type": "integer",
            "minimum": 1
          },
          "to_state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64
          },
          "cooldown_seconds": {
            "type": "integer",
            "minimum": 10,
            "maximum": 86400
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "HomeAssistantTriggerUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "instance_id": {
            "type": "integer",
            "minimum": 1,
            "description": "The entity's instance (default 1, or the prefix of a device key in entity_id). API 1.29.0."
          },
          "entity_id": {
            "type": "string",
            "description": "An entity id or a device key."
          },
          "camera_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Must be the trigger's camera."
          },
          "to_state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64
          },
          "cooldown_seconds": {
            "type": "integer",
            "minimum": 10,
            "maximum": 86400
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "HomeAssistantRuleAction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "position",
          "instance_id",
          "instance_name",
          "entity_id",
          "command",
          "params",
          "duration_seconds",
          "sensitive_confirmed"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "position": {
            "type": "integer"
          },
          "instance_id": {
            "type": "integer",
            "description": "The Home Assistant instance (API 1.29.0)."
          },
          "instance_name": {
            "type": "string",
            "description": "The instance's name (API 1.29.0)."
          },
          "entity_id": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "params": {
            "type": "object"
          },
          "duration_seconds": {
            "type": [
              "integer",
              "null"
            ]
          },
          "sensitive_confirmed": {
            "type": "boolean"
          }
        }
      },
      "HomeAssistantRuleActionInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entity_id",
          "command"
        ],
        "properties": {
          "instance_id": {
            "type": "integer",
            "minimum": 1,
            "description": "The entity's instance (default 1, or the prefix of a device key in entity_id). API 1.29.0."
          },
          "entity_id": {
            "type": "string",
            "description": "An entity id or a device key."
          },
          "command": {
            "type": "string"
          },
          "params": {
            "type": "object"
          },
          "duration_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 3600,
            "description": "Undo the command after this long (onoff, siren, lock)."
          },
          "sensitive_confirmed": {
            "type": "boolean"
          }
        }
      },
      "HomeAssistantRuleActions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "alert_rule_id",
          "actions"
        ],
        "properties": {
          "alert_rule_id": {
            "type": "integer"
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HomeAssistantRuleAction"
            }
          }
        }
      },
      "HomeAssistantRuleActionsUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "actions"
        ],
        "properties": {
          "actions": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/HomeAssistantRuleActionInput"
            }
          }
        }
      },
      "HomeAssistantActionLogEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "at",
          "source",
          "user_id",
          "api_key_id",
          "oauth_grant_id",
          "alert_rule_id",
          "alert_id",
          "camera_id",
          "instance_id",
          "instance_name",
          "entity_id",
          "command",
          "service",
          "params",
          "outcome",
          "error"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "type": "string"
          },
          "user_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "api_key_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "oauth_grant_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "alert_rule_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "alert_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "instance_id": {
            "type": "integer",
            "description": "The Home Assistant instance (API 1.29.0)."
          },
          "instance_name": {
            "type": "string",
            "description": "The instance's name; empty once the instance is deleted (API 1.29.0)."
          },
          "entity_id": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "params": {
            "type": "object"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "ok",
              "failed",
              "refused",
              "rate_limited",
              "pending",
              "denied"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "HomeAssistantActionLogPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HomeAssistantActionLogEntry"
            }
          },
          "next_cursor": {
            "type": "null"
          }
        }
      },
      "HomeAssistantPendingAction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "source",
          "requested_by",
          "thing_id",
          "instance_id",
          "instance_name",
          "entity_id",
          "name",
          "command",
          "params",
          "summary",
          "sensitive",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "requested_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "thing_id": {
            "type": "string"
          },
          "instance_id": {
            "type": "integer",
            "description": "The Home Assistant instance (API 1.29.0)."
          },
          "instance_name": {
            "type": "string",
            "description": "The instance's name (API 1.29.0)."
          },
          "entity_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "params": {
            "type": "object"
          },
          "summary": {
            "type": "string"
          },
          "sensitive": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "HomeAssistantPendingActionPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HomeAssistantPendingAction"
            }
          },
          "next_cursor": {
            "type": "null"
          }
        }
      },
      "HomeAssistantPendingDecision": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "decision",
          "result"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "decision": {
            "type": "string",
            "enum": [
              "approved",
              "denied"
            ]
          },
          "result": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/HomeAssistantCommandResult"
              }
            ]
          }
        }
      },
      "FloorPlan": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "site_id",
          "site_name",
          "name",
          "floor_number",
          "sort_order",
          "image_type",
          "width_px",
          "height_px",
          "version",
          "source",
          "metres_per_unit",
          "can_edit",
          "camera_count",
          "unacked_alerts",
          "description",
          "image_url",
          "thumb_url",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "site_id": {
            "type": "integer"
          },
          "site_name": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "floor_number": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Negative for basements; null when the plan is not a floor."
          },
          "sort_order": {
            "type": "integer"
          },
          "image_type": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ]
          },
          "width_px": {
            "type": "integer"
          },
          "height_px": {
            "type": "integer"
          },
          "version": {
            "type": "integer",
            "description": "Increases with every change of the plan or its items."
          },
          "source": {
            "type": "string",
            "enum": [
              "upload",
              "ai",
              "scan"
            ],
            "description": "API 1.32.0: `upload` (an image) or `ai` (drawn from a description; see `getFloorPlanLayout`); `scan` (drawn by Vigiora from the cameras or a walk-through)."
          },
          "metres_per_unit": {
            "type": [
              "number",
              "null"
            ],
            "description": "API 1.67.1: the locked scale in metres per plan unit; null until set."
          },
          "can_edit": {
            "type": "boolean"
          },
          "camera_count": {
            "type": "integer",
            "description": "The cameras on the plan you may view."
          },
          "unacked_alerts": {
            "type": "integer",
            "description": "Unacknowledged alerts of the last 24 hours of those cameras."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where the cameras are, in plain language (get only; null in lists and write answers)."
          },
          "image_url": {
            "type": "string"
          },
          "thumb_url": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FloorPlanPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FloorPlan"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "FloorPlanSite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "site_id",
          "name",
          "parent_id",
          "can_edit",
          "plan_count"
        ],
        "properties": {
          "site_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "parent_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "can_edit": {
            "type": "boolean",
            "description": "You may add and edit plans on this site."
          },
          "plan_count": {
            "type": "integer"
          }
        }
      },
      "FloorPlanSiteList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FloorPlanSite"
            }
          }
        }
      },
      "FloorPlanCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "site_id",
          "image_base64"
        ],
        "properties": {
          "site_id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "maxLength": 128
          },
          "floor_number": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -20,
            "maximum": 200
          },
          "sort_order": {
            "type": "integer",
            "minimum": -1000,
            "maximum": 1000
          },
          "image_base64": {
            "type": "string",
            "description": "The PNG or JPEG image, base64-encoded (optionally a data: URL); about 13.5 MB of image at most (the request body is limited to 20 MB)."
          }
        }
      },
      "FloorPlanUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "site_id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "maxLength": 128
          },
          "floor_number": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -20,
            "maximum": 200
          },
          "sort_order": {
            "type": "integer",
            "minimum": -1000,
            "maximum": 1000
          },
          "metres_per_unit": {
            "type": "number",
            "minimum": 0,
            "description": "API 1.67.1: lock the plan scale (metres per plan unit). JSON body only; omit or null leaves it unchanged."
          },
          "width_px": {
            "type": "integer",
            "minimum": 64,
            "maximum": 8000,
            "description": "API 1.74.0: resize the plan canvas width in px (no image re-upload). JSON body only. Since API 1.75.1 the drawing keeps its size and scale: space is added or cut at the right, every item is moved with the drawing and metres_per_unit follows; a canvas that would cut an item is refused (422 width_px)."
          },
          "height_px": {
            "type": "integer",
            "minimum": 64,
            "maximum": 8000,
            "description": "API 1.74.0: resize the plan canvas height in px (no image re-upload). JSON body only; since API 1.75.1 space is added or cut at the bottom and the items stay on the drawing (422 height_px if one would be cut)."
          },
          "image_base64": {
            "type": "string",
            "description": "A new PNG or JPEG image, base64-encoded (optionally a data: URL); about 13.5 MB of image at most (the request body is limited to 20 MB)."
          }
        }
      },
      "FloorPlanUpload": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "floor_number": {
            "type": "integer",
            "description": "Empty or `null` clears it."
          },
          "sort_order": {
            "type": "integer"
          },
          "image": {
            "type": "string",
            "format": "binary",
            "description": "PNG or JPEG, at most 18 MB (required on upload)."
          }
        }
      },
      "FloorPlanItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "camera_id",
          "speaker_id",
          "device_key",
          "entity_id",
          "room_id",
          "analytics_area_id",
          "x",
          "y",
          "rotation_deg",
          "fov_deg",
          "range",
          "polygon",
          "label",
          "z",
          "name"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "camera",
              "speaker",
              "device",
              "room",
              "area",
              "door",
              "window",
              "landmark",
              "furniture"
            ]
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "speaker_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "device_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "kind device (API 1.40.0): the IoT device (`GET /iot/devices/{iot_device_id}`)."
          },
          "entity_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "kind device: the entity whose state the pin shows (null = the device's headline value)."
          },
          "room_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "analytics_area_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "x": {
            "type": [
              "number",
              "null"
            ],
            "description": "Pins (cameras, speakers, devices) only (0..1 of the image width)."
          },
          "y": {
            "type": [
              "number",
              "null"
            ],
            "description": "Pins only (0..1 of the image height)."
          },
          "rotation_deg": {
            "type": "number",
            "description": "0 = up on the image, clockwise, [0, 360)."
          },
          "fov_deg": {
            "type": [
              "number",
              "null"
            ],
            "description": "Cameras only (10–360)."
          },
          "range": {
            "type": [
              "number",
              "null"
            ],
            "description": "Cameras only: view distance as a fraction of the image width."
          },
          "polygon": {
            "type": [
              "array",
              "null"
            ],
            "description": "Rooms and areas: 3–64 vertices. Doors and windows (API 1.70.0): exactly 2 points (the ends of the opening on a wall).",
            "items": {
              "type": "array",
              "minItems": 2,
              "maxItems": 2,
              "items": {
                "type": "number"
              }
            }
          },
          "label": {
            "type": "string",
            "description": "The label shown on the plan. For a room it is the room's name (API 1.38.0): the server keeps the two equal, so a polygon whose room was deleted keeps its name here."
          },
          "z": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "description": "The name of the camera, speaker, device, room or area (read only)."
          }
        }
      },
      "FloorPlanItemWrite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind"
        ],
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Ignored."
          },
          "kind": {
            "type": "string",
            "enum": [
              "camera",
              "speaker",
              "device",
              "room",
              "area",
              "door",
              "window",
              "landmark",
              "furniture"
            ]
          },
          "camera_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "kind camera."
          },
          "speaker_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "kind speaker."
          },
          "device_key": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "kind device (API 1.40.0): the IoT device's key (`<instance id>:<Home Assistant device id>` or `<instance id>:<entity id>`), once per plan. The device must be on the IoT devices page."
          },
          "entity_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "kind device: the entity of the device whose state the pin shows (null = the headline value)."
          },
          "room_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "kind room. Optional since API 1.38.0: a room polygon without `room_id` needs a `label`, and the server makes the room from it (the site's room of that name when one is not yet on the plan, else a new room with source `plan`) and answers the item with its `room_id`. A changed `label` renames the room. The cameras whose pin is inside the polygon become the room's managed cameras."
          },
          "analytics_area_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "kind area."
          },
          "x": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1
          },
          "y": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1
          },
          "rotation_deg": {
            "type": "number"
          },
          "fov_deg": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 10,
            "maximum": 360
          },
          "range": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0.02,
            "maximum": 1
          },
          "polygon": {
            "type": [
              "array",
              "null"
            ],
            "minItems": 2,
            "maxItems": 64,
            "description": "Rooms and areas: 3–64 vertices. Doors and windows (API 1.70.0): exactly 2 points (the ends of the opening on a wall). Landmarks (API 1.76.0, kind landmark): 3–64 vertices with a `label` naming the feature of the grounds (Gate, Street, Driveway, Fence, Pool, Garden); no id ref. The floor scan places them from what the cameras see around the building; a feature two cameras see is put where their lines of sight cross. Furniture (API 1.82.0, kind furniture): 3–64 vertices with a `label` (Sofa, Bed, Counter, …) from the block library (GET /api/v1/floor-plans/blocks); no id ref.",
            "items": {
              "type": "array",
              "minItems": 2,
              "maxItems": 2,
              "items": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              }
            }
          },
          "label": {
            "type": "string",
            "maxLength": 64
          },
          "z": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "description": "Ignored."
          }
        }
      },
      "FloorPlanItems": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "floor_plan_id",
          "version",
          "data"
        ],
        "properties": {
          "floor_plan_id": {
            "type": "integer"
          },
          "version": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FloorPlanItem"
            }
          }
        }
      },
      "FloorPlanRooms": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "floor_plan_id",
          "data"
        ],
        "properties": {
          "floor_plan_id": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Room"
            }
          }
        }
      },
      "FloorPlanRoomRef": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "room_id",
          "name",
          "item_id"
        ],
        "properties": {
          "room_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "item_id": {
            "type": "integer",
            "description": "The polygon that is the room."
          }
        }
      },
      "FloorPlanRoomSync": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "floor_plan_id",
          "rooms_created",
          "rooms_renamed",
          "cameras_added",
          "cameras_removed",
          "devices_added",
          "devices_removed",
          "rooms"
        ],
        "properties": {
          "floor_plan_id": {
            "type": "integer"
          },
          "rooms_created": {
            "type": "integer"
          },
          "rooms_renamed": {
            "type": "integer"
          },
          "cameras_added": {
            "type": "integer",
            "description": "Managed memberships added."
          },
          "cameras_removed": {
            "type": "integer",
            "description": "Managed memberships removed."
          },
          "devices_added": {
            "type": "integer",
            "description": "Managed device entity links added (API 1.40.0)."
          },
          "devices_removed": {
            "type": "integer",
            "description": "Managed device entity links removed (API 1.40.0)."
          },
          "rooms": {
            "type": "array",
            "description": "The rooms drawn on the plan after the sync.",
            "items": {
              "$ref": "#/components/schemas/FloorPlanRoomRef"
            }
          }
        }
      },
      "FloorPlanItemsReplace": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "items"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "description": "The plan version the items were read from."
          },
          "items": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/FloorPlanItemWrite"
            }
          }
        }
      },
      "FloorPlanLive": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "floor_plan_id",
          "version",
          "cameras",
          "unacked_alerts",
          "analytics_entitled",
          "areas",
          "devices"
        ],
        "properties": {
          "floor_plan_id": {
            "type": "integer"
          },
          "version": {
            "type": "integer"
          },
          "cameras": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FloorPlanLiveCamera"
            }
          },
          "unacked_alerts": {
            "type": "integer"
          },
          "analytics_entitled": {
            "type": "boolean",
            "description": "The Analytics add-on is active (occupancy is shown)."
          },
          "areas": {
            "type": "array",
            "description": "Live occupancy of the analytics areas on the plan (empty without the add-on).",
            "items": {
              "$ref": "#/components/schemas/FloorPlanAreaOccupancy"
            }
          },
          "devices": {
            "type": "array",
            "description": "The IoT device pins' live state (API 1.40.0; empty without the IoT devices page).",
            "items": {
              "$ref": "#/components/schemas/FloorPlanLiveDevice"
            }
          }
        }
      },
      "FloorPlanLiveDevice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "device_key",
          "name",
          "source",
          "online",
          "battery",
          "low_battery",
          "headline",
          "values"
        ],
        "properties": {
          "device_key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "home_assistant",
              "zigbee",
              "loona"
            ],
            "description": "`loona` (API 1.64.0): the Loona pet robot."
          },
          "online": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "battery": {
            "type": [
              "integer",
              "null"
            ]
          },
          "low_battery": {
            "type": "boolean"
          },
          "headline": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FloorPlanDeviceValue"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the pin shows: the item's `entity_id` when it names one, else the device's first headline value; null when the device has nothing to show."
          },
          "values": {
            "type": "array",
            "description": "The device's entity readings (the ones Home Assistant reports now).",
            "items": {
              "$ref": "#/components/schemas/FloorPlanDeviceValue"
            }
          }
        }
      },
      "FloorPlanDeviceValue": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entity_id",
          "name",
          "kind",
          "value",
          "unit",
          "exposed",
          "present",
          "last_changed"
        ],
        "properties": {
          "entity_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "The signal kind (door, motion, temperature, battery, switch, …)."
          },
          "value": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "exposed": {
            "type": "boolean",
            "description": "Shared with Vigiora (such entities are the room signals)."
          },
          "present": {
            "type": "boolean"
          },
          "last_changed": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "FloorPlanLiveCamera": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "status",
          "recording",
          "unacked_alerts",
          "latest_alert"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "online",
              "offline",
              "standby",
              "disabled",
              "unknown"
            ]
          },
          "recording": {
            "type": "boolean"
          },
          "unacked_alerts": {
            "type": "integer"
          },
          "latest_alert": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FloorPlanLiveAlert"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "FloorPlanLiveAlert": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "detected_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "The alert id (acknowledge it with acknowledgeAlert)."
          },
          "label": {
            "type": "string"
          },
          "detected_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FloorPlanAreaOccupancy": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "analytics_area_id",
          "name",
          "occupancy",
          "capacity"
        ],
        "properties": {
          "analytics_area_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "occupancy": {
            "type": "integer"
          },
          "capacity": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "FloorPlanDescribe": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "description"
        ],
        "properties": {
          "description": {
            "type": "string",
            "minLength": 10,
            "maxLength": 4000,
            "description": "The place in plain language, in any language."
          },
          "floor_number": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -20,
            "maximum": 200,
            "description": "The floor this plan is for."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 128
          }
        }
      },
      "FloorPlanRefine": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "instruction"
        ],
        "properties": {
          "instruction": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2000,
            "description": "The change, e.g. \"move the kitchen to the left of the entrance\"."
          }
        }
      },
      "FloorPlanLayout": {
        "type": "object",
        "additionalProperties": false,
        "description": "A schematic plan in metres: the origin is the north-west (top-left) corner, x grows east (right), y grows south (down). Headings: 0 = north (up), clockwise.",
        "required": [
          "areas",
          "openings",
          "cameras",
          "compass",
          "notes"
        ],
        "properties": {
          "areas": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "name",
                "kind",
                "x",
                "y",
                "w",
                "h",
                "floor"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "room",
                    "outdoor",
                    "corridor",
                    "garage",
                    "pool",
                    "garden",
                    "other"
                  ]
                },
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "w": {
                  "type": "number"
                },
                "h": {
                  "type": "number"
                },
                "floor": {
                  "type": "integer",
                  "description": "0 = ground floor, negative for basements."
                },
                "size_m": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "minItems": 2,
                  "maxItems": 2,
                  "description": "API 1.33.1. The size the description gives, [w, h] in metres (w and h are what is drawn)."
                },
                "relations": {
                  "type": "array",
                  "maxItems": 6,
                  "description": "API 1.33.1. Where the description puts the area; the server places it from these.",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "to",
                      "kind"
                    ],
                    "properties": {
                      "to": {
                        "type": "string",
                        "description": "The id of the other area."
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "behind",
                          "in_front_of",
                          "left_of",
                          "right_of",
                          "north_of",
                          "south_of",
                          "east_of",
                          "west_of",
                          "next_to",
                          "inside",
                          "across"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "openings": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "between",
                "kind"
              ],
              "properties": {
                "between": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "minItems": 2,
                  "maxItems": 2,
                  "description": "Two area ids; \"outside\" for an exterior door."
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "door",
                    "gate",
                    "opening"
                  ]
                }
              }
            }
          },
          "cameras": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "monitor_id",
                "name",
                "x",
                "y",
                "heading_deg",
                "fov_deg"
              ],
              "properties": {
                "monitor_id": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The camera (camera_id); null when it matches none of the site."
                },
                "name": {
                  "type": "string"
                },
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "heading_deg": {
                  "type": "number"
                },
                "fov_deg": {
                  "type": "number"
                },
                "mounted_on": {
                  "type": "string",
                  "description": "API 1.33.0. The id of the area the camera is mounted on; x, y and heading_deg are derived from it and looks_at."
                },
                "looks_at": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "API 1.33.0. The ids of the areas the camera looks at, the main one first."
                },
                "wall": {
                  "type": "string",
                  "enum": [
                    "north",
                    "east",
                    "south",
                    "west"
                  ],
                  "description": "API 1.33.0. The wall of mounted_on it is on."
                },
                "facing": {
                  "type": "string",
                  "enum": [
                    "north",
                    "north-east",
                    "east",
                    "south-east",
                    "south",
                    "south-west",
                    "west",
                    "north-west"
                  ],
                  "description": "API 1.33.0. The direction the description says the camera looks."
                },
                "mention": {
                  "type": "integer",
                  "description": "API 1.33.0. The number of the description's camera sentence this camera stands for (1 = first)."
                },
                "pinned": {
                  "type": "boolean",
                  "description": "API 1.33.0. Placed by hand on the plan; kept where it is by later changes."
                }
              }
            }
          },
          "compass": {
            "type": "boolean",
            "description": "The description gave compass directions (the plan shows a north arrow)."
          },
          "notes": {
            "type": "string",
            "description": "What the AI assumed or could not place."
          }
        }
      },
      "FloorPlanWalkthroughSession": {
        "type": "object",
        "required": [
          "id",
          "token",
          "qr_prefix",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "The job the upload will continue."
          },
          "token": {
            "type": "string",
            "description": "The session token; send it as the upload's `session` part."
          },
          "qr_prefix": {
            "type": "string",
            "description": "The QR payload prefix, `vigiora-wt:<token>:`; the phone shows `<qr_prefix><seq>`."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FloorPlanWalkthroughUpload": {
        "type": "object",
        "required": [
          "video"
        ],
        "properties": {
          "session": {
            "type": "string",
            "description": "Optional: the token of the recording session (QR codes shown to the cameras)."
          },
          "sensors": {
            "type": "string",
            "description": "Optional: the phone's sensor track as JSON (FloorPlanWalkthroughSensors)."
          },
          "video": {
            "type": "string",
            "format": "binary",
            "description": "The walk-through video; the last part."
          }
        }
      },
      "FloorPlanWalkthroughChunkedUpload": {
        "type": "object",
        "required": [
          "id",
          "chunk_bytes",
          "received",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The upload id (24 hex characters)."
          },
          "chunk_bytes": {
            "type": "integer",
            "description": "The chunk size to send: every chunk but the last is exactly this many bytes."
          },
          "received": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "The chunk numbers received so far, ascending."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When an unfinished upload is dropped."
          }
        }
      },
      "FloorPlanWalkthroughFinish": {
        "type": "object",
        "required": [
          "chunks"
        ],
        "properties": {
          "chunks": {
            "type": "integer",
            "minimum": 1,
            "description": "How many chunks make the video (numbered 0 to chunks-1)."
          },
          "size": {
            "type": "integer",
            "description": "Optional: the video size in bytes; the chunks must add up to it."
          },
          "session": {
            "type": "string",
            "description": "Optional: the token of the recording session (QR codes shown to the cameras)."
          },
          "sensors": {
            "description": "Optional: the phone's sensor track (FloorPlanWalkthroughSensors), as the object or as a JSON string holding it.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/FloorPlanWalkthroughSensors"
              },
              {
                "type": "string"
              }
            ]
          }
        }
      },
      "FloorPlanWalkthroughSensors": {
        "type": "object",
        "description": "The phone's sensor track, times in milliseconds since the video started. Every array may be empty or absent.",
        "properties": {
          "version": {
            "type": "integer",
            "enum": [
              1
            ]
          },
          "source": {
            "type": "string",
            "description": "Who recorded it, e.g. `web`."
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "motion": {
            "type": "array",
            "description": "Rows `[t_ms, ax, ay, az]`: acceleration including gravity, m/s² (at most ~50 Hz).",
            "items": {
              "type": "array",
              "items": {
                "type": "number"
              }
            }
          },
          "heading": {
            "type": "array",
            "description": "Rows `[t_ms, degrees]`: compass heading, 0 = north, clockwise.",
            "items": {
              "type": "array",
              "items": {
                "type": "number"
              }
            }
          },
          "gps": {
            "type": "array",
            "description": "Rows `[t_ms, latitude, longitude, accuracy_m]`.",
            "items": {
              "type": "array",
              "items": {
                "type": "number"
              }
            }
          },
          "qr": {
            "type": "array",
            "description": "Rows `[seq, t_ms]`: when the phone showed the QR code with that seq.",
            "items": {
              "type": "array",
              "items": {
                "type": "number"
              }
            }
          },
          "qr_width_mm": {
            "type": "number",
            "description": "The QR code's width on the screen, millimetres (60 when absent)."
          }
        }
      },
      "FloorPlanWalkthrough": {
        "type": "object",
        "required": [
          "id",
          "site_id",
          "state",
          "phase",
          "progress",
          "plan_id",
          "merged",
          "scale",
          "counts",
          "sensors_used",
          "notes",
          "error",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "site_id": {
            "type": "integer"
          },
          "state": {
            "type": "string",
            "enum": [
              "recording",
              "queued",
              "running",
              "done",
              "failed"
            ]
          },
          "phase": {
            "type": "string",
            "enum": [
              "recording",
              "queued",
              "frames",
              "reading",
              "layout",
              "saving",
              "done",
              "failed"
            ]
          },
          "progress": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "plan_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The plan made or added to."
          },
          "merged": {
            "type": "boolean",
            "description": "True when the walk was added to an existing plan."
          },
          "scale": {
            "type": "string",
            "enum": [
              "estimate",
              "unscaled"
            ],
            "description": "estimate: the steps sized the rooms; unscaled: typical sizes."
          },
          "counts": {
            "type": "object",
            "required": [
              "frames",
              "frames_read",
              "local_reads",
              "cloud_reads",
              "places",
              "rooms",
              "doors",
              "windows",
              "furniture",
              "landmarks",
              "cameras",
              "steps",
              "distance_m"
            ],
            "properties": {
              "frames": {
                "type": "integer",
                "description": "Frames selected for reading."
              },
              "frames_read": {
                "type": "integer"
              },
              "local_reads": {
                "type": "integer",
                "description": "Frames read by a runner's local vision model (free)."
              },
              "cloud_reads": {
                "type": "integer",
                "description": "Frames read by the cloud AI (charged)."
              },
              "places": {
                "type": "integer",
                "description": "Stretches of the walk in one room or outside."
              },
              "rooms": {
                "type": "integer",
                "description": "Rooms drawn (added)."
              },
              "doors": {
                "type": "integer"
              },
              "windows": {
                "type": "integer"
              },
              "furniture": {
                "type": "integer"
              },
              "landmarks": {
                "type": "integer",
                "description": "Grounds features drawn."
              },
              "cameras": {
                "type": "integer",
                "description": "Camera pins placed or moved."
              },
              "steps": {
                "type": "integer"
              },
              "distance_m": {
                "type": "number"
              }
            }
          },
          "sensors_used": {
            "type": "object",
            "required": [
              "steps",
              "compass",
              "gps"
            ],
            "properties": {
              "steps": {
                "type": "boolean"
              },
              "compass": {
                "type": "boolean"
              },
              "gps": {
                "type": "boolean"
              }
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Short notes on what was used and what could not be done."
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "video_kept": {
            "type": "boolean",
            "description": "API 1.85.0. The video is kept: it can be watched and run again."
          },
          "video_bytes": {
            "type": "integer",
            "description": "API 1.85.0. Size of the kept video (0 when none)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FloorPlanWalkthroughPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FloorPlanWalkthrough"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Always null (the list is not paged)."
          }
        }
      },
      "FloorPlanScanResult": {
        "type": "object",
        "required": [
          "plan_id",
          "scale",
          "placed",
          "islands",
          "confidence",
          "review",
          "local_reads",
          "cloud_reads"
        ],
        "properties": {
          "plan_id": {
            "type": "integer"
          },
          "local_reads": {
            "type": "integer",
            "description": "API 1.80.0. Camera panoramas read by a runner's local vision model (runner-vision, free). The scan uses it whenever one is online and re-asks the cloud AI only for a panorama where the local model saw no floor; the layout contest and the review always use the cloud AI."
          },
          "cloud_reads": {
            "type": "integer",
            "description": "Camera panoramas read by the cloud AI."
          },
          "scale": {
            "type": "string",
            "enum": [
              "locked",
              "estimate",
              "unscaled"
            ],
            "description": "How well the plan's size is known."
          },
          "placed": {
            "type": "integer",
            "description": "Cameras placed on the plan."
          },
          "islands": {
            "type": "integer",
            "description": "Groups of cameras (or single cameras) that could not be tied to the main layout."
          },
          "confidence": {
            "type": "number",
            "description": "Overall confidence of the layout (0 to 1)."
          },
          "review": {
            "type": "object",
            "description": "API 1.77.0. Before the plan is stored Vigiora looks at the drawn result the way a person would — tidy rules (a landmark far from every room is pulled in, one covering a room or lying on the street is pushed off) and one AI look at the rendered plan that may move or drop an implausible landmark (the grounds only; rooms, doors and cameras are never touched).",
            "required": [
              "moved",
              "removed",
              "notes",
              "rounds",
              "variants",
              "score",
              "winner",
              "named",
              "rule_score",
              "problems",
              "repaired",
              "moves"
            ],
            "properties": {
              "moved": {
                "type": "integer"
              },
              "removed": {
                "type": "integer"
              },
              "notes": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "One line per change."
              },
              "rounds": {
                "type": "integer",
                "description": "API 1.78.0. Layout contest rounds held (3 when the vision model is available): each round draws three variants of the layout, the model scores them side by side with the scan's running dossier, and the winner seeds the next round."
              },
              "variants": {
                "type": "integer",
                "description": "Layouts compared in all."
              },
              "score": {
                "type": "number",
                "description": "The winning layout's score, 0 to 10."
              },
              "winner": {
                "type": "string",
                "description": "What the winning layout was (\"as scanned\", \"mirrored left-right, front yard ×0.7\", …)."
              },
              "named": {
                "type": "integer",
                "description": "Cameras the scan named from their pictures before laying out (cameras without a \"<Room> – <position>\" name)."
              },
              "rule_score": {
                "type": "number",
                "description": "API 1.79.0. The stored plan against the grid rules (every layout is read on a 1 m grid: a camera on a wall of its room, what it saw inside its view, nothing overlapping, the gate in the fence, the driveway house→gate, the street outermost, everything near the house): 10 minus one point per broken rule, never below 0."
              },
              "problems": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The rules still broken on the stored plan, one line each (empty when all hold)."
              },
              "repaired": {
                "type": "integer",
                "description": "Grid moves the server made itself, trying whole-metre shifts of the grounds until the rules held, before asking the model."
              },
              "moves": {
                "type": "integer",
                "description": "Grid moves the vision model asked for and that were kept (a move that breaks a rule is refused)."
              }
            }
          }
        }
      },
      "FloorPlanGeneration": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "floor_plan",
          "layout",
          "placed_cameras",
          "unplaced_cameras"
        ],
        "properties": {
          "floor_plan": {
            "$ref": "#/components/schemas/FloorPlan"
          },
          "layout": {
            "$ref": "#/components/schemas/FloorPlanLayout"
          },
          "placed_cameras": {
            "type": "integer",
            "description": "The layout's cameras placed as pins."
          },
          "unplaced_cameras": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names of the layout's cameras that match no camera (with no confident match by name or the description's words); for an undo, those of the restored layout (API 1.33.0)."
          }
        }
      },
      "FloorPlanBlockList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "grid_m",
          "grid_origin_px"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FloorPlanBlock"
            }
          },
          "grid_m": {
            "type": "number",
            "description": "Spacing of the metre grid."
          },
          "grid_origin_px": {
            "type": "number",
            "description": "Canvas pixel, on both axes, a grid line passes through on a plan Vigiora drew."
          }
        }
      },
      "FloorPlanBlock": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "category",
          "kind",
          "label",
          "width_m",
          "depth_m",
          "shape"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "structure",
              "furniture",
              "grounds"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "room",
              "door",
              "window",
              "landmark",
              "furniture"
            ]
          },
          "label": {
            "type": "string"
          },
          "width_m": {
            "type": "number"
          },
          "depth_m": {
            "type": "number",
            "description": "0 for a door or window (a wall opening has only a width)."
          },
          "shape": {
            "type": "string",
            "enum": [
              "rect",
              "round"
            ],
            "description": "round is drawn as a 12-sided polygon."
          }
        }
      },
      "FloorPlanLayoutView": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "floor_plan_id",
          "version",
          "source",
          "layout",
          "can_undo",
          "turns"
        ],
        "properties": {
          "floor_plan_id": {
            "type": "integer"
          },
          "version": {
            "type": "integer"
          },
          "source": {
            "type": "string",
            "enum": [
              "upload",
              "ai",
              "scan"
            ]
          },
          "layout": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FloorPlanLayout"
              },
              {
                "type": "null"
              }
            ]
          },
          "can_undo": {
            "type": "boolean"
          },
          "turns": {
            "type": "array",
            "description": "The description chat, oldest first (at most 40).",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "role",
                "text",
                "at"
              ],
              "properties": {
                "role": {
                  "type": "string",
                  "enum": [
                    "user",
                    "ai"
                  ]
                },
                "text": {
                  "type": "string"
                },
                "at": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          }
        }
      },
      "ViewCompose": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "prompt"
        ],
        "properties": {
          "prompt": {
            "type": "string",
            "minLength": 3,
            "maxLength": 2000,
            "description": "What to check, in any language."
          },
          "site_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Limit the catalogue to this site and its sub-sites."
          }
        }
      },
      "ViewRefine": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "instruction"
        ],
        "properties": {
          "instruction": {
            "type": "string",
            "minLength": 3,
            "maxLength": 2000,
            "description": "The change, e.g. \"add the garage\"."
          }
        }
      },
      "ViewPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "pinned": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 128
          },
          "card_keys": {
            "type": [
              "array",
              "null"
            ],
            "minItems": 1,
            "items": {
              "type": "string"
            },
            "description": "The keys of the cards to keep (the others are removed)."
          }
        }
      },
      "ViewCardParams": {
        "type": "object",
        "additionalProperties": false,
        "description": "A card's settings; which apply depends on the kind.",
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "today",
              "yesterday",
              "last_7_days",
              "last_30_days"
            ],
            "description": "people_count, occupancy, queue, parking."
          },
          "hours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 168,
            "description": "The window of alerts, transcript, faces and plates."
          },
          "range": {
            "type": "string",
            "enum": [
              "day",
              "week"
            ],
            "description": "heatmap."
          },
          "layer": {
            "type": "string",
            "enum": [
              "pass",
              "stop"
            ],
            "description": "heatmap."
          },
          "class": {
            "type": "string",
            "enum": [
              "person",
              "vehicle"
            ],
            "description": "people_count, heatmap."
          },
          "area_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "occupancy."
          },
          "zone_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "queue, parking."
          },
          "floor_plan_id": {
            "type": "integer",
            "description": "floor_plan."
          },
          "date": {
            "type": "string",
            "description": "recordings (YYYY-MM-DD; empty = today)."
          }
        }
      },
      "ViewCard": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "kind",
          "monitor_ids",
          "labels",
          "params",
          "size"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "The card within its view (c1, c2, …)."
          },
          "kind": {
            "type": "string",
            "enum": [
              "live",
              "floor_plan",
              "alerts",
              "faces",
              "plates",
              "transcript",
              "recordings",
              "people_count",
              "occupancy",
              "queue",
              "parking",
              "heatmap"
            ]
          },
          "title": {
            "type": "string"
          },
          "monitor_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "The cameras the card shows."
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What the card shows (camera, area, zone or plan names)."
          },
          "params": {
            "$ref": "#/components/schemas/ViewCardParams"
          },
          "size": {
            "type": "string",
            "enum": [
              "s",
              "m",
              "l"
            ]
          }
        }
      },
      "ViewSpec": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title",
          "summary",
          "cards",
          "layout",
          "notes"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "cards": {
            "type": "array",
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/ViewCard"
            }
          },
          "layout": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "cols"
            ],
            "properties": {
              "cols": {
                "type": "integer",
                "minimum": 1,
                "maximum": 4
              }
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What the server changed: names it could not match, cards a camera cannot show, cards over the cap."
          }
        }
      },
      "View": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "prompt",
          "title",
          "summary",
          "spec",
          "pinned",
          "created_at",
          "updated_at",
          "last_opened_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "prompt": {
            "type": "string",
            "description": "The request, with the refinements appended on their own lines."
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "spec": {
            "$ref": "#/components/schemas/ViewSpec"
          },
          "pinned": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_opened_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ViewPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/View"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ViewSuggestions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "TranscriptSegment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "camera_id",
          "started_at",
          "ended_at",
          "duration_seconds",
          "language",
          "text",
          "speaker"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "camera_id": {
            "type": "integer"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "duration_seconds": {
            "type": [
              "number",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "The language the STT detected (ISO 639-1), when known."
          },
          "text": {
            "type": "string"
          },
          "speaker": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The voice number the STT gave the line on this camera (1, 2, …), told apart by voice; numbers are per camera. Null when not known (API 1.91.0). Voice matching is paused in this version: new lines have null, older lines keep their number."
          }
        }
      },
      "TranscriptSegmentPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TranscriptSegment"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "TranscriptCoverageRange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "segments"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the covered stretch."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the covered stretch."
          },
          "segments": {
            "type": "integer",
            "description": "Transcript rows merged into this range."
          }
        }
      },
      "TranscriptCoverage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "from",
          "to",
          "ranges"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the queried window."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the queried window."
          },
          "ranges": {
            "type": "array",
            "description": "Merged covered stretches, oldest first; a gap between them has no transcript.",
            "items": {
              "$ref": "#/components/schemas/TranscriptCoverageRange"
            }
          }
        }
      },
      "TranscriptPassage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "text"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Your id for the passage; unique in the request."
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          }
        }
      },
      "TranscriptTranslate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "passages",
          "to"
        ],
        "properties": {
          "passages": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/TranscriptPassage"
            }
          },
          "to": {
            "type": "string",
            "minLength": 2,
            "maxLength": 3,
            "description": "The language to translate into (ISO 639-1, e.g. `en`)."
          },
          "from": {
            "type": "string",
            "minLength": 2,
            "maxLength": 3,
            "description": "The language the passages are in (ISO 639-1), when known: every passage is then translated (API 1.91.0). Translations are kept on the server; a passage seen before costs nothing."
          }
        }
      },
      "TranscriptTranslation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "to",
          "data"
        ],
        "properties": {
          "to": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "description": "The passages in the order given, with their ids.",
            "items": {
              "$ref": "#/components/schemas/TranscriptPassage"
            }
          }
        }
      },
      "TranscriptSummarize": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "minutes",
          "language"
        ],
        "properties": {
          "minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440,
            "description": "The window ending now."
          },
          "language": {
            "type": "string",
            "minLength": 2,
            "maxLength": 3,
            "description": "The language of the summary (ISO 639-1)."
          }
        }
      },
      "TranscriptSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "language",
          "summary",
          "from",
          "to",
          "segments"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "language": {
            "type": "string"
          },
          "summary": {
            "type": "string",
            "description": "Empty when no speech was transcribed in the window."
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "segments": {
            "type": "integer",
            "description": "The STT segments in the window."
          }
        }
      },
      "CameraLocations": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "camera_id",
          "data"
        ],
        "properties": {
          "camera_id": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CameraLocation"
            }
          }
        }
      },
      "CameraLocation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "floor_plan_id",
          "floor_plan_name",
          "floor_number",
          "site_id",
          "site_name",
          "x",
          "y",
          "rotation_deg",
          "fov_deg",
          "range",
          "description"
        ],
        "properties": {
          "floor_plan_id": {
            "type": "integer"
          },
          "floor_plan_name": {
            "type": "string"
          },
          "floor_number": {
            "type": [
              "integer",
              "null"
            ]
          },
          "site_id": {
            "type": "integer"
          },
          "site_name": {
            "type": "string"
          },
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "rotation_deg": {
            "type": "number"
          },
          "fov_deg": {
            "type": "number"
          },
          "range": {
            "type": "number"
          },
          "description": {
            "type": "string",
            "description": "Where the camera is and what it covers, in plain language."
          }
        }
      }
    }
  }
}
