--- swagger: "2.0" info: description: "This is the full local API for Agent DVR. You can find out more about\ \ AgentDVR at [https://www.ispyconnect.com](https://www.ispyconnect.com)\ \ This interface uses the default API endpoint of http://localhost:8090. You will need Agent DVR installed and running to use it. Many of the commands below take an Object ID and an Object Type ID. The Object ID is displayed in Agent's UI when you edit the device at the top left. For example if it says 1: Home Cam then your Object ID is 1. The Object Type ID is 1 for Microphones and 2 for cameras. You can also provide a group parameter instead of object id and type id - this will then apply the command to all devices that are in that group (on the General tab when you edit the device). Some commands can be called with neither id or group and will then apply to every device on the system." title: 'Agent DVR' version: "8.3.0.0" termsOfService: "https://www.ispyconnect.com/terms.aspx" license: name: "Apache 2.0" url: "http://www.apache.org/licenses/LICENSE-2.0.html" host: "localhost:8090" basePath: "/" consumes: - "application/json" definitions: Alert: properties: ot: type: integer oid: type: integer reason: type: string msg: type: string time: type: string id: type: string read: type: boolean tags: type: string AlertsResponse: properties: alerts: items: $ref: '#/definitions/Alert' type: array Event: properties: Ago: type: integer Ident: type: string Type: type: string RuleRequest: type: object description: Give devices, or scope. required: - what - then properties: instruction: type: string description: The request in plain words, e.g. "tell me if a red car turns up in the next 6 hours". Shown on the rule in the device's Actions list. origin: type: string description: Who made the rule, e.g. "assistant" or "api". Shown on the rule's badge. scope: type: string description: 'Instead of devices: "all", "group:" or "location:" make ONE rule that follows the group - it is matched to devices when their events fire, so a device added later is covered, and the tasks run for whichever device raised the event. "system" is a rule of the server itself: it runs on a system event (armed, disarmed, profileapplied, uiconnected, uidisconnected, uinosessions) or at when.at, needs no device, cannot have a gate, and its tasks must name any device they act on. Such rules are stored as actions with objecttypeid 0 and objectid 0 and timed by the server schedule.' devices: type: array description: 'Devices to watch. Each entry is {"ot":2,"oid":1}, an "ot:oid" string ("2:1") or a device name.' items: type: object what: type: object required: - event properties: event: type: string description: 'The action condition that triggers the rule, e.g. objectfound, facerecognized, licenseplaterecognized, soundrecognized, detected, alert, loiterdetected, disconnect, reconnect, recordingstarted. The detector behind it must be enabled on the device or the rule is refused.' tags: type: array description: What the event must contain (object labels, face names, plates, sound labels), lower case. Object and sound labels must be in the device's Find list. Empty matches anything. items: type: string tagrule: type: string enum: - or - and gate: type: object description: Optional. Asks the configured AI provider (Server Settings - AI Settings) a question about the current frame each time the event fires. With no keywords the prompt is a YES/NO question - the AI is told to answer YES or NO first and the tasks run on YES. With keywords the tasks run when the reply contains one of them (whole word match). The reply only ever runs this rule's tasks. One AI call per trigger, limited by guards.airate. properties: prompt: type: string description: 'A question about the image, e.g. "Is there a red car in this image?"' on: type: string enum: - "yes" - "no" description: 'YES/NO question only: which answer runs the tasks. "no" = "if the bins are NOT out...". Default yes. Anything but a clear YES or NO runs nothing.' keywords: type: array description: Usually omitted. For questions with several answers. items: type: string then: type: array description: 'Tasks to run. /q/getruleoptions lists the tasks with their named parameters: {"type":"PM","message":"Red car at {NAME}"} push notification, {"type":"SPTC","text":"I left the key under the mat"} speak through the camera, {"type":"ATC","file":"alsation_bark.wav"} play a sound through the camera, {"type":"URL","url":"https://..."} call a URL, {"type":"TRGR","device":"Corridor 2","seconds":60} record on another device, {"type":"PRESET","device":"Gate cam","command":"Gate"}. Device parameters take a name or "ot:oid". Raw param1..param6 are also accepted for any action task type. What a task needs (a talk channel, a connected account, an existing preset or sound file) is checked. Execute File (EXE) tasks are not allowed.' items: type: object properties: type: type: string param1: type: string param2: type: string param3: type: string param4: type: string param5: type: string param6: type: string when: type: object description: Optional time limits; they combine. With none the rule runs until it is deleted. A rule with an expiry deletes itself once it has passed. properties: hours: type: number description: Expire this many hours from now until: type: string description: Expire at this local date and time, ISO 8601 (2026-09-20T18:00) expires_ms: type: integer format: int64 description: Expire at this time, UTC epoch milliseconds window: type: object description: Weekly window in local time. The device's schedule must be enabled. An end before the start runs overnight. properties: days: type: array description: 'mon, tue, wed, thu, fri, sat, sun. Empty = every day' items: type: string start: type: string description: 'HH:mm, or sunrise / sunset with an optional offset in minutes: "sunset", "sunset+30", "sunrise-15". Worked out again every day from the location''s coordinates (06:00 / 18:00 when it has none).' end: type: string description: HH:mm, or sunrise / sunset as for start at: type: object description: 'A rule that runs at a set time instead of on an event: leave what.event out. With a gate it looks at the camera then and acts on the answer ("if the bins are not out on Sunday at 8pm, message Max" = at {days:[sun], time:"20:00"} + gate {prompt:"Are the wheelie bins out at the kerb?", on:"no"}); without a gate it just runs the tasks. Needs the device''s schedule on. Cannot be combined with window.' properties: days: type: array description: 'mon..sun. Empty = every day' items: type: string time: type: string description: HH:mm local, or sunrise / sunset with an optional offset in minutes (sunset-30) every_minutes: type: integer description: 'A rule that runs every this many minutes (1-1440; at least 5 with a gate) instead of on an event: leave what.event out. Combine with window to limit it to certain hours. The clock starts when the rule is created (or the server starts). Cannot be combined with at. v8.0.9.0+' date: type: string description: One local day, yyyy-MM-dd. The rule expires at the end of that day (or of the window on that day). guards: type: object properties: maxruns: type: integer description: Pause the rule after it has run its tasks this many times. 0 = no limit. airate: type: integer description: Most AI calls per hour for a gated rule. Default 30, maximum 600. cooldown: type: integer description: Least number of seconds between two runs (the action's Repeat Timeout). A detector raises its event on every cycle while the thing is in view, so without it "every time" means dozens of runs a minute. Default 60 for rules that only notify, 30 for rules that act, 0 for timed rules. Maximum 86400. per: type: string enum: - window - ever description: With a recurring weekly window maxruns counts per opening of the window by default ("weekdays 9 to 5, tell me if" = once a day). "ever" stops the rule for good after maxruns. preview: type: boolean description: true = validate and describe the rule without saving it Rule: type: object properties: ident: type: string origin: type: string instruction: type: string summary: type: string description: One line describing what was set up devices: type: array items: type: object properties: ot: type: integer oid: type: integer name: type: string what: type: object description: event, tags, tagrule and gate {prompt, keywords} (null when the rule has no AI gate) then: type: array description: The tasks the rule runs (type, name, param1-3) items: type: object when: type: object description: expires (local ISO 8601), expires_ms (UTC epoch ms) and window {days, start, end, date}; null where not set guards: type: object description: maxruns and airate created: type: string description: When the rule was created, local ISO 8601 active: type: boolean description: False while paused, outside its window, or after reaching maxruns state: type: string description: 'Why, in words: "active", "waiting: outside its time window, it switches on by itself on Mon at 09:00", "paused", or "spent: it reached its run limit..."' spent: type: boolean description: True once the rule has run maxruns times. resumerule re-arms it. runcount: type: integer actions: type: array description: Idents of the actions the rule compiled to (two when it has an AI gate) items: type: string schedule_rows: type: integer RuleResponse: properties: rule: $ref: '#/definitions/Rule' warnings: type: array description: Things the user should know that do not stop the rule (no end time, run limit applies per window, face names that could not be checked) items: type: string preview: type: boolean description: true when the request had preview=true - nothing was saved RulesResponse: properties: rules: type: array items: $ref: '#/definitions/Rule' paths: /alerts.json: get: summary: Returns collection of the current alerts operationId: alerts.json produces: - application/json responses: "200": description: Returns collection of the current alerts schema: $ref: '#/definitions/AlertsResponse' tags: - Alerts /audio.mp3: get: summary: Returns live audio from the specified microphone in mp3 format operationId: audio.mp3 parameters: - description: Object ID in: query name: oid required: true type: integer produces: - audio/mpeg responses: "200": description: Returns live audio from the specified microphone in mp3 format tags: - Audio /audio.ogg: get: summary: Returns live audio from the specified microphone in ogg format operationId: audio.ogg parameters: - description: Object ID in: query name: oid required: true type: integer produces: - application/ogg responses: "200": description: Returns live audio from the specified microphone in ogg format tags: - Audio /audio.wav: get: summary: Returns live audio from the specified microphone in wav format operationId: audio.wav parameters: - description: Object ID in: query name: oid required: true type: integer produces: - audio/wav responses: "200": description: Returns live audio from the specified microphone in wav format tags: - Audio /command/addfolder: get: summary: Add existing files from the devices folder to the database operationId: /command/addfolder parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Copy files into the devices folder (available via the storage tab) and then call this command to scan the folder and add the recordings to the database so they are available in the UI. Agent will generate missing data like thumbnails and duration. v5.5.5.0+ tags: - Commands /command/addrecording: get: summary: Add an existing recording to a device operationId: /command/addrecording parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Local path to the file in: query name: path required: true type: string - description: Target filename. Will generate a filename if not specified in: query name: name required: false type: string - description: Timestamp in UTC javascript ticks. Will use file creation time if not specified in: query name: timestamp required: false type: integer - description: Convert the file to mp4 (or mp3 if audio) (false) in: query name: convert required: false type: boolean - description: Move the file (false) in: query name: move required: false type: boolean - description: Tag the recording in the database (csv) in: query name: tags required: false type: string produces: - application/json responses: "200": description: Copies (or moves) the file into the device's folder and registers it in the database so it appears in the UI. The source must be an mp3, mp4 or mkv file. Use the optional fields to set the filename, timestamp, tags and conversion behaviour. Returns an error if conversion fails or the target file already exists. tags: - Commands /command/alert: get: summary: Trigger alert on the device. operationId: /command/alert parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Tag (will tag be stored with any associated recording) in: query name: tag required: false type: string - description: AIJSON - any JSON you want passed onto other alert based actions. The presence of AIJSON will also tag the recording and alert as being AI generated. in: query name: aijson required: false type: string - description: Message - any human readable message you want passed onto other alert based actions in: query name: message required: false type: string produces: - application/json responses: "200": description: Triggers an alert on the device, running any configured alert actions. The optional tag, AI JSON and message are passed on to those actions and stored with any associated recording. tags: - Commands /command/alertOff: get: summary: Turn alerts off for the device. operationId: /command/alertOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn alerts off for the device. tags: - Commands /command/alertOn: get: summary: Turn alerts on for the device. operationId: /command/alertOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn alerts on for the device. tags: - Commands /command/alertsOff: get: summary: Turn alerts off for the device and publish the MQTT state. operationId: /command/alertsOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Same as alertOff, but also publishes the device's "alertsarmed" state over MQTT when MQTT push is on for the device. Used by the Home Assistant Alerts switch. tags: - Commands /command/alertsOn: get: summary: Turn alerts on for the device and publish the MQTT state. operationId: /command/alertsOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Same as alertOn, but also publishes the device's "alertsarmed" state over MQTT when MQTT push is on for the device. Used by the Home Assistant Alerts switch. tags: - Commands /command/allOff: get: summary: Switch all devices off operationId: /command/allOff parameters: - description: Only switch off devices in these access groups (csv, case insensitive) in: query name: group required: false type: string - description: Only switch off devices at this location (case insensitive) in: query name: location required: false type: string produces: - application/json responses: "200": description: Switches every device (all cameras and microphones) off, or only those matching group/location. tags: - Commands /command/allOn: get: summary: Switch all devices on operationId: /command/allOn parameters: - description: Only switch on devices in these access groups (csv, case insensitive) in: query name: group required: false type: string - description: Only switch on devices at this location (case insensitive) in: query name: location required: false type: string produces: - application/json responses: "200": description: Switches every device (all cameras and microphones) on, or only those matching group/location. tags: - Commands /command/appendtimestamp: get: summary: Appends text to the devices default timestamp operationId: /command/appendtimestamp parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: text to append (pass an empty value to remove previously appended text) in: query name: text required: false type: string produces: - application/json responses: "200": description: Appends the text after the device's timestamp display. The appended text is saved and persists until it is replaced, cleared with an empty value, or a new formatter is set with settimestamp. tags: - Commands /command/applySchedule: get: summary: Apply schedule to all devices. operationId: /command/applySchedule parameters: - description: Only apply to devices in these access groups (csv, case insensitive) in: query name: group required: false type: string - description: Only apply to devices at this location (case insensitive) in: query name: location required: false type: string produces: - application/json responses: "200": description: Apply schedule to all devices, or only to the devices matching group/location. Devices with their schedule switched off are skipped. tags: - Commands /command/applyScheduleToDevice: get: summary: Apply schedule to a device, group or location. operationId: /command/applyScheduleToDevice parameters: - description: Object ID. Omit to target by group/location instead. in: query name: oid required: false type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: false type: integer - description: Target devices in these access groups (csv, case insensitive) in: query name: group required: false type: string - description: Target devices at this location (case insensitive) in: query name: location required: false type: string produces: - application/json responses: "200": description: Applies the schedule to the targeted devices. Devices with their schedule switched off are skipped. tags: - Commands /command/areaapply: get: summary: Apply a named detection zone map to a camera operationId: /command/areaapply parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID (cameras only) enum: - 2 in: query name: ot required: true type: integer - description: Name of the zone map entry (as configured under detector zones in the UI) in: query name: name required: true type: string produces: - application/json responses: "200": description: Applies the named detection zone map to the camera. Returns an error if no zone map matches. tags: - Commands /command/arm: get: summary: Arm the system. operationId: /command/arm parameters: - description: Optionally disarm after a delay (minutes) in: query name: disarmdelay required: false type: integer produces: - application/json responses: "200": description: Arms the system, enabling alerts on armed devices. tags: - Commands /command/armgroups: get: summary: Arm system and groups of devices (enable alerts) operationId: /command/armGroups parameters: - description: group names (csv) in: query name: groups required: true type: string - description: Optionally disarm the groups after a delay (minutes) in: query name: disarmdelay required: false type: integer produces: - application/json responses: "200": description: Arms the system and enables alerts on the specified groups of devices. tags: - Commands /command/broadcast: get: summary: Send a broadcast message to all connected clients (7910+) operationId: /command/broadcast parameters: - description: text to display in: query name: text required: true type: string produces: - application/json responses: "200": description: Message sent tags: - Commands /command/disarmgroups: get: summary: Disarm groups of devices (disable alerts) operationId: /command/disarmGroups parameters: - description: group names (csv) in: query name: groups required: true type: string - description: Optionally re-arm the groups after a delay (minutes) in: query name: armdelay required: false type: integer produces: - application/json responses: "200": description: Disables alerts on the specified groups of devices. Does not change the system armed state. tags: - Commands /command/armProfile: get: summary: Arm the system and apply the specified profile. operationId: /command/armprofile parameters: - description: profile index in: query name: ind required: true type: integer - description: Optionally disarm after a delay (minutes) in: query name: disarmdelay required: false type: integer produces: - application/json responses: "200": description: Armed the system and applied the specified profile. tags: - Commands /command/disarmProfile: get: summary: Disarm the system and apply the specified profile. operationId: /command/disarmProfile parameters: - description: profile index in: query name: ind required: true type: integer - description: Optionally arm the system after a delay (minutes) in: query name: armdelay required: false type: integer produces: - application/json responses: "200": description: Disarmed and applied the specified profile. tags: - Commands /command/blockExternal: get: summary: Block external access to the system. operationId: /command/blockExternal produces: - application/json responses: "200": description: Block external access to the system. tags: - Commands /command/checkRemote: get: summary: Check the status of the remote (web) connection operationId: /command/checkRemote produces: - application/json responses: "200": description: returns json, status online or offline. v6.6.8.0+ tags: - Commands /command/cloudPhotosOff: get: summary: Turn cloud photos off for the device. operationId: /command/cloudPhotosOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn cloud photos off for the device. tags: - Commands /command/cloudPhotosOn: get: summary: Turn cloud photos on for the device. operationId: /command/cloudPhotosOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn cloud photos on for the device. tags: - Commands /command/cloudRecordingsOff: get: summary: Turn cloud recordings off for the device. operationId: /command/cloudRecordingsOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn cloud recordings off for the device. tags: - Commands /command/cloudRecordingsOn: get: summary: Turn cloud recordings on for the device. operationId: /command/cloudRecordingsOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn cloud recordings on for the device. tags: - Commands /command/deleterecording: get: summary: Delete recordings by filename (7780+) operationId: /command/deleterecording parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Filename (3_2021-01-21_16-34-42_977.mkv) from getEvents. Comma separate to delete multiple. in: query name: fn required: true type: string produces: - application/json responses: "200": description: Deletes the recording(s) from disk and the database. Locked files and the current live recording are skipped. Returns an error if no files were removed. (v7.7.8.0+) tags: - Commands /command/deletephoto: get: summary: Delete photos by filename (7780+) operationId: /command/deletephoto parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID (cameras only) enum: - 2 in: query name: ot required: true type: integer - description: Filename (2021-01-19_12-22-55_125.jpg) from getCameraGrabs. Comma separate to delete multiple. in: query name: fn required: true type: string produces: - application/json responses: "200": description: Deletes the photo(s) from the camera's grabs folder and removes any image tags. Returns an error if no files were removed. (v7.7.8.0+) tags: - Commands /command/detect: get: summary: Trigger motion (or sound) detection on the device. operationId: /command/detect parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Triggers the device's detector as if motion or sound was detected, running any detection-based actions and recording. tags: - Commands /command/detectorOff: get: summary: Turn the motion (or sound) detector off for the device. operationId: /command/detectorOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Disables the device's motion (camera) or sound (microphone) detector. Publishes the "detectorenabled" state over MQTT when MQTT push is on for the device. tags: - Commands /command/detectorOn: get: summary: Turn the motion (or sound) detector on for the device. operationId: /command/detectorOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Enables the device's motion (camera) or sound (microphone) detector. Publishes the "detectorenabled" state over MQTT when MQTT push is on for the device. tags: - Commands /command/disarm: get: summary: Disarm the system. operationId: /command/disarm parameters: - description: Optionally re-arm after a delay (minutes) in: query name: armdelay required: false type: integer produces: - application/json responses: "200": description: Disarms the system, disabling alerts. tags: - Commands /command/facedetecton: get: summary: Turn facial recognition on operationId: /command/faceDetectOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn facial recognition on for the device. tags: - Commands /command/facedetectoff: get: summary: Turn facial recognition off operationId: /command/faceDetectOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn facial recognition off for the device. tags: - Commands /command/ftpFrame: get: summary: Send a live frame via FTP. operationId: /command/ftpFrame parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Send a live frame via FTP. tags: - Commands /command/ftpPhotosOff: get: summary: Turn FTP photos off for the device. operationId: /command/ftpPhotosOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn FTP photos off for the device. tags: - Commands /command/ftpPhotosOn: get: summary: Turn FTP photos on for the device. operationId: /command/ftpPhotosOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn FTP photos on for the device. tags: - Commands /command/ftpRecordingsOff: get: summary: Turn FTP recordings off for the device. operationId: /command/ftpRecordingsOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn FTP recordings off for the device. tags: - Commands /command/ftpRecordingsOn: get: summary: Turn FTP recordings on for the device. operationId: /command/ftpRecordingsOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn FTP recordings on for the device. tags: - Commands /command/getObject: get: summary: Get object by ID. operationId: /command/getObject parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Returns the configuration JSON for the specified device, including its name, group, state and settings. tags: - Commands /command/getObjects: get: summary: Get the configuration of all devices operationId: /command/getObjects produces: - application/json responses: "200": description: Returns JSON describing every configured device on the system (cameras and microphones) including id, name, group and current state. tags: - Commands /command/getProfiles: get: summary: List the configured profiles operationId: /command/getProfiles produces: - application/json responses: "200": description: 'Returns the configured profiles as {"profiles":[...]}. Use the index with setProfile, armProfile or disarmProfile.' tags: - Commands /command/getStatus: get: summary: Get the server status operationId: /command/getStatus produces: - application/json responses: "200": description: 'Returns server status JSON: armed state, device count, active device count, number of devices recording, remote access status, unique server ID, machine name, version and server timestamp. v8.2.1.0+ also alertsUnread (unread alerts, as the web UI badges them) and lastAlertId (id of the newest alert; a higher value means a new alert) - both -1 until the server has loaded them; devicesInError (devices switched on but failing to connect) and updateVersion (the newer Agent version available, or empty when up to date).' tags: - Commands /command/getSystemStats: get: summary: Return the system usage stats operationId: /command/getsystemstats produces: - application/json responses: "200": description: 'Returns CPU, memory and disk usage for the server: cpu_used, ram_free and disk_free strings plus numeric cpup, ramp, ramu, diskp and per-disk stats in disks.' tags: - Commands /command/lpron: get: summary: Turn LPR on operationId: /command/lprOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn lpr on for the device. tags: - Commands /command/lproff: get: summary: Turn lpr off operationId: /command/lprOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn lpr off for the device. tags: - Commands /command/setalertmode: get: summary: Set what raises an alert on a device (the Alert Mode on the Alerts tab) operationId: /command/setalertmode parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: detected (every detection raises an alert), notdetected (an alert when detection stops) or actionsonly (only an action with a Trigger Alert task raises one) enum: - detected - notdetected - actionsonly in: query name: mode required: true type: string produces: - application/json responses: "200": description: 'Returns {"status":"ok","mode":"...","alert_actions":[{event,tags,assistant_rule}]} - the actions that raise an alert now; an action with no tags fires on any object. v8.0.9.0+' tags: - Commands /command/setdetector: get: summary: Switch a camera's motion detector on with a working type operationId: /command/setdetector parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 2 in: query name: ot required: true type: integer - description: Detector type. Omitted = Simple when the camera has none, otherwise the type it already has. enum: - None - Simple - TripWires - Speed - Tracking - people - objects - onvif - mqtt - reolink - hikvision in: query name: type required: false type: string produces: - application/json responses: "200": description: 'Returns {"status":"ok","motion_detector":{"on":true,"type":"Simple"}}. Object detection in its detected mode only runs when this detector fires. v8.0.9.0+' tags: - Commands /command/setaimode: get: summary: Set when an AI feature runs on a camera (the Mode on its tab) operationId: /command/setaimode parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 2 in: query name: ot required: true type: integer - description: Which feature enum: - object - face - lpr - askai in: query name: ai required: true type: string - description: detected (each time the motion detector fires), alert (each time the camera alerts), interval (on a timer) or none (only when an action triggers it) enum: - detected - alert - interval - none in: query name: mode required: true type: string produces: - application/json responses: "200": description: 'Returns {"status":"ok","ai":"object","mode":"detected"}. v8.0.9.0+' tags: - Commands /command/setconfidence: get: summary: Set the minimum confidence for an AI feature on a camera (the Confidence slider on its tab) operationId: /command/setconfidence parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 2 in: query name: ot required: true type: integer - description: Which feature enum: - object - face - lpr in: query name: type required: true type: string - description: Minimum confidence, 0-100 (lower = more results) in: query name: confidence required: true type: integer minimum: 0 maximum: 100 produces: - application/json responses: "200": description: 'Returns {"status":"ok","type":"object","from":60,"to":40}. v8.1.1.0+' tags: - Commands /command/say: get: summary: Speak text through a camera's speaker now operationId: /command/say parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 2 in: query name: ot required: true type: integer - description: What to say (up to 500 characters) in: query name: text required: true type: string - description: Voice name; empty = the server's default voice in: query name: voice required: false type: string produces: - application/json responses: "200": description: 'Returns {"status":"ok","said":"..."}. Needs a camera with talk set up and a connected ispyconnect.com account for speech. v8.0.9.0+' tags: - Commands /command/playsound: get: summary: Play one of the server's sound files through a camera's speaker now operationId: /command/playsound parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 2 in: query name: ot required: true type: integer - description: File name from the server's sounds folder in: query name: file required: true type: string produces: - application/json responses: "200": description: 'Returns {"status":"ok","played":"..."} or an error listing the available files. Needs a camera with talk set up. v8.0.9.0+' tags: - Commands /command/setname: get: summary: Rename a device operationId: /command/setname parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: New name (up to 100 characters) in: query name: name required: true type: string produces: - application/json responses: "200": description: 'Returns {"status":"ok","name":"...","was":"..."}. v8.0.9.0+' tags: - Commands /command/setlocation: get: summary: Put a device in a location operationId: /command/setlocation parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Location name or index. Locations are created in Server Settings. in: query name: location required: true type: string produces: - application/json responses: "200": description: 'Returns {"status":"ok","location":{"index","name"}} or an error listing the locations. v8.0.9.0+' tags: - Commands /command/setgroups: get: summary: Add a device to groups, remove it from groups, or replace its groups operationId: /command/setgroups parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Comma separated group names to add the device to. A group exists as soon as one device is in it. in: query name: add required: false type: string - description: Comma separated group names to take the device out of. in: query name: remove required: false type: string - description: Comma separated group names that replace the device's whole list. Empty clears it. Applied before add and remove. in: query name: groups required: false type: string produces: - application/json responses: "200": description: 'Returns {"status":"ok","groups":[...]} with the device''s resulting groups. A camera''s paired microphone is given the same groups. Groups also control which devices a restricted user account can see. v8.0.7.0+' tags: - Commands /command/objectdetecton: get: summary: Turn object recognition on operationId: /command/objectDetectOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn object recognition on for the device. tags: - Commands /command/objectdetectoff: get: summary: Turn object recognition off operationId: /command/objectDetectOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn object recognition off for the device. tags: - Commands /command/ping: get: summary: Check the server is running operationId: /command/ping produces: - application/json responses: "200": description: 'Returns {"status":"ok"} if the server is running. Use as a lightweight health check.' tags: - Commands /command/ptzpresets: get: summary: List the camera PTZ presets (7.7.8.0+) operationId: /command/ptzpresets parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID (cameras only) enum: - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Returns the camera's PTZ presets as {"presets":[{"name":...,"token":...}],"active":...}. "active" is the last preset Agent applied, or null if the camera has moved since or none was applied. (v7.7.8.0+) tags: - Commands /command/getptzpreset: get: summary: Get the active PTZ preset (7.7.8.0+) operationId: /command/getptzpreset parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID (cameras only) enum: - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Returns {"preset":"Home"} - the last preset Agent applied to the camera, or null if the camera has moved since (or the camera was moved outside of Agent). (v7.7.8.0+) tags: - Commands /command/ptzpreset: get: summary: Move the camera to a PTZ preset by name (7.7.8.0+) operationId: /command/ptzpreset parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID (cameras only) enum: - 2 in: query name: ot required: true type: integer - description: Preset name or token (from ptzpresets) in: query name: preset required: true type: string produces: - application/json responses: "200": description: Applies the named preset. Returns an error if no preset matches (v7.7.8.0+; older versions returned ok regardless). tags: - Commands /command/ptzscheduleon: get: summary: enable the ptz scheduler or enable a specific ptz schedule entry (5.9.4.0+) operationId: /command/ptzscheduleon parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Identifier of the PTZ Schedule entry (from the copy button on the PTZ Schedule list in the UI) in: query name: ident required: false type: string produces: - application/json responses: "200": description: Enables the PTZ Scheduler or a specific entry tags: - Commands /command/ptzscheduleoff: get: summary: disable the ptz scheduler or disable a specific ptz schedule entry (5.9.4.0+) operationId: /command/ptzscheduleoff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Identifier of the PTZ Schedule entry (from the copy button on the PTZ Schedule list in the UI) in: query name: ident required: false type: string produces: - application/json responses: "200": description: Disables the PTZ Scheduler or a specific entry tags: - Commands /command/record: get: summary: Start recording for the device. operationId: /command/record parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Optional tag to store with the recording (csv) in: query name: tag required: false type: string produces: - application/json responses: "200": description: Starts recording on the device. Recording continues until recordStop is called or the maximum recording duration is reached. tags: - Commands /command/recordRestart: get: summary: Restart recording for the device. operationId: /command/recordRestart parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Restarted recording for the device. tags: - Commands /command/setAIFind: get: summary: "Set the object list you want the AI model to look for, for example: person,car" operationId: /command/setAIFind parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Comma separated labels that replace the whole Find list. Not validated. Either this or add. in: query name: objects required: false type: string - description: Comma separated labels to add to the existing Find list, e.g. dog,cat. Labels the camera's AI model does not know are rejected. v8.0.7.0+ in: query name: add required: false type: string produces: - application/json responses: "200": description: 'With objects: {"status":"ok"}. With add: {"status":"ok"|"partial","find":[...],"rejected":[...]}.' tags: - Commands /command/setAIModel: get: summary: "Set the AI model to use for object recognition. Models are used in the endpoints for the AI server. To use the default (/v1/vision/detection) pass in the name default. Otherwise the model url will use the format /v1/vision/custom/name" operationId: /command/setAIModel parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Model Name in: query name: name required: true type: string produces: - application/json responses: "200": description: Set the AI model for the device. tags: - Commands /command/setInterval: get: summary: "Set the interval for the specified field" operationId: /command/setInterval parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: "Setting to modify. Options are: Cameras: alerts, scene, detector, face, ftp, object, askai, photos. Microphones: detector, alerts" in: query name: type required: true type: string - description: New value in: query name: value required: true type: integer produces: - application/json responses: "200": description: Set the specified interval on the device. tags: - Commands /command/setSensitivity: get: summary: Set the motion detector sensitivity on the selected device operationId: /command/setSensitivity parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Minimum (0-100) in: query name: min required: false type: integer - description: Maximum (0-100) in: query name: max required: false type: integer - description: Gain Multiplier (0-100) in: query name: gain required: false type: integer - description: 'Simpler form, v8.0.9.0+: with level, what says which detector - motion or objects for a camera, sound for a microphone (min/max/gain are then ignored)' enum: - motion - objects - sound in: query name: what required: false type: string - description: 'v8.0.9.0+: a level 1-100 (higher = more alerts), or low/medium/high (25/50/75), or lower/higher (15 below or above the current level). motion maps to the detector''s own threshold (minsensitivity for Simple/TripWires/Speed/Tracking, person confidence for people, hikvisionSensitivity for hikvision - a new camera is at 80); objects = object detection minimum confidence (level = 100 - confidence). Cameras with an onvif, reolink or mqtt detector return an error because the sensitivity is set on the camera.' in: query name: level required: false type: string produces: - application/json responses: "200": description: 'Set the sensitivity for the device. With level: {"status":"ok","what","level","changed":"","from","to"}' tags: - Commands /command/setObjectState: get: summary: Set the run state of a device (ZoneMinder-style function) operationId: /command/setObjectState parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: "State: None = disabled, Monitor = enabled with no motion detection, Modect = enabled with record on detect, Redect = enabled with forced recording and motion detection, Record = enabled with forced recording and no motion detection. Values are case insensitive." enum: - None - Monitor - Modect - Redect - Record in: query name: state required: true type: string produces: - application/json responses: "200": description: Sets the device state. The current state is returned as the "function" field by getObject/getObjects. tags: - Commands /command/soundon: get: summary: Turn sound recognition on operationId: /command/soundOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn sound recognition on for the device. tags: - Commands /command/soundoff: get: summary: Turn sound recognition off operationId: /command/soundOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn sound recognition off for the device. tags: - Commands /command/settimestamp: get: summary: Change the timestamp display on the camera operationId: /command/settimestamp parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Timestamp formatter, e.g. {FPS} {0:G} {NAME} in: query name: text required: true type: string produces: - application/json responses: "200": description: Replaces the camera's timestamp formatter and clears any text previously added with appendtimestamp. The change is saved to the camera's settings. tags: - Commands /command/setUri: get: summary: Change the stream URLs of a camera operationId: /command/setUri parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID (cameras only) enum: - 2 in: query name: ot required: true type: integer - description: URL for the live (sub) stream in: query name: live required: false type: string - description: URL for the record (main) stream in: query name: record required: false type: string produces: - application/json responses: "200": description: Updates the camera's stream URLs. The camera restarts if a URL changed. tags: - Commands /command/start-rtmp: get: summary: Start RTMP streaming a device operationId: /command/start-rtmp parameters: - description: Identifier of the RTMP server (shown in the RTMP servers list in server settings) in: query name: ident required: true type: string - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Starts streaming the device to the RTMP server tags: - Commands /command/start-rtmp-view: get: summary: Start RTMP streaming a configured view operationId: /command/start-rtmp-view parameters: - description: Identifier of the RTMP server (shown in the RTMP servers list in server settings) in: query name: ident required: true type: string - description: View index in: query name: ind required: true type: integer produces: - application/json responses: "200": description: Starts streaming the view to the RTMP server tags: - Commands /command/stop-rtmp: get: summary: Stop RTMP streaming a device operationId: /command/stop-rtmp parameters: - description: Identifier of the RTMP server (shown in the RTMP servers list in server settings) in: query name: ident required: true type: string produces: - application/json responses: "200": description: Stops streaming to the RTMP server tags: - Commands /q/tagrecording: get: summary: Tag a previous or current recording. Omit fn parameter to tag current recording. operationId: /command/tagrecording parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Text in: query name: tag required: true type: string - description: Filename (2021-01-19_12-22-55_125.jpg) in: query name: fn required: false type: string produces: - application/json responses: "200": description: Tag the current live recording (v5.0.3.0+). Can also tag a previous recording by providing a filename (v6.2.8.0+) tags: - Commands /q/untagrecording: get: summary: Remove a tag from a recording operationId: /command/untagrecording parameters: - description: Text in: query name: tag required: true type: string - description: Filename (2021-01-19_12-22-55_125.jpg) in: query name: fn required: true type: string produces: - application/json responses: "200": description: Remove the tag from the specified recording (v6.2.8.0+) tags: - Commands /command/triggerLPR: get: summary: Trigger LPR recognition for the device. operationId: /command/triggerLPR parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Trigger LPR recognition for the device. tags: - Commands /command/triggerFace: get: summary: Trigger facial recognition for the device. operationId: /command/triggerFace parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Trigger facial recognition for the device. tags: - Commands /command/triggerObject: get: summary: Trigger object recognition for the device operationId: /command/triggerObject parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Trigger object recognition for the device. tags: - Commands /command/triggerAskAI: get: summary: Trigger ask AI for the device operationId: /command/triggerAskAI parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Trigger ask AI for the device. tags: - Commands /command/triggerTask: get: summary: Trigger a task on the device operationId: /command/triggerTask parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Task in: query name: task required: true type: string produces: - application/json responses: "200": description: Trigger a task on the device tags: - Commands /command/pluginCommand: get: summary: Send a command to the plugin configured on a device description: "Calls Command(string) on the plugin attached to the device (set under the Plugins tab when editing the device). The command string is defined by the plugin - see the plugin's documentation. The plugin returns JSON; by convention 'msg' is a human readable result and any other fields are plugin specific. Errors: DeviceNotFound (bad oid/ot), DeviceDisabled (device switched off), FeatureNotConfigured (no plugin on the device), CommandFailed (plugin did not recognise the command or does not implement Command)." operationId: /command/pluginCommand parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Plugin-defined command string, e.g. reset, status, volume:75 in: query name: command required: true type: string produces: - application/json responses: "200": description: JSON returned by the plugin, e.g. {"msg":"Volume set to 75"} tags: - Commands /q/getTasks: get: summary: Returns the list of tasks defined on the device operationId: /q/getTasks parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: 'Returns {"elements":[{"text":"Task name","value":"Task name"},...]} listing the tasks defined on the device. Run a task with /command/triggerTask.' tags: - Commands /q/taskAdd: get: summary: Add a task to the device operationId: /q/taskAdd parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Task name in: query name: name required: true type: string produces: - application/json responses: "200": description: Add a task with the specified name to the device. Configure what the task does by adding actions to it (Actions with the mode set to the task name). Run it with /command/triggerTask. tags: - Commands /q/taskDelete: get: summary: Remove a task from the device operationId: /q/taskDelete parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Task name in: query name: value required: true type: string produces: - application/json responses: "200": description: Remove the task with the specified name from the device tags: - Commands /q/createrule: post: summary: Create an assistant rule - a plain-language rule such as "tell me if a red car turns up in the next 6 hours" operationId: /q/createrule consumes: - application/json parameters: - in: body name: body required: true schema: $ref: '#/definitions/RuleRequest' produces: - application/json responses: "200": description: 'Compiles the rule into ordinary actions (and schedule entries for a weekly window) on each device; they appear in the device''s Actions list marked as a rule and can be deleted there. Returns {"rule":{...},"warnings":[...]}, or {"error":"...","problems":[...]} when the rule could never work - every problem at once, each with its fix (detector off, label not in the Find list, schedule off for a window, no AI provider, no enrolled face of that name, camera has no talk channel, no such PTZ preset or sound file, no connected account for speech). This is the endpoint behind the MCP create_rule tool. v8.0.7.0+' schema: $ref: '#/definitions/RuleResponse' tags: - Assistant rules /q/getruleoptions: get: summary: What an assistant rule can be made of on this server operationId: /q/getruleoptions parameters: - description: Comma separated device names or ot:oid ids. Empty = every enabled device in: query name: devices required: false type: string produces: - application/json responses: "200": description: 'Live description for building rules: server {local_time, day, timezone, armed (the setting, as getStatus reports it), arming_in_seconds (exit delay left after arming; alerts are held back until it is 0), account_connected, profiles, sounds, faces}; devices [{id, name, kind, events, alerts_on, motion_detector_on, schedule_on, email_on, object_detection {on, finds, can_find}, face_recognition_on, plate_recognition_on, ai_questions_available, talk, ptz, record_mode, sound_recognition}]; tasks [{type, does, needs, params [{name, kind, required, note}]}]; unsupported [{request, instead}]. This is the endpoint behind the MCP describe_rule_options tool. v8.0.7.0+' tags: - Assistant rules /q/listrules: get: summary: Returns the assistant rules on this server operationId: /q/listrules produces: - application/json responses: "200": description: Returns every assistant rule with its instruction, summary, devices, what/when/then, whether it is active and how often it has run. Actions made by hand in the UI are not listed. v8.0.7.0+ schema: $ref: '#/definitions/RulesResponse' tags: - Assistant rules /q/getrule: get: summary: Returns one assistant rule operationId: /q/getrule parameters: - description: Rule ident, from createrule or listrules in: query name: ident required: true type: string produces: - application/json responses: "200": description: Returns {"rule":{...}} or {"error":"Rule not found"}. v8.0.7.0+ schema: $ref: '#/definitions/RuleResponse' tags: - Assistant rules /q/deleterule: get: summary: Delete an assistant rule operationId: /q/deleterule parameters: - description: Rule ident, from createrule or listrules in: query name: ident required: true type: string produces: - application/json responses: "200": description: Deletes the rule and everything it created (its actions and schedule entries). Returns {"actionResult":"ok","success":true} or {"error":"Rule not found"}. v8.0.7.0+ tags: - Assistant rules /q/pauserule: get: summary: Pause an assistant rule operationId: /q/pauserule parameters: - description: Rule ident, from createrule or listrules in: query name: ident required: true type: string produces: - application/json responses: "200": description: Disables the rule's actions; it stays listed but never fires. Returns the rule. v8.0.7.0+ schema: $ref: '#/definitions/RuleResponse' tags: - Assistant rules /q/resumerule: get: summary: Resume a paused assistant rule operationId: /q/resumerule parameters: - description: Rule ident, from createrule or listrules in: query name: ident required: true type: string produces: - application/json responses: "200": description: Re-enables the rule and resets its run count, so a rule that stopped at maxruns fires again. Returns the rule. v8.0.7.0+ schema: $ref: '#/definitions/RuleResponse' tags: - Assistant rules /q/analyticssources: get: summary: Lists everything that has analytics data - cameras, zones and trip wires operationId: /q/analyticssources produces: - application/json responses: "200": description: 'Returns {"sources":[{id, kind (camera, zone or line), key (its permanent key within the camera, e.g. w3 for a line - what an occupancy counter refers to a line by), number (zone or trip wire number), name (the name given to the zone or trip wire, if any), camera (camera name), cameraIdent (the camera''s permanent analytics id), location, groups (comma separated), current, oid, first, last}]}. Use the id values as sources for analyticstotals and analyticsvisits. current is false for history from a camera, zone or trip wire that is no longer in the configuration; oid is the camera''s object id when it still exists. first and last are Unix milliseconds, UTC. Analytics counts people and vehicles with the built-in AI and needs a subscription. v8.1.1.0+' tags: - Analytics /q/analyticstotals: get: summary: Analytics totals over time for one or more sources operationId: /q/analyticstotals parameters: - description: Comma separated source ids from analyticssources (up to 2000) in: query name: sources required: true type: string - description: Start of the range, Unix milliseconds UTC. Default 24 hours before to in: query name: from required: false type: integer - description: End of the range, Unix milliseconds UTC. Default now in: query name: to required: false type: integer - description: 'Size of each total. hour (default; up to two months per request), day (up to three years) or 15m (worked out from the individual records, so only within the retention period and up to two days per request)' enum: - hour - day - 15m in: query name: step required: false type: string - description: Minutes east of UTC, deciding where a day starts when step is day. Default the server's time zone in: query name: tz required: false type: integer - description: 'Only this metric. Camera: objects (objects seen, by when they appeared), objectseconds (seconds in view), objectsmax (highest number on the camera at once - per class, and for all classes together in the series whose label is empty). Zone: zoneentries, zoneseconds, zonemaxcount (highest count at once), zonequeue (highest number waiting at once: as zonemaxcount, but counting only objects that had been in the zone for 5 seconds or more, so people walking through are left out - the length of a queue). Trip wire: lineright (crossings in the direction of the arrow drawn on the wire, shown as Inward), lineleft (the other way, shown as Outward), linetailgating (crossings that followed another object across, the same way, within a second; also counted in their direction). Default every metric' in: query name: metric required: false type: string - description: Only this object class, e.g. person or car. Default every class in: query name: label required: false type: string produces: - application/json responses: "200": description: 'Returns {"step", "from", "to", "tz", "queue", "series":[{"source": id, "label": class, "metric": name, "points":[[time, value],...]}]}. Each point is the start of a step (Unix milliseconds, UTC) and its total; steps with nothing in them are left out. Counts and seconds add up across a day; zonemaxcount, zonequeue and objectsmax take the day''s highest. queue is the number of seconds an object has to have been in a zone to count towards zonequeue. A visit to a zone is counted in zoneentries when it begins and its time in zoneseconds when it ends, so zoneseconds / zoneentries is the average dwell only once the zone is empty; while objects are still in it, leave them out of the visits (analyticslive says how many there are). from is moved later if the range is longer than the step allows. v8.1.1.0+' tags: - Analytics /q/analyticsvisits: get: summary: The individual analytics records behind the totals for one source operationId: /q/analyticsvisits parameters: - description: Source id from analyticssources in: query name: source required: true type: integer - description: Start of the range, Unix milliseconds UTC. Default 24 hours before to in: query name: from required: false type: integer - description: End of the range, Unix milliseconds UTC. Default now in: query name: to required: false type: integer - description: Maximum rows to return, 1 to 10000. Default 1000 in: query name: limit required: false type: integer produces: - application/json responses: "200": description: 'Depends on the kind of source. Camera: {"kind":"objects","rows":[{object, label, start, end}]}. Zone: {"kind":"zonevisits","rows":[{object, label, enter, seconds, from (source id of the zone it came from, 0 = none)}]}. Trip wire: {"kind":"linecrossings","rows":[{object, label, time, direction (left or right; right is the direction of the arrow drawn on the wire), tailgating}]}. Times are Unix milliseconds, UTC. Individual records are kept for the retention period set in the analytics settings (90 days by default); totals are kept permanently. v8.1.1.0+' tags: - Analytics /q/analyticsflow: get: summary: How objects moved between zones operationId: /q/analyticsflow parameters: - description: Comma separated zone source ids from analyticssources (up to 2000) in: query name: sources required: true type: string - description: Start of the range, Unix milliseconds UTC. Default 24 hours before to in: query name: from required: false type: integer - description: End of the range, Unix milliseconds UTC. Default now in: query name: to required: false type: integer - description: Only this object class, e.g. person. Default every class in: query name: label required: false type: string produces: - application/json responses: "200": description: 'Returns {"from", "to", "flows":[{"from": source id of the zone the objects came from (0 = from outside every zone, or they had just appeared), "to": source id of the zone they entered, "count"}]}, most frequent first. Counts stays in the entered zone that began in the range. Worked out from the individual zone visits, so only within the retention period. v8.1.1.0+' tags: - Analytics /q/analyticsheat: get: summary: Heatmap of where objects stood on one camera operationId: /q/analyticsheat parameters: - description: Camera source id from analyticssources in: query name: source required: true type: integer - description: Start of the range, Unix milliseconds UTC. Default 24 hours before to in: query name: from required: false type: integer - description: End of the range, Unix milliseconds UTC. Default now in: query name: to required: false type: integer - description: Only this object class, e.g. person. Default every class in: query name: label required: false type: string produces: - application/json responses: "200": description: 'Returns {"cols", "rows", "cells":[[index, seconds],...], "max", "seconds"}. The picture is divided into cols x rows cells; index = row * cols + column, and seconds is how long objects stood with their foot point (bottom centre of the detection) in that cell. Empty cells are left out. max is the highest cell, seconds the total. Stored by the hour, so from and to are widened to whole hours; kept for the retention period. v8.1.1.0+' tags: - Analytics /q/analyticslive: get: summary: Who is in view right now on each camera with analytics enabled operationId: /q/analyticslive produces: - application/json responses: "200": description: 'Returns {"time", "cameras":[{"oid", "cameraIdent", "running", "total", "zones":[{"zone" (zone number; 0 = no zones drawn, the whole view), "count", "labels":{class: count}}]}]}. Only zones with something in them are listed. Taken from the running counters, not the database. Also "counters":[{"id", "count", "in", "out"}] - each occupancy counter''s count now, and how many have come in and gone out since its reset. And "layout": a number that changes whenever a camera''s zones, counting lines, their names or its overlay setting change (fetch analyticscounters again when it does); only meaningful as same / different, and only until Agent restarts. And "model": the detection model''s file - "ok", "downloading" (it is fetched the first time a camera runs analytics; nothing is counted until then) or "failed" (tried again after ten minutes). v8.1.1.0+' tags: - Analytics /q/analyticscounters: get: summary: The occupancy counters - people in a space, counted from the lines at its ways in and out operationId: /q/analyticscounters produces: - application/json responses: "200": description: 'Returns {"rev", "counters":[{"id", "name", "labels" (count only these classes; none = all), "lines":[{"camera" (cameraIdent), "line" (the line''s "key" in analyticssources), "in" ("right" = crossing the way the arrow on the line points, Inward, is coming in; "left" = the other way is)}], "reset" (HH:mm, local: the count goes back to nothing), "capacity" (0 = none), "opentext", "fulltext", "rules":[{"id", "when" ("atleast" or "atmost"), "value", "hold" (seconds), "url"}]}], "classes" (the classes a counter can be limited to), "lines":[{"camera", "cameraName", "line", "number", "name", "x", "y", "x2", "y2"}] (every counting line the cameras have now; end points as percentages of the picture, in the order drawn - the inward direction is to the right of first-to-second), "cameras":[{"camera", "cameraName", "oid" (the camera''s object id), "classes" (what the camera counts - its own Objects setting - which is all a counter or an alert on it can be limited to), "zonemap" (64 x 48 cells, column by column: column x, row y is character x * 48 + y; one digit each, 0 = no zone, 1-9 = that zone; empty = none drawn), "zones":[{"number", "name"}]}]}. A counter adds one for a crossing in its "in" direction on any of its lines and takes one away for a crossing the other way, never going below nothing - so several cameras (one entrance, three exits) make one count. A rule calls its URL (GET) once when the count has been at or above / at or below its value for hold seconds, and again only after that has stopped being true; {count}, {capacity}, {free} and {name} in the URL are filled in. The running counts are in analyticslive. v8.1.1.0+' tags: - Analytics /q/analyticscounterhistory: get: summary: An occupancy counter's count over time operationId: /q/analyticscounterhistory parameters: - name: id in: query description: The counter's id (from analyticscounters) required: true type: string - name: from in: query description: Start of the range, Unix milliseconds UTC (default 24 hours before to) type: integer - name: to in: query description: End of the range, Unix milliseconds UTC (default now) type: integer produces: - application/json responses: "200": description: 'Returns {"id", "bucket" (300000: the length of a piece in ms), "from", "to", "start" (the count going into the range), "points":[[time, peak, value],...]}. One point per five minutes in which the count changed: the highest it was changed to in them, and what it was at the end. Nothing is written while the count stays the same, so carry the last value forward over the gaps. Kept for the retention period. v8.1.1.0+' tags: - Analytics /q/analyticspaths: get: summary: The paths objects took across a camera's picture operationId: /q/analyticspaths parameters: - name: source in: query description: A camera's source id (from analyticssources) required: true type: integer - name: from in: query description: Start of the range, Unix milliseconds UTC (default 24 hours before to) type: integer - name: to in: query description: End of the range, Unix milliseconds UTC (default now) type: integer - name: label in: query description: Only this class of object (default all) type: string - name: limit in: query description: The most paths to return, newest first (default 300, at most 2000) type: integer produces: - application/json responses: "200": description: 'Returns {"paths":[{"label", "start", "end", "points":[x, y, x, y, ...]}]}. Each path is where one object went while it was in view, thinned to a few dozen points; x and y are 0-255, as fractions of the picture''s width and height. Objects that hardly moved have none. Kept for the retention period. v8.1.1.0+' tags: - Analytics /q/analyticsspeed: get: summary: The speeds timed by a speed measurement (two counting lines a known distance apart) operationId: /q/analyticsspeed parameters: - name: id in: query description: The measurement's id (analyticscounters lists them under "traps") required: true type: string - name: from in: query description: Start of the range, Unix milliseconds UTC (default 24 hours before to) type: integer - name: to in: query description: End of the range, Unix milliseconds UTC (default now) type: integer - name: label in: query description: Only this class of object (default all) type: string produces: - application/json responses: "200": description: 'Returns {"id", "rows":[[time, speed, direction],...]}: one row per object that crossed both of the measurement''s lines, in time order (at most 50000). speed is metres a second - the distance between the lines over the time between the crossings; direction is 1 for first line to second, 0 for the other way. A measurement is {"id", "name", "camera", "first", "second" (line keys), "distance" (metres)} in the "traps" list of analyticscounters, saved with the counters; "speedunit" there ("kmh" or "mph") is what the web interface shows speeds in. Kept for the retention period. v8.1.1.0+' tags: - Analytics /q/analyticsdwell: get: summary: How long objects stayed on camera, in bands operationId: /q/analyticsdwell parameters: - name: sources in: query description: Comma separated camera source ids (from analyticssources) required: true type: string - name: from in: query description: Start of the range, Unix milliseconds UTC (default 24 hours before to) type: integer - name: to in: query description: End of the range, Unix milliseconds UTC (default now) type: integer - name: label in: query description: Only this class of object (default all) type: string produces: - application/json responses: "200": description: 'Returns {"edges":[10,30,60,120,300,900], "counts":[n x 7]}. counts[i] is how many objects that appeared in the range stayed in view for under edges[i] seconds (and at least edges[i-1]); the last count is everything longer than the last edge. From the individual visits, so within the retention period. v8.1.1.0+' tags: - Analytics /q/analyticszonedwell: get: summary: How long visits to zones lasted - their spread, average and median operationId: /q/analyticszonedwell parameters: - name: sources in: query description: Zone source ids (from analyticssources), comma separated required: true type: string - name: from in: query description: Start of the range, Unix milliseconds required: false type: integer - name: to in: query description: End of the range, Unix milliseconds required: false type: integer - name: label in: query description: Only this class of object (person, car...) required: false type: string produces: - application/json responses: "200": description: 'Returns {"edges":[10,30,60,120,300,900], "zones":[{"source", "visits", "average", "median", "counts":[n x 7]}]}. For each zone asked for: its visits that began in the range and have ended, their average and median length in seconds, and how many fell in each band - counts[i] = under edges[i] seconds and at least edges[i-1]; the last is everything longer. From the individual visits, so within the retention period. v8.1.1.0+' tags: - Analytics /q/analyticscounterset: get: summary: Set an occupancy counter's count by hand operationId: /q/analyticscounterset parameters: - name: id in: query description: The counter's id (from analyticscounters) required: true type: string - name: value in: query description: The count to set required: true type: integer produces: - application/json responses: "200": description: 'Returns {"id", "count"}, or {"error":"unknown counter"}. v8.1.1.0+' tags: - Analytics /q/analyticsreportsend: get: summary: Email a dashboard's figures now operationId: /q/analyticsreportsend parameters: - name: id in: query description: The dashboard's id (from analyticsdashboards) required: true type: string - name: every in: query description: 'The period to cover: daily (yesterday) or weekly (the last Monday to Sunday). Default the dashboard''s own schedule, or daily' required: false type: string enum: - daily - weekly produces: - application/json responses: "200": description: 'Sent through Agent''s mail settings to the addresses saved with the dashboard (its "email" "to"); the API cannot name others. The email holds the figures of the dashboard''s reports; a heatmap or paths is a picture in the body, drawn over the camera''s reference image (see analyticsreference); the kinds about this moment (live view, in zone now) are left out. A dashboard with "email":{"every":"daily"|"weekly","to":".."} is sent by itself just after midnight (weekly: on Monday). Returns {"sent":true,"to"}, or {"error":"unknown dashboard"} / {"error":"no address"} / {"error":"not sent","to": the addresses it could not be sent to}. v8.1.1.0+' tags: - Analytics /q/analyticsreference: get: summary: A camera's reference image - what its heatmaps and paths are drawn over when there is no live picture operationId: /q/analyticsreference parameters: - name: ident in: query description: The camera's cameraIdent (from analyticssources) required: true type: string produces: - application/json responses: "200": description: 'Returns {"taken": Unix milliseconds (0 = the camera has none), "image": "data:image/jpeg;base64,..." ("" = none)}. One still of what the camera looks at, at most 960 pixels wide. Heatmaps and paths are drawn over it in emailed reports (sent when the scene may be dark or the camera off) and on the Analytics page for a camera that is offline or a period that is over. It is taken by itself from the first frame that isn''t dark after analytics is switched on for the camera, and again from the Update button in the camera''s analytics settings. v8.1.1.0+' tags: - Analytics /q/analyticsalerts: get: summary: Analytics' own alerts - rules over what analytics counts, and the alerts there have been operationId: /q/analyticsalerts produces: - application/json responses: "200": description: 'Returns {"rev", "alerts":[{"id", "name", "enabled", "type", "camera", "source", "counter", "direction", "when", "value", "hold", "cooldown", "from", "to", "labels", "actions"}], "log":[{"time" (ms), "id", "name", "text"}]}. "type" is zonecount (objects in a zone), queue (objects waiting in a zone), dwell (one object in a zone for more than "value" seconds), line (a line crossed; "direction" in / out / any, in = the way its arrow points), tailgating (a line crossed close behind another object), occupancy (an occupancy counter) or speed (a speed measurement; "value" in the unit speeds are shown in). A rule about a zone or line names its camera ("camera": cameraIdent) and the zone''s or line''s "key" from analyticssources ("source"); one about a counter or a speed measurement names its id ("counter"). "when" is atleast or atmost. zonecount, queue and occupancy run once when the condition has held for "hold" seconds and not again until it has stopped being true; the others run each time, at most once every "cooldown" seconds. "labels": only these classes (none = all). "from" and "to": the hours the alert is in force, "HH:mm" in the server''s local time ("to" may be the next morning; both "" = all day). "actions": {"type":"notify"} (a notification to admins in the web UI), {"type":"email","to"} and {"type":"url","url"} (a GET; {name}, {value}, {source} and {text} are filled in). "log" is the alerts there have been, newest first (the last 200). Nothing to do with the cameras'' alerts and actions. Saved with POST /savejson {"name":"saveanalyticsalerts","rev","alerts"} - the reply is the stored document, or {"error":"conflict", ...} if someone else saved first. v8.1.1.0+' tags: - Analytics /q/analyticsalerttest: get: summary: Do what an analytics alert says now, as a trial operationId: /q/analyticsalerttest parameters: - name: id in: query description: The alert's id (from analyticsalerts) required: true type: string produces: - application/json responses: "200": description: 'Sends the alert''s notification and emails and calls its URLs, marked as a test, and adds it to the log. Returns {"sent":true} or {"error":"unknown alert"}. To try an alert that is not stored (or not as it is stored), POST /savejson {"name":"testanalyticsalert","alert":{...}} - nothing is stored; {"sent":true} or {"error":"invalid"}. v8.1.1.0+' tags: - Analytics /q/analyticsalertadd: post: summary: Add one analytics alert to those there are operationId: /q/analyticsalertadd consumes: - application/json parameters: - in: body name: body required: true description: 'The alert as analyticsalerts gives it, without an id (one is made): {"name", "type", "camera", "source", "counter", "direction", "when", "value", "hold", "cooldown", "from", "to", "labels", "actions"}. A zone''s "source" is z (z1...), or all for a camera with no zones drawn; a line''s is its key from analyticscounters "lines".' schema: type: object produces: - application/json responses: "200": description: 'Returns {"rev", "alert": the alert as stored, with its id}, or {"error":"invalid"} (no name, not one of the types, or about nothing), {"error":"unknown counter"} (the occupancy counter or speed measurement it names is not there), {"error":"toomany"} (100 alerts) or {"error":"notsaved"}. The alerts already there are left as they are - for a caller that would rather not send the whole list back with its revision. v8.1.1.0+' tags: - Analytics /q/analyticscounteradd: post: summary: Add one occupancy counter to those there are operationId: /q/analyticscounteradd consumes: - application/json parameters: - in: body name: body required: true description: 'The counter as analyticscounters gives it, without an id (one is made): {"name", "lines":[{"camera", "line", "in"}], "labels", "capacity", "reset", "opentext", "fulltext", "rules"}. "camera" is the cameraIdent and "line" the line''s key, both from analyticscounters "lines"; "in" is right (crossing the way the line''s arrow points is coming in) or left.' schema: type: object produces: - application/json responses: "200": description: 'Returns {"rev", "counter": the counter as stored, with its id}, or {"error":"invalid"} (no name), {"error":"invalid lines"} (no lines, or one that is unusable or listed twice), {"error":"toomany"} (50 counters) or {"error":"notsaved"}. It starts at nothing; the counters already there keep their counts. v8.1.1.0+' tags: - Analytics /q/analyticsspeedadd: post: summary: Add one speed measurement to those there are operationId: /q/analyticsspeedadd consumes: - application/json parameters: - in: body name: body required: true description: 'The measurement as analyticscounters gives it under "traps", without an id (one is made): {"name", "camera", "first", "second", "distance"}. "camera" is the cameraIdent, "first" and "second" the keys of two different lines on it (from analyticscounters "lines"), "distance" how far apart they are on the ground in metres (0.1 to 10000).' schema: type: object produces: - application/json responses: "200": description: 'Returns {"rev", "trap": the measurement as stored, with its id}, or {"error":"invalid"} (no name or camera, the same line twice, or no usable distance), {"error":"toomany"} (50 measurements) or {"error":"notsaved"}. The counters and measurements already there are left as they are. v8.1.1.0+' tags: - Analytics /q/analyticscounterupdate: post: summary: Change one occupancy counter or speed measurement operationId: /q/analyticscounterupdate consumes: - application/json parameters: - in: body name: body required: true description: '{"id": the counter''s or the speed measurement''s id (from analyticscounters), ...only the fields that are to be different}, with the fields as analyticscounters gives them. Everything the body does not mention stays as it is stored. "lines", when given, is the whole new list for the counter.' schema: type: object produces: - application/json responses: "200": description: 'Returns {"rev", "counter"} or {"rev", "trap"} as stored, or {"error":"unknown counter"}, {"error":"invalid"} (what it would become is not usable), {"error":"invalid lines"} (a counter given no lines, or one that is unusable or listed twice) or {"error":"notsaved"}. A counter keeps its count; the others are left as they are. v8.1.1.0+' tags: - Analytics /q/analyticsalertupdate: post: summary: Change one analytics alert operationId: /q/analyticsalertupdate consumes: - application/json parameters: - in: body name: body required: true description: '{"id": the alert''s id (from analyticsalerts), ...only the fields that are to be different}, with the fields as analyticsalerts gives them - {"id","enabled":false} switches one off. Everything the body does not mention stays as it is stored. "actions" and "labels", when given, are the whole new lists.' schema: type: object produces: - application/json responses: "200": description: 'Returns {"rev", "alert": the alert as stored}, or {"error":"unknown alert"}, {"error":"invalid"} (what it would become is not usable), {"error":"unknown counter"} (the occupancy counter or speed measurement it would be about is not there) or {"error":"notsaved"}. The other alerts carry on as they were. v8.1.1.0+' tags: - Analytics /q/analyticscounterdelete: get: summary: Remove an occupancy counter or a speed measurement operationId: /q/analyticscounterdelete parameters: - name: id in: query description: The counter's or the speed measurement's id (from analyticscounters) required: true type: string produces: - application/json responses: "200": description: 'Returns {"rev", "id", "deleted": "counter" or "speed"}, or {"error":"unknown counter"} / {"error":"notsaved"}. The others keep their counts. What it counted or timed stays in the history; an alert about it is not removed, and never comes true again. v8.1.1.0+' tags: - Analytics /q/analyticsalertdelete: get: summary: Remove an analytics alert operationId: /q/analyticsalertdelete parameters: - name: id in: query description: The alert's id (from analyticsalerts) required: true type: string produces: - application/json responses: "200": description: 'Returns {"rev", "id", "deleted": true}, or {"error":"unknown alert"} / {"error":"notsaved"}. The other alerts carry on as they were; what it raised stays in the log. v8.1.1.0+' tags: - Analytics /q/analyticsclear: get: summary: Clear a camera's heatmap or paths operationId: /q/analyticsclear parameters: - name: source in: query description: The camera's source id (from analyticssources) required: true type: integer - name: what in: query description: 'heat (the heatmap) or paths (the paths objects took across the picture). Everything gathered for the camera so far is thrown away, for every dashboard and user, and it cannot be undone. Counts and visits are not touched' required: true type: string enum: - heat - paths produces: - application/json responses: "200": description: 'Returns {"cleared": rows removed}, or {"error":"unknown source"} / {"error":"unknown what"}. v8.1.1.0+' tags: - Analytics /q/analyticssales: get: summary: The sales figures set beside the visitors, for conversion operationId: /q/analyticssales produces: - application/json responses: "200": description: 'Returns {"rev", "sets":[{"id", "name", "unit" (its currency as written, e.g. £ or USD), "step" (day or hour: what each of its figures covers), "rows" (how many), "first", "last" (the first and last day or hour it has figures for)}]}. The figures themselves are in analyticssalesdata. Typed in or imported in the web interface (Analytics - Sales), or sent with analyticssalesadd. v8.1.1.0+' tags: - Analytics /q/analyticssalesdata: get: summary: One sales set's figures operationId: /q/analyticssalesdata parameters: - name: id in: query description: The set's id or name required: true type: string - name: from in: query description: The first day (YYYY-MM-DD) or hour (YYYY-MM-DDTHH), local - default from the start type: string - name: to in: query description: The last day or hour, included (a day takes in all its hours) - default to the end type: string produces: - application/json responses: "200": description: 'Returns {"id", "name", "unit", "step", "rows":[[day or hour, amount, transactions],...]} in time order; a figure that wasn''t given is null. Or {"error":"unknown sales"}. v8.1.1.0+' tags: - Analytics /q/analyticsconversion: get: summary: Visitors set against a set of sales figures operationId: /q/analyticsconversion parameters: - name: id in: query description: The sales set's id or name required: true type: string - name: sources in: query description: The source ids of the counting lines people come in by, comma separated (from analyticssources). Visitors are their crossings in the direction of their arrows (Inward) required: true type: string - name: from in: query description: Start of the range, Unix milliseconds UTC (default 24 hours before to) type: integer - name: to in: query description: End of the range, Unix milliseconds UTC (default now) type: integer - name: step in: query description: day or hour (default hour for two days or less, else day). Figures kept by the day are always by the day type: string - name: tz in: query description: Minutes east of UTC, for where a day starts (default the server's) type: integer - name: label in: query description: The class counted as visitors, e.g. person (default every class) type: string produces: - application/json responses: "200": description: 'Returns {"id", "name", "unit", "step", "from", "to", "tz", "whole" (its amounts are whole numbers), "visitors", "amount", "transactions" (null when none were given for the period), "perVisitor", "rate" (transactions over visitors: 0.25 = a quarter of them bought something), "points":[[ms, visitors, amount, transactions],...]}. The amount and the transactions are set against the visitors on the days there are figures for only - a day not filled in yet is not a day nobody bought anything. Or {"error":"unknown sales"}. v8.1.1.0+' tags: - Analytics /q/analyticssalesadd: post: summary: Add or change sales figures (a till system's daily takings, say) operationId: /q/analyticssalesadd consumes: - application/json parameters: - in: body name: body required: true description: '{"set": the set''s id or name, "rows":[{"date": "2026-10-14", "amount": 1234.5, "transactions": 87},...]}. date (or time) is YYYY-MM-DD, YYYY-MM-DD HH:mm, ISO 8601 (with a time zone it is turned into the server''s local time) or Unix milliseconds; a row may also be [date, amount, transactions]. Either figure may be left out; a row with neither deletes that day or hour. Rows for the same day or hour - or the hours of one day, in a set kept by the day - are added together, and replace what was there. A set named that doesn''t exist is made, kept by "step" (day or hour; default what the first row says) in "unit" (its currency).' schema: type: object produces: - application/json responses: "200": description: 'Returns {"rev", "id" (the set''s), "saved", "deleted", "skipped" (rows that were not usable: not a date, a day in a set kept by the hour, a figure that isn''t a number)}, or {"error":"invalid"} / {"error":"toomany"} (50 sets) / {"error":"notsaved"}. v8.1.1.0+' tags: - Analytics /q/analyticssalesdelete: get: summary: Delete a sales set and all its figures operationId: /q/analyticssalesdelete parameters: - name: id in: query description: The set's id or name required: true type: string produces: - application/json responses: "200": description: 'Returns {"rev", "id", "deleted": true}, or {"error":"unknown sales"} / {"error":"notsaved"}. It cannot be undone; a conversion report that used it has nothing to show. v8.1.1.0+' tags: - Analytics /q/analyticsdashboards: get: summary: The saved analytics dashboards (shared by everyone who can see analytics on this server) operationId: /q/analyticsdashboards produces: - application/json responses: "200": description: 'Returns {"rev", "dashboards":[{"id", "name", "ctx", "reports":[{"id", "type", "title", "ctx"}]}]}. A dashboard is a named set of reports. ctx is what it covers: {"location" ("l:" or "g:", empty = everywhere), "camera" (cameraIdent, empty = all), "range" (1h = the last hour, today, yesterday, week = Monday to now, 7, month = the 1st to now, 30, or custom with "from" / "to" as YYYY-MM-DD), "step" (auto, 15m, hour, day), "label", "compare" (0-3 periods before)}; a report''s own ctx holds its camera, when it is about one, and - when it has a period of its own instead of the dashboard''s - its "range" ("from" / "to" for a custom one), "step" and "compare". The class ("label") is always the dashboard''s. How a report is drawn: "chart" ("line" for lines instead of bars: lines, zones, queue, occupancyhistory, speed), "hours" ({"from","to"} whole hours, busy only: its opening hours) and "scale" ("log" for a logarithmic scale: heatmap only) - the email follows them too. type is one of count, zonenow, lines, zones, dwell, queue, busy, flow, heatmap, live, paths, occupancy, occupancyhistory, speed, conversion. A conversion report has "sales" (a sales set''s id, from analyticssales), "sources" (its counting lines) and "who" (the class counted as visitors; none = every class). Saved by the web interface with the current rev; a save carrying an older rev is refused. v8.1.1.0+' tags: - Analytics /command/triggerRecord: get: summary: Trigger recording for the device. Recording continues until Trigger Timeout is reached (on the recording tab of the device). Timeout is reset with each call. operationId: /command/triggerRecord parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Optional timeout in seconds. Overrides the device's configured Trigger Timeout for this call. in: query name: timeout required: false type: integer produces: - application/json responses: "200": description: Triggers temporary recording for the device, stopping when the timeout expires. tags: - Commands /command/recordStop: get: summary: Stop recording for the device. operationId: /command/recordStop parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Optional tag to store with the recording (csv) in: query name: tag required: false type: string produces: - application/json responses: "200": description: Stops the current recording on the device. tags: - Commands /command/recordingOff: get: summary: Turn recording off for the device. operationId: /command/recordingOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Sets the device's recording mode to manual - it will no longer record automatically on detection or alert, only when recording is started via the API or UI. tags: - Commands /command/recordConstant: get: summary: Set the recording mode to constant recording for the device. operationId: /command/recordConstant parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Set the recording mode to constant recording for the device. tags: - Commands /command/recordOnAlertOn: get: summary: Turn record on alert on for the device. operationId: /command/recordOnAlertOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn record on alert on for the device. tags: - Commands /command/recordOnDetectOn: get: summary: Turn record on detection on for the device. operationId: /command/recordOnDetectOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn record on detection on for the device. tags: - Commands /command/reloadConfig: get: summary: Reload the server configuration from disk operationId: /command/reloadConfig produces: - application/json responses: "200": description: Reloads the main configuration and the device list from disk and tells all connected clients to refresh. Use after editing the configuration files directly. tags: - Commands /command/reloadObjects: get: summary: Reload the device list operationId: /command/reloadObjects produces: - application/json responses: "200": description: Reloads the device list (cameras and microphones) from the configuration and tells all connected clients to refresh. tags: - Commands /command/resetTripWires: get: summary: Reset the trip wire crossing counters on a camera. operationId: /command/resetTripWires parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Zeroes the trip wire crossing counters. Does nothing unless the camera is running the Trip Wires detector. (v8.0.2.0+) tags: - Commands /command/restart: get: summary: Restart the Agent DVR service operationId: /command/restart produces: - application/json responses: "200": description: Shuts down and restarts the Agent DVR service. The API will be unavailable while it restarts. tags: - Commands /command/rtmpStop: get: summary: Stop RTMP streaming operationId: /command/rtmpStop parameters: - description: Identifier of the RTMP server (from getStreamingStatus). Omit to stop streaming to all RTMP servers. in: query name: ident required: false type: string produces: - application/json responses: "200": description: Stops streaming to the specified RTMP server, or to all RTMP servers if ident is omitted. tags: - Commands /command/runStorageMgmt: get: summary: Run storage management. operationId: /command/runStorageMgmt produces: - application/json responses: "200": description: Run storage management. tags: - Commands /command/saveLocalOff: get: summary: Turn save local off for the device. operationId: /command/saveLocalOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn save local off for the device. tags: - Commands /command/saveLocalOn: get: summary: Turn save local on for the device. operationId: /command/saveLocalOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn save local on for the device. tags: - Commands /command/scheduleOff: get: summary: Turn schedule off for a device, group or location. operationId: /command/scheduleOff parameters: - description: Object ID. Omit to target by group/location instead, or all devices if neither is given. in: query name: oid required: false type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: false type: integer - description: Target devices in these access groups (csv, case insensitive) in: query name: group required: false type: string - description: Target devices at this location (case insensitive) in: query name: location required: false type: string produces: - application/json responses: "200": description: Turns the schedule off. A device with its schedule off is left alone by the automatic scheduler and by applySchedule. tags: - Commands /command/scheduleOn: get: summary: Turn schedule on for a device, group or location. operationId: /command/scheduleOn parameters: - description: Object ID. Omit to target by group/location instead, or all devices if neither is given. in: query name: oid required: false type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: false type: integer - description: Target devices in these access groups (csv, case insensitive) in: query name: group required: false type: string - description: Target devices at this location (case insensitive) in: query name: location required: false type: string produces: - application/json responses: "200": description: Turn schedule on for the targeted devices. tags: - Commands /command/setProfile: get: summary: Apply the specified profile with an index. operationId: /command/setProfile parameters: - description: Index (0=Home, 1=Away, 2=Night) enum: - 0 - 1 - 2 in: query name: ind required: true type: integer produces: - application/json responses: "200": description: Apply the specified profile with an index. From v8.1.1.0 a profile also restores each camera's object detection confidence (profiles saved earlier leave it unchanged until re-saved). tags: - Commands /command/setProfileByName: get: summary: Apply the specified profile by name. operationId: /command/setProfileByName parameters: - description: Profile name (case insensitive) in: query name: name required: true type: string produces: - application/json responses: "200": description: Apply the specified profile by name. tags: - Commands /command/snapshot: get: summary: Take a photo on a camera operationId: /command/snapshot parameters: - description: Object ID in: query name: oid required: true type: integer produces: - application/json responses: "200": description: Takes a photo from the camera's live feed and saves it to the camera's grabs folder (available under Photos in the UI and via getCameraGrabs). tags: - Commands /command/stopCloudUploads: get: summary: Cancel all pending cloud uploads operationId: /command/stopCloudUploads produces: - application/json responses: "200": description: Cancels all queued and in-progress uploads to cloud storage providers. tags: - Commands /command/switchOff: get: summary: Switch off the device. operationId: /command/switchOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Switch off the device. tags: - Commands /command/switchOn: get: summary: Switch on the device. operationId: /command/switchOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Switch on the device. tags: - Commands /command/timelapseOn: get: summary: Turn timelapse on for the camera. operationId: /command/timelapseOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID (cameras only) enum: - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn timelapse on for the camera. tags: - Commands /command/timelapseOff: get: summary: Turn timelapse off for the camera. operationId: /command/timelapseOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID (cameras only) enum: - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn timelapse off for the camera. tags: - Commands /command/gpuEncodeOn: get: summary: Turn GPU encoding on for the camera. operationId: /command/gpuEncodeOn parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID (cameras only) enum: - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn GPU encoding on for the camera. tags: - Commands /command/gpuEncodeOff: get: summary: Turn GPU encoding off for the camera. operationId: /command/gpuEncodeOff parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID (cameras only) enum: - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Turn GPU encoding off for the camera. tags: - Commands /command/unblockExternal: get: summary: Unblock external access to the system. operationId: /command/unblockExternal produces: - application/json responses: "200": description: Unblock external access to the system. tags: - Commands /command/actionon: get: summary: Switches an action on operationId: /command/actionon parameters: - description: ID (from the Action configuration in the UI) in: query name: ID required: false type: string - description: Name (name of the action in the UI) - create multiple actions with the same name across devices to run groups of actions. in: query name: name required: false type: string produces: - application/json responses: "200": description: Switches an action on tags: - Commands /command/actionoff: get: summary: Switches an action off operationId: /command/actionoff parameters: - description: ID (from the Action configuration in the UI) in: query name: ID required: false type: string - description: Name (name of the action in the UI) - create multiple actions with the same name across devices to run groups of actions. in: query name: name required: false type: string produces: - application/json responses: "200": description: Switches an action off tags: - Commands /command/actionrun: get: summary: Executes an action (bypasses filtering) operationId: /command/actionrun parameters: - description: ID (from the Action configuration in the UI) in: query name: ID required: false type: string - description: Name (name of the action in the UI) - create multiple actions with the same name across devices to run groups of actions. in: query name: name required: false type: string produces: - application/json responses: "200": description: Executes an action tags: - Commands /command/addCamera: get: summary: Add an IP camera operationId: /command/addCamera parameters: - description: id of camera (optional - will modify if provided (5.1.3.0+)) in: query name: oid required: false type: integer - description: Object TypeID (=2 for camera) enum: - 1 - 2 in: query name: ot required: false type: integer - description: name of camera in: query name: name required: false type: string - description: URL for the sub stream video feed in: query name: substream required: false type: string - description: URL for the record stream video feed in: query name: mainstream required: false type: string - description: Camera username in: query name: username required: false type: string - description: Camera password in: query name: password required: false type: string - description: alerts enabled (1 or 0) in: query name: alerts required: false type: integer - description: recording enabled (1 or 0) in: query name: record required: false type: integer - description: resize enabled (1 or 0) in: query name: resize required: false type: integer - description: raw record enabled (1 or 0) in: query name: raw required: false type: integer - description: display FPS limit in: query name: fps required: false type: integer - description: record FPS limit in: query name: recfps required: false type: integer - description: notes in: query name: notes required: false type: string produces: - application/json responses: "200": description: 'Adds (or updates, if oid was provided) the camera and enables it. Returns {"status":"ok","oid":n,"ot":2} with the camera''s object ID.' tags: - Commands /command/addOnvif: get: summary: Add an ONVIF camera operationId: /command/addOnvif parameters: - description: URL for the ONVIF device management endpoint in: query name: uri required: true type: string - description: name of camera in: query name: name required: false type: string - description: Profile index for the live stream (0) in: query name: substream required: false type: integer - description: Profile index for the record stream (1) in: query name: mainstream required: false type: integer - description: Camera username in: query name: username required: false type: string - description: Camera password in: query name: password required: false type: string - description: alerts enabled (1 or 0) in: query name: alerts required: false type: integer - description: recording enabled (1 or 0) in: query name: record required: false type: integer - description: resize enabled (1 or 0) in: query name: resize required: false type: integer - description: raw record enabled (1 or 0) in: query name: raw required: false type: integer - description: display FPS limit in: query name: fps required: false type: integer - description: record FPS limit in: query name: recfps required: false type: integer - description: notes in: query name: notes required: false type: string produces: - application/json responses: "200": description: 'Adds the ONVIF camera and enables it. Returns {"status":"ok","oid":n,"ot":2} with the new camera''s object ID, or an error if the URI is missing.' tags: - Commands /command/switchDetector: get: summary: Switch the detector for the device on or off. operationId: /command/switchDetector parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: On or Off enum: - true - false in: query name: on required: true type: boolean produces: - application/json responses: "200": description: Switches the detector on or off tags: - Commands /command/purge: get: summary: 'Delete all recorded content for the device (4.7.7.0+)' operationId: /command/purge parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: Permanently deletes all recordings for the device from disk and the database. tags: - Commands /eventcounts.json: get: summary: Returns the number of events recorded for the device within the last secs seconds operationId: eventcounts.json parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Look-back window in seconds (default 60). Use 86400 for a 24 hour count. in: query name: secs required: false type: integer produces: - application/json responses: "200": description: 'Returns {"count":n} - the number of events recorded for the device within the look-back window' tags: - Query /fileThumb.jpg: get: summary: Returns a thumbnail image for the specified recording and filename operationId: fileThumb.jpg parameters: - description: Object ID in: query name: oid required: true type: integer - description: Filename (3_2021-01-19_12-22-55_125.jpg) (use ..._large.jpg for a large version) in: query name: fn required: true type: string produces: - image/jpeg responses: "200": description: Returns a thumbnail image for the specified recording and filename tags: - Media /grab.jpg: get: summary: Returns a still image for the specified object(s) operationId: grab.jpg parameters: - description: Object ID in: query name: oid required: false type: integer - description: Object IDs (1,2,3,4) in: query name: oids required: false type: string - description: Background Color - RGB format (255,0,0) in: query name: backColor required: false type: string - description: Maintain Aspect Ratio in: query name: maintainAR required: false type: boolean - description: Size (320x240) in: query name: size required: false type: string produces: - image/jpeg responses: "200": description: Returns a still image for the specified object(s) tags: - Media /grabImage.jpg: get: summary: Returns a full size image for the specified object and filename operationId: grabImage.jpg parameters: - description: Object ID in: query name: oid required: true type: integer - description: Filename (2021-01-19_12-22-55_125.jpg) in: query name: fn required: true type: string produces: - image/jpeg responses: "200": description: Returns a full size image for the specified object and filename tags: - Media /grabThumb.jpg: get: summary: Returns a thumbnail image for the specified object and filename operationId: grabThumb.jpg parameters: - description: Object ID in: query name: oid required: true type: integer - description: Filename (2021-01-19_12-22-55_125.jpg) in: query name: fn required: true type: string produces: - image/jpeg responses: "200": description: Returns a thumbnail image for the specified object and filename tags: - Media /liveimage.jpg: get: summary: Returns a live frame from the specified camera operationId: liveimage.jpg parameters: - description: Object ID in: query name: oid required: true type: integer - description: Size (320x240) in: query name: size required: false type: string produces: - image/jpeg responses: "200": description: Returns a live frame from the specified camera tags: - Media /photo.jpg: get: summary: Returns a photo frame for the specified camera (5.4.6.0+) operationId: photo.jpg parameters: - description: Object ID in: query name: oid required: true type: integer produces: - image/jpeg responses: "200": description: Proxies the image from the cameras photo URL endpoint. Returns the live frame from the camera if not available. tags: - Media /ptz.cgi: get: summary: PTZ controls operationId: ptz.cgi parameters: - description: Object ID in: query name: oid required: true type: integer - description: Move the camera to a PTZ preset by name (see /command/ptzpresets). Returns an error if no preset matches. in: query name: preset required: false type: string - description: Command (the url encoded portion in the extended commands options from the PTZ2.xml) in: query name: cmd required: false type: string - description: Direction (0 for center, 1 = left, 2=up left, 3 = up, 4 = up right, 5 = right, 6 = down right, 7 = down, 8 = down left, 9 = zoom in, 10 = zoom out, 11 = stop) enum: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 in: query name: dir required: false type: integer - description: Duration in milliseconds. Only used with dir - the server automatically issues a stop command this many milliseconds after the move starts, so callers don't need their own stop timer. in: query name: dur required: false type: integer produces: - application/json responses: "200": description: Executes the PTZ command on the camera. Provide one of preset, cmd or dir per call. tags: - PTZ /q/getCameraGrabs: get: summary: Returns JSON of the camera's photos operationId: /q/getCameraGrabs parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: End Date (pass the last received timestamp to page through results) in: query name: enddate required: false type: integer produces: - application/json responses: "200": description: Camera grab JSON - If you receive 800 grabs you will need to make another call to getcameragrabs passing in enddate=x where x is the last received timestamp in the array to retrieve the next 800 tags: - Query /q/queryLevel: get: summary: Returns the detected motion or sound level of the device operationId: /q/queryLevel parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer produces: - application/json responses: "200": description: 'Returns {"level":n} where n is between 0 (silence/no motion) and 1 (maximum). For cameras this is the current motion detector level; for microphones it is the audio level and the response also includes a "dB" field.' tags: - Query /q/getSessionCount: get: summary: Returns the number of active sessions. operationId: /q/getSessionCount produces: - application/json responses: "200": description: Returns the number of client sessions currently connected to the server. tags: - Query /q/getStreamingStatus: get: summary: Get a JSON list of configured RTMP servers (with status). This provides an ident field you use in subsequent requests. operationId: /q/getStreamingStatus produces: - application/json responses: "200": description: Returns a JSON list of the configured RTMP servers with their current status. Use the ident field with start-rtmp, stop-rtmp and rtmpStop. tags: - Query /q/getGraph: get: summary: "Get a JSON description of the file with a motion graph array and tag information (including timestamps)" operationId: /q/getGraph parameters: - description: Filename (from getEvents call) in: query name: fn required: true type: string produces: - application/json responses: "200": description: Return json array tags: - Query /q/getEvents: get: summary: "Get a JSON list of recordings for the server or specific device. If you receive 400 events you will need to make another call to getevents passing in enddate=x where x is the last received timestamp in the array to retrieve the next 400. Pass in tag=x to filter the results to recordings tagged with x" operationId: /q/getEvents parameters: - description: Object ID in: query name: oid required: false type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: false type: integer - description: Filter in: query name: tag required: false type: string - description: Compresses the results using gzip in: query name: compress required: false type: boolean produces: - application/json responses: "200": description: Return json array tags: - Query /streamFile.cgi: get: summary: Stream the file to the caller operationId: /streamFile.cgi parameters: - description: Object ID in: query name: oid required: true type: integer - description: Object TypeID enum: - 1 - 2 in: query name: ot required: true type: integer - description: Filename (3_2021-01-21_16-34-42_977.mkv) in: query name: fn required: true type: string produces: - video/x-matroska - video/mp4 responses: "200": description: Stream the file to the caller. The filename is from the "fn" property in the json from the getevents call. It is up to the calling application to provide playback facility. tags: - Streams /video.gif: get: summary: Generate an animated gif from the live camera stream operationId: video.gif parameters: - description: Object ID in: query name: oid required: true type: integer - description: Frame rate (FPS) in: query name: framerate required: true type: integer - description: Seconds in: query name: secs required: true type: integer - description: Size (640x480) in: query name: size required: true type: string produces: - image/gif responses: "200": description: Generate an animated gif from the live camera stream tags: - Media /video.mjpg: get: summary: Returns live video of one or more cameras as an MJPEG stream operationId: video.mjpg parameters: - description: Object IDs (1,2,3,4) in: query name: oids required: false type: string - description: Background Color - RGB format (255,0,0) in: query name: backColor required: false type: string - description: Cycle (Seconds) in: query name: cycle required: false type: integer - description: viewIndex (provide this to display a view from the default account instead of a set of cameras - 5.6.4.0+) in: query name: viewIndex required: false type: integer - description: Group in: query name: group required: false type: string - description: Maintain Aspect Ratio in: query name: maintainAR required: false type: boolean - description: Size (320x240) in: query name: size required: false type: string produces: - image/jpeg responses: "200": description: Return a grid of cameras in mjpeg form tags: - Media /video.mp4: get: summary: Returns a grid of cameras in mp4 form (the first camera with audio provides the audio stream) operationId: video.mp4 parameters: - description: Object IDs (1,2,3,4) in: query name: oids required: false type: string - description: Background Color - RGB format (255,0,0) in: query name: backColor required: false type: string - description: Size (320x240) in: query name: size required: false type: string - description: viewIndex (provide this to display a view from the default account instead of a set of cameras - 5.6.4.0+) in: query name: viewIndex required: false type: integer produces: - video/mp4 responses: "200": description: Returns a grid of cameras in mp4 form (the first camera with audio provides the audio stream) tags: - Media /video.webm: get: summary: Returns a grid of cameras in webm form (the first camera with audio provides the audio stream) operationId: video.webm parameters: - description: Object IDs (1,2,3,4) in: query name: oids required: false type: string - description: Background Color - RGB format (255,0,0) in: query name: backColor required: false type: string - description: Size (320x240) in: query name: size required: false type: string - description: viewIndex (provide this to display a view from the default account instead of a set of cameras - 5.6.4.0+) in: query name: viewIndex required: false type: integer produces: - video/webm responses: "200": description: Returns a grid of cameras in webm form (the first camera with audio provides the audio stream) tags: - Media produces: - application/json schemes: - http externalDocs: description: "Find out more about Agent DVR" url: "https://www.ispyconnect.com/"