{
  "info": {
    "_postman_id": "55f30891-5f09-56ce-a6b6-b6038b8220d2",
    "name": "Ochio API",
    "description": "Send alerts from any sensor or security system, start drone missions inside your site's safety limits, and get every result back the moment it happens.\n\n## Where the API lives\n\nOchio runs on premise or in your cloud, so each site's API is served by its own Ochio server. Set `baseUrl` to it, or leave the default to use the sandbox on your computer (`http://127.0.0.1:8700`).\n\n## Authentication\n\nPut your API key in `apiKey`; the collection sends it as `Authorization: Bearer <key>`. Sensors don't use keys: the two signed requests in **Sensors** carry a script that signs them with `sensorSecret`, which **Register a sensor** fills in.\n\n## Running it\n\nRequests that create something save its id for the next ones, so the collection runs top to bottom against a fresh sandbox (`uv run ochio-core --fresh`). Point `webhookUrl` at a receiver you control to see deliveries arrive.\n\nQuestions: contact@ochio.ai",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "http://127.0.0.1:8700"
    },
    {
      "key": "apiKey",
      "value": ""
    },
    {
      "key": "partnerKey",
      "value": ""
    },
    {
      "key": "sensorId",
      "value": "east-gate-pir-02"
    },
    {
      "key": "sensorSecret",
      "value": ""
    },
    {
      "key": "alertId",
      "value": ""
    },
    {
      "key": "missionId",
      "value": ""
    },
    {
      "key": "pendingMissionId",
      "value": ""
    },
    {
      "key": "reportId",
      "value": ""
    },
    {
      "key": "webhookId",
      "value": ""
    },
    {
      "key": "webhookSecret",
      "value": ""
    },
    {
      "key": "webhookUrl",
      "value": "https://desk.example.com/ochio-webhooks"
    },
    {
      "key": "vehicleId",
      "value": "drone-1"
    },
    {
      "key": "simSensorId",
      "value": "east-gate-cam-01"
    },
    {
      "key": "keyName",
      "value": "vms-connector"
    }
  ],
  "item": [
    {
      "name": "Site and fleet",
      "description": "Read the site the way Mission Control sees it: its status at a glance, the vehicles, the zones on the map, and the rules that turn alerts into missions.",
      "item": [
        {
          "name": "Check health",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/health",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "health"
              ]
            },
            "description": "Whether Ochio is up. It needs no key, so a load balancer or a monitor can call it.\n\n**Access:** No key needed.\n\n**Returns:** `status` (`ok`), `version`, `time`, `dev_mode` (whether test mode is on) and `instance_id`, which changes when Ochio starts from a fresh state.",
            "auth": {
              "type": "noauth"
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/health",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "health"
                  ]
                },
                "auth": {
                  "type": "noauth"
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"status\": \"ok\",\n  \"version\": \"1.0.0\",\n  \"time\": \"2026-10-19T21:33:02.751Z\",\n  \"dev_mode\": true,\n  \"instance_id\": \"inst_72ff46ed59a2\"\n}"
            }
          ]
        },
        {
          "name": "Get the site's status",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "status"
              ]
            },
            "description": "Everything a dashboard needs at a glance: counts, each vehicle's state, the missions under way, the open alerts and any silent sensors.\n\n**Access:** API key with `read`.\n\n**Returns:** `site` (name, center, operating area), `time`, `version`, `counts`, `vehicles`, `active_missions` with their progress, `open_alerts` (open and responding) and `silent_sensors`."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/status",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "status"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"site\": {\n    \"name\": \"Demo Depot\",\n    \"center\": {\n      \"lat\": 38.5005,\n      \"lon\": -98.0005\n    },\n    \"operating_area_id\": \"depot\"\n  },\n  \"time\": \"2026-10-19T21:39:17.000Z\",\n  \"version\": \"1.0.0\",\n  \"instance_id\": \"inst_72ff46ed59a2\",\n  \"dev_mode\": true,\n  \"sim_speed\": 1.0,\n  \"counts\": {\n    \"alerts_open\": 1,\n    \"alerts_responding\": 1,\n    \"missions_active\": 1,\n    \"missions_pending_approval\": 0,\n    \"sensors_online\": 3,\n    \"sensors_silent\": 0,\n    \"sensors_pending\": 0,\n    \"vehicles_ready\": 1,\n    \"vehicles_flying\": 1\n  },\n  \"vehicles\": [\n    {\n      \"id\": \"drone-1\",\n      \"name\": \"Drone 1\",\n      \"status\": \"en_route\",\n      \"battery_pct\": 99.4,\n      \"ready\": false,\n      \"mission_id\": \"msn_ab6c41ad6b73\",\n      \"fault\": null\n    },\n    {\n      \"id\": \"drone-2\",\n      \"name\": \"Drone 2\",\n      \"status\": \"docked\",\n      \"battery_pct\": 100.0,\n      \"ready\": true,\n      \"mission_id\": null,\n      \"fault\": null\n    }\n  ],\n  \"active_missions\": [\n    {\n      \"id\": \"msn_ab6c41ad6b73\",\n      \"type\": \"inspect\",\n      \"status\": \"en_route\",\n      \"vehicle_id\": \"drone-1\",\n      \"target\": {\n        \"kind\": \"alert\",\n        \"alert_id\": \"alt_214ab1f49295\",\n        \"sensor_id\": \"north-fence-pir-01\",\n        \"location\": {\n          \"lat\": 38.5033,\n          \"lon\": -98.0032\n        },\n        \"zone_id\": \"north-fence\",\n        \"name\": \"North fence motion sensor\"\n      },\n      \"priority\": \"high\",\n      \"progress\": {\n        \"phase\": \"en_route\",\n        \"distance_to_target_m\": 443,\n        \"eta_s\": 37,\n        \"battery_pct\": 99.4,\n        \"distance_flown_m\": 72,\n        \"detections\": 0\n      }\n    }\n  ],\n  \"open_alerts\": [\n    {\n      \"id\": \"alt_214ab1f49295\",\n      \"source\": \"north-fence-pir-01\",\n      \"type\": \"motion\",\n      \"priority\": \"high\",\n      \"zone_id\": \"north-fence\",\n      \"status\": \"responding\",\n      \"mission_id\": \"msn_ab6c41ad6b73\",\n      \"created_at\": \"2026-10-19T21:39:10.997Z\"\n    },\n    {\n      \"id\": \"alt_02fcb2845e3a\",\n      \"source\": \"generator-yard-door-01\",\n      \"type\": \"door_open\",\n      \"priority\": \"medium\",\n      \"zone_id\": \"generator-yard\",\n      \"status\": \"open\",\n      \"mission_id\": null,\n      \"created_at\": \"2026-10-19T21:34:46.531Z\"\n    }\n  ],\n  \"silent_sensors\": []\n}"
            }
          ]
        },
        {
          "name": "List vehicles",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/vehicles",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "vehicles"
              ]
            },
            "description": "Every vehicle, with where it is and what it's doing.\n\n**Access:** API key with `read`.\n\n**Returns:** `{\"data\": [...]}` with a vehicle for each."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/vehicles",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "vehicles"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"drone-1\",\n      \"name\": \"Drone 1\",\n      \"type\": \"quadcopter\",\n      \"model\": \"Ochio quad (simulated)\",\n      \"adapter\": \"sim\",\n      \"capabilities\": [\n        \"camera\",\n        \"depth\"\n      ],\n      \"home\": {\n        \"lat\": 38.499,\n        \"lon\": -98.001\n      },\n      \"position\": {\n        \"lat\": 38.4996049,\n        \"lon\": -98.0013095,\n        \"alt_m\": 40.0\n      },\n      \"heading_deg\": 338.2,\n      \"ground_speed_mps\": 12.0,\n      \"speed_mps\": 12.0,\n      \"range_m\": 6000.0,\n      \"battery_pct\": 99.4,\n      \"status\": \"en_route\",\n      \"ready\": false,\n      \"charging\": false,\n      \"mission_id\": \"msn_ab6c41ad6b73\",\n      \"fault\": null,\n      \"created_at\": \"2026-10-19T21:30:10.072Z\",\n      \"updated_at\": \"2026-10-19T21:39:10.998Z\"\n    },\n    {\n      \"id\": \"drone-2\",\n      \"name\": \"Drone 2\",\n      \"type\": \"quadcopter\",\n      \"model\": \"Ochio quad (simulated)\",\n      \"adapter\": \"sim\",\n      \"capabilities\": [\n        \"camera\",\n        \"depth\"\n      ],\n      \"home\": {\n        \"lat\": 38.499,\n        \"lon\": -98.0007\n      },\n      \"position\": {\n        \"lat\": 38.499,\n        \"lon\": -98.0007,\n        \"alt_m\": 0.0\n      },\n      \"heading_deg\": 155.5,\n      \"ground_speed_mps\": 0.0,\n      \"speed_mps\": 12.0,\n      \"range_m\": 6000.0,\n      \"battery_pct\": 100.0,\n      \"status\": \"docked\",\n      \"ready\": true,\n      \"charging\": false,\n      \"mission_id\": null,\n      \"fault\": null,\n      \"created_at\": \"2026-10-19T21:30:10.072Z\",\n      \"updated_at\": \"2026-10-19T21:35:12.126Z\"\n    }\n  ]\n}"
            }
          ]
        },
        {
          "name": "Get a vehicle",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/vehicles/{{vehicleId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "vehicles",
                "{{vehicleId}}"
              ]
            },
            "description": "One vehicle, by id.\n\n**Access:** API key with `read`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `vehicle_id` | string | yes | The vehicle's id. |\n\n**Returns:** The vehicle.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 404 | `not_found` | No vehicle with this id. |"
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/vehicles/{{vehicleId}}",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "vehicles",
                    "{{vehicleId}}"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"drone-1\",\n  \"name\": \"Drone 1\",\n  \"type\": \"quadcopter\",\n  \"model\": \"Ochio quad (simulated)\",\n  \"adapter\": \"sim\",\n  \"capabilities\": [\n    \"camera\",\n    \"depth\"\n  ],\n  \"home\": {\n    \"lat\": 38.499,\n    \"lon\": -98.001\n  },\n  \"position\": {\n    \"lat\": 38.4996049,\n    \"lon\": -98.0013095,\n    \"alt_m\": 40.0\n  },\n  \"heading_deg\": 338.2,\n  \"ground_speed_mps\": 12.0,\n  \"speed_mps\": 12.0,\n  \"range_m\": 6000.0,\n  \"battery_pct\": 99.4,\n  \"status\": \"en_route\",\n  \"ready\": false,\n  \"charging\": false,\n  \"mission_id\": \"msn_ab6c41ad6b73\",\n  \"fault\": null,\n  \"created_at\": \"2026-10-19T21:30:10.072Z\",\n  \"updated_at\": \"2026-10-19T21:39:10.998Z\"\n}"
            }
          ]
        },
        {
          "name": "List zones",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/zones",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "zones"
              ]
            },
            "description": "The operating area and every zone, with their outlines.\n\n**Access:** API key with `read`.\n\n**Returns:** `{\"data\": [...]}`, each with `id`, `name`, `kind`, `polygon` (its corners) and `center`."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/zones",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "zones"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"depot\",\n      \"name\": \"Depot operating area\",\n      \"kind\": \"operating_area\",\n      \"polygon\": [\n        {\n          \"lat\": 38.4955,\n          \"lon\": -98.0085\n        },\n        {\n          \"lat\": 38.5058,\n          \"lon\": -98.0085\n        },\n        {\n          \"lat\": 38.506,\n          \"lon\": -97.999\n        },\n        {\n          \"lat\": 38.504,\n          \"lon\": -97.9915\n        },\n        {\n          \"lat\": 38.496,\n          \"lon\": -97.9915\n        },\n        {\n          \"lat\": 38.4952,\n          \"lon\": -97.999\n        }\n      ],\n      \"center\": {\n        \"lat\": 38.500497,\n        \"lon\": -98.000295\n      }\n    },\n    {\n      \"id\": \"north-fence\",\n      \"name\": \"North fence\",\n      \"kind\": \"watch\",\n      \"polygon\": [\n        {\n          \"lat\": 38.5025,\n          \"lon\": -98.0065\n        },\n        {\n          \"lat\": 38.5047,\n          \"lon\": -98.0065\n        },\n        {\n          \"lat\": 38.5049,\n          \"lon\": -97.9995\n        },\n        {\n          \"lat\": 38.5027,\n          \"lon\": -97.9995\n        }\n      ],\n      \"center\": {\n        \"lat\": 38.5037,\n        \"lon\": -98.003\n      }\n    }\n  ]\n}"
            }
          ]
        },
        {
          "name": "List rules",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/rules",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "rules"
              ]
            },
            "description": "The site's rules, in the order Ochio reads them.\n\n**Access:** API key with `read`.\n\n**Returns:** `{\"data\": [...], \"first_match_wins\": true}`; each rule has the fields above and its `order`."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/rules",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "rules"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"perimeter-motion\",\n      \"name\": \"Motion on the perimeter\",\n      \"order\": 1,\n      \"when\": \"alert\",\n      \"zones\": [\n        \"north-fence\",\n        \"east-gate\"\n      ],\n      \"min_priority\": \"medium\",\n      \"mission\": \"inspect\",\n      \"approval\": \"auto\",\n      \"cooldown_s\": 60.0\n    },\n    {\n      \"id\": \"generator-yard-door\",\n      \"name\": \"Generator yard door opened\",\n      \"order\": 2,\n      \"when\": \"alert\",\n      \"zones\": [\n        \"generator-yard\"\n      ],\n      \"min_priority\": \"low\",\n      \"mission\": \"inspect\",\n      \"approval\": \"ask\",\n      \"cooldown_s\": 60.0\n    },\n    {\n      \"id\": \"silent-sensor\",\n      \"name\": \"A sensor went silent\",\n      \"order\": 3,\n      \"when\": \"sensor_silent\",\n      \"zones\": [\n        \"*\"\n      ],\n      \"min_priority\": \"low\",\n      \"mission\": \"inspect\",\n      \"approval\": \"auto\",\n      \"cooldown_s\": 120.0\n    }\n  ],\n  \"first_match_wins\": true\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Alerts",
      "description": "Sensors and connected systems report incidents as alerts. Ochio places each one in a zone, runs your site's rules on it, and links it to the mission that answers it.",
      "item": [
        {
          "name": "Send an alert (API key)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200 or 201\", () => pm.expect([200, 201]).to.include(pm.response.code));",
                  "if (j.alert) setVar('alertId', j.alert.id);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/alerts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "alerts"
              ]
            },
            "description": "Reports an incident. A sensor signs the request with its secret. A connected system, such as a camera system or an alarm panel, can send it with an API key that has `alerts:write` instead.\n\nOchio places the alert in the zone its location falls in, runs the site's rules, and answers with the alert, the mission it started (if any) and what the rules did.\n\n**Access:** Signed by the sensor, or an API key with `alerts:write`.\n\n**Headers**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `Ochio-Timestamp` | string | no | Unix time in whole seconds when the request was signed. Needed when a sensor signs the request. |\n| `Ochio-Signature` | string | no | `v1=` and the hex HMAC-SHA256 of the timestamp, a dot and the raw body, keyed with the sensor's secret. See Signing sensor requests. |\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `id` | string | yes | The sender's own id for this incident, up to 128 characters. With `source`, it identifies the alert. |\n| `source` | string | yes | The id of a registered sensor. A signed request must come from this sensor. |\n| `type` | string | yes | What happened, in your words, up to 64 characters: `motion`, `door_open`, `person`, `tamper`. |\n| `priority` | string | no | `low`, `medium`, `high` or `critical`. Default `medium`. Rules can require a minimum. |\n| `time` | string | no | When it happened: ISO 8601, or Unix seconds or milliseconds, between 2000 and 2100. Default: when Ochio receives it. |\n| `location` | object | no | Where it happened. Default: the sensor's location. |\n| `location.lat` | number | yes | Latitude in decimal degrees, -90 to 90. |\n| `location.lon` | number | yes | Longitude in decimal degrees, -180 to 180. |\n| `version` | integer | no | Starts at 1. Send a higher number, with every field again, to update the alert. |\n| `title` | string | no | A short headline for people, up to 200 characters. |\n| `description` | string | no | More detail, up to 2,000 characters. |\n| `media_url` | string | no | A link to a picture or clip, up to 2,000 characters. |\n| `data` | object | no | Anything else to keep with the alert, as you send it. |\n\n**Returns:** `201` for a new alert, `200` for one Ochio already had, with:   |   | Field | Holds  | `result` | `created`, `updated`, `duplicate` or `stale`.  | `alert` | The alert.  | `mission` | The mission answering it, as `{\"id\", \"status\", \"vehicle_id\"}`, or `null`. A refused mission adds `failed_checks`.  | `rule` | What the rules did. Only for `created` and `updated`.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 401 | `invalid_signature` | A signed request whose signature doesn't match. Nothing was recorded. |\n| 404 | `unknown_sensor` | `source` isn't a registered sensor. |\n| 400 | `invalid_json` | The body isn't JSON. |\n| 400 | `invalid_request` | A field is missing or out of range. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"id\": \"vms-{{$timestamp}}\",\n  \"source\": \"north-fence-pir-01\",\n  \"type\": \"vehicle\",\n  \"priority\": \"low\",\n  \"title\": \"Vehicle stopped by the north fence\",\n  \"media_url\": \"https://vms.example.com/clips/77120.mp4\",\n  \"data\": {\n    \"camera\": \"NF-CAM-3\",\n    \"plate\": \"unknown\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "201 Created, no rule matched",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/alerts",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "alerts"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"id\": \"vms-{{$timestamp}}\",\n  \"source\": \"north-fence-pir-01\",\n  \"type\": \"vehicle\",\n  \"priority\": \"low\",\n  \"title\": \"Vehicle stopped by the north fence\",\n  \"media_url\": \"https://vms.example.com/clips/77120.mp4\",\n  \"data\": {\n    \"camera\": \"NF-CAM-3\",\n    \"plate\": \"unknown\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"result\": \"created\",\n  \"alert\": {\n    \"id\": \"alt_174f5ffd8217\",\n    \"source\": \"north-fence-pir-01\",\n    \"source_alert_id\": \"vms-77120\",\n    \"version\": 1,\n    \"type\": \"vehicle\",\n    \"priority\": \"low\",\n    \"location\": {\n      \"lat\": 38.5033,\n      \"lon\": -98.0032\n    },\n    \"zone_id\": \"north-fence\",\n    \"status\": \"open\",\n    \"mission_id\": null,\n    \"mission_history\": [],\n    \"time\": \"2026-10-19T21:33:07.201Z\",\n    \"title\": \"Vehicle stopped by the north fence\",\n    \"description\": null,\n    \"media_url\": \"https://vms.example.com/clips/77120.mp4\",\n    \"data\": {\n      \"camera\": \"NF-CAM-3\",\n      \"plate\": \"unknown\"\n    },\n    \"received_by\": \"key:partner\",\n    \"dismissed_by\": null,\n    \"resolved_at\": null,\n    \"created_at\": \"2026-10-19T21:33:07.201Z\",\n    \"updated_at\": \"2026-10-19T21:33:07.201Z\"\n  },\n  \"mission\": null,\n  \"rule\": {\n    \"rule_id\": null,\n    \"outcome\": \"no_match\",\n    \"detail\": \"No rule matched; the alert stays open.\"\n  }\n}"
            },
            {
              "name": "201 Created, a drone launched",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/alerts",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "alerts"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"id\": \"vms-{{$timestamp}}\",\n  \"source\": \"north-fence-pir-01\",\n  \"type\": \"vehicle\",\n  \"priority\": \"low\",\n  \"title\": \"Vehicle stopped by the north fence\",\n  \"media_url\": \"https://vms.example.com/clips/77120.mp4\",\n  \"data\": {\n    \"camera\": \"NF-CAM-3\",\n    \"plate\": \"unknown\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"result\": \"created\",\n  \"alert\": {\n    \"id\": \"alt_6cba16a5d837\",\n    \"source\": \"north-fence-pir-01\",\n    \"source_alert_id\": \"nf-cam-3-000981\",\n    \"version\": 1,\n    \"type\": \"person\",\n    \"priority\": \"high\",\n    \"location\": {\n      \"lat\": 38.5033,\n      \"lon\": -98.0032\n    },\n    \"zone_id\": \"north-fence\",\n    \"status\": \"responding\",\n    \"mission_id\": \"msn_d10f14f3ab2c\",\n    \"mission_history\": [\n      \"msn_d10f14f3ab2c\"\n    ],\n    \"time\": \"2026-10-19T21:44:10.457Z\",\n    \"title\": \"Person at the north fence\",\n    \"description\": null,\n    \"media_url\": null,\n    \"data\": null,\n    \"received_by\": \"key:partner\",\n    \"dismissed_by\": null,\n    \"resolved_at\": null,\n    \"created_at\": \"2026-10-19T21:44:10.457Z\",\n    \"updated_at\": \"2026-10-19T21:44:10.458Z\"\n  },\n  \"mission\": {\n    \"id\": \"msn_d10f14f3ab2c\",\n    \"status\": \"en_route\",\n    \"vehicle_id\": \"drone-1\"\n  },\n  \"rule\": {\n    \"rule_id\": \"perimeter-motion\",\n    \"outcome\": \"mission_created\",\n    \"mission_id\": \"msn_d10f14f3ab2c\",\n    \"mission_status\": \"en_route\"\n  }\n}"
            }
          ]
        },
        {
          "name": "List alerts",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/alerts?status=active",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "alerts"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "active"
                }
              ]
            },
            "description": "Alerts, newest first.\n\n**Access:** API key with `read`.\n\n**Query**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `status` | string | no | One status, or `active` for `open` and `responding` together. |\n| `limit` | integer | no | How many to return, 1 to 1,000. Default 100. |\n\n**Returns:** `{\"data\": [...]}` with an alert for each."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/alerts?status=active",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "alerts"
                  ],
                  "query": [
                    {
                      "key": "status",
                      "value": "active"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"alt_174f5ffd8217\",\n      \"source\": \"north-fence-pir-01\",\n      \"source_alert_id\": \"vms-77120\",\n      \"version\": 1,\n      \"type\": \"vehicle\",\n      \"priority\": \"low\",\n      \"location\": {\n        \"lat\": 38.5033,\n        \"lon\": -98.0032\n      },\n      \"zone_id\": \"north-fence\",\n      \"status\": \"open\",\n      \"mission_id\": null,\n      \"mission_history\": [],\n      \"time\": \"2026-10-19T21:33:07.201Z\",\n      \"title\": \"Vehicle stopped by the north fence\",\n      \"description\": null,\n      \"media_url\": \"https://vms.example.com/clips/77120.mp4\",\n      \"data\": {\n        \"camera\": \"NF-CAM-3\",\n        \"plate\": \"unknown\"\n      },\n      \"received_by\": \"key:partner\",\n      \"dismissed_by\": null,\n      \"resolved_at\": null,\n      \"created_at\": \"2026-10-19T21:33:07.201Z\",\n      \"updated_at\": \"2026-10-19T21:33:07.201Z\"\n    },\n    {\n      \"id\": \"alt_5037deb6aeee\",\n      \"source\": \"east-gate-pir-02\",\n      \"source_alert_id\": \"pir02-000412\",\n      \"version\": 2,\n      \"type\": \"motion\",\n      \"priority\": \"critical\",\n      \"location\": {\n        \"lat\": 38.5005,\n        \"lon\": -97.995\n      },\n      \"zone_id\": \"east-gate\",\n      \"status\": \"responding\",\n      \"mission_id\": \"msn_e58e7523d2b5\",\n      \"mission_history\": [\n        \"msn_e58e7523d2b5\"\n      ],\n      \"time\": \"2026-10-19T21:33:03.000Z\",\n      \"title\": \"Motion at the east gate\",\n      \"description\": \"The camera at the gate shows two people.\",\n      \"media_url\": null,\n      \"data\": null,\n      \"received_by\": \"sensor:east-gate-pir-02\",\n      \"dismissed_by\": null,\n      \"resolved_at\": null,\n      \"created_at\": \"2026-10-19T21:33:03.882Z\",\n      \"updated_at\": \"2026-10-19T21:33:06.092Z\"\n    }\n  ]\n}"
            }
          ]
        },
        {
          "name": "Get an alert",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/alerts/{{alertId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "alerts",
                "{{alertId}}"
              ]
            },
            "description": "One alert, by Ochio's id.\n\n**Access:** API key with `read`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `alert_id` | string | yes | The alert's id, `alt_…`. |\n\n**Returns:** The alert.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 404 | `not_found` | No alert with this id. |"
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/alerts/{{alertId}}",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "alerts",
                    "{{alertId}}"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"alt_5037deb6aeee\",\n  \"source\": \"east-gate-pir-02\",\n  \"source_alert_id\": \"pir02-000412\",\n  \"version\": 2,\n  \"type\": \"motion\",\n  \"priority\": \"critical\",\n  \"location\": {\n    \"lat\": 38.5005,\n    \"lon\": -97.995\n  },\n  \"zone_id\": \"east-gate\",\n  \"status\": \"responding\",\n  \"mission_id\": \"msn_e58e7523d2b5\",\n  \"mission_history\": [\n    \"msn_e58e7523d2b5\"\n  ],\n  \"time\": \"2026-10-19T21:33:03.000Z\",\n  \"title\": \"Motion at the east gate\",\n  \"description\": \"The camera at the gate shows two people.\",\n  \"media_url\": null,\n  \"data\": null,\n  \"received_by\": \"sensor:east-gate-pir-02\",\n  \"dismissed_by\": null,\n  \"resolved_at\": null,\n  \"created_at\": \"2026-10-19T21:33:03.882Z\",\n  \"updated_at\": \"2026-10-19T21:33:06.092Z\"\n}"
            }
          ]
        },
        {
          "name": "Dismiss an alert",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200 or 409\", () => pm.expect([200, 409]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/alerts/{{alertId}}/dismiss",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "alerts",
                "{{alertId}}",
                "dismiss"
              ]
            },
            "description": "Closes an alert without a mission, for example a delivery van a person recognizes on camera. Dismissing doesn't stop a mission that's already answering it; cancel the mission for that.\n\n**Access:** API key with `missions:approve`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `alert_id` | string | yes | The alert's id. |\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `note` | string | no | A short note kept with the decision, up to 500 characters. |\n\n**Returns:** The alert, now `dismissed`. An `alert.dismissed` event goes out with the note as its `reason`.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 409 | `alert_closed` | It's already resolved or dismissed. |\n| 404 | `not_found` | No alert with this id. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"note\": \"Delivery van, expected\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 Dismissed",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/alerts/{{alertId}}/dismiss",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "alerts",
                    "{{alertId}}",
                    "dismiss"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"note\": \"Delivery van, expected\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"alt_174f5ffd8217\",\n  \"source\": \"north-fence-pir-01\",\n  \"source_alert_id\": \"vms-77120\",\n  \"version\": 1,\n  \"type\": \"vehicle\",\n  \"priority\": \"low\",\n  \"location\": {\n    \"lat\": 38.5033,\n    \"lon\": -98.0032\n  },\n  \"zone_id\": \"north-fence\",\n  \"status\": \"dismissed\",\n  \"mission_id\": null,\n  \"mission_history\": [],\n  \"time\": \"2026-10-19T21:33:07.201Z\",\n  \"title\": \"Vehicle stopped by the north fence\",\n  \"description\": null,\n  \"media_url\": \"https://vms.example.com/clips/77120.mp4\",\n  \"data\": {\n    \"camera\": \"NF-CAM-3\",\n    \"plate\": \"unknown\"\n  },\n  \"received_by\": \"key:partner\",\n  \"dismissed_by\": \"key:operator\",\n  \"resolved_at\": null,\n  \"created_at\": \"2026-10-19T21:33:07.201Z\",\n  \"updated_at\": \"2026-10-19T21:34:46.520Z\"\n}"
            },
            {
              "name": "409 Already closed",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/alerts/{{alertId}}/dismiss",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "alerts",
                    "{{alertId}}",
                    "dismiss"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"note\": \"Delivery van, expected\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Conflict",
              "code": 409,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"alert_closed\",\n    \"message\": \"Alert alt_174f5ffd8217 is already dismissed.\"\n  }\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Sensors",
      "description": "A sensor is anything that raises alerts and checks in: a motion sensor, a door contact, a camera, a radar. One that goes quiet is treated as an event, because a cut or jammed sensor is a warning in itself.\n\nThe two signed requests carry a pre-request script that signs them with `sensorSecret`.",
      "item": [
        {
          "name": "Register a sensor",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 201 or 409\", () => pm.expect([201, 409]).to.include(pm.response.code));",
                  "if (j.secret) setVar('sensorSecret', j.secret);",
                  "// already registered (a second run): give it a new secret so the signed requests work",
                  "if (pm.response.code === 409) {",
                  "  pm.sendRequest({ url: pm.variables.replaceIn('{{baseUrl}}/v1/sensors/{{sensorId}}/rotate-secret'), method: 'POST',",
                  "    header: { Authorization: 'Bearer ' + pm.variables.get('apiKey') } },",
                  "    (err, res) => { if (!err && res.code === 200) setVar('sensorSecret', res.json().secret); });",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/sensors",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sensors"
              ]
            },
            "description": "Adds a sensor and gives it its secret. The answer is the only time Ochio shows the secret: give it to the sensor, which signs its requests with it.\n\n**Access:** API key with `sensors:write`.\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `id` | string | yes | Your id for it, unique on the site: letters, digits, `.`, `_` and `-`, up to 64 characters, starting with a letter or digit. |\n| `name` | string | yes | A name people read, up to 120 characters. |\n| `type` | string | no | What it is, in your words. Default `motion`. |\n| `location` | object | yes | Where it is. |\n| `location.lat` | number | yes | Latitude in decimal degrees, -90 to 90. |\n| `location.lon` | number | yes | Longitude in decimal degrees, -180 to 180. |\n| `checkin_interval_s` | number | no | How often it will check in, 1 to 86,400 seconds. Default 10. |\n| `missed_checkins_allowed` | integer | no | Check-ins it may miss before it's silent, 1 to 100. Default 2. |\n\n**Returns:** `201` with the sensor and its `secret`. The sensor starts `pending`, and a `sensor.registered` event goes out.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 409 | `sensor_exists` | A sensor with this id exists. To give it a new secret, rotate it instead. |\n| 400 | `invalid_request` | A field is missing or out of range. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"id\": \"{{sensorId}}\",\n  \"name\": \"East gate motion sensor 2\",\n  \"type\": \"motion\",\n  \"location\": {\n    \"lat\": 38.5005,\n    \"lon\": -97.995\n  },\n  \"checkin_interval_s\": 10,\n  \"missed_checkins_allowed\": 2\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "201 Created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/sensors",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "sensors"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"id\": \"{{sensorId}}\",\n  \"name\": \"East gate motion sensor 2\",\n  \"type\": \"motion\",\n  \"location\": {\n    \"lat\": 38.5005,\n    \"lon\": -97.995\n  },\n  \"checkin_interval_s\": 10,\n  \"missed_checkins_allowed\": 2\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"east-gate-pir-02\",\n  \"name\": \"East gate motion sensor 2\",\n  \"type\": \"motion\",\n  \"location\": {\n    \"lat\": 38.5005,\n    \"lon\": -97.995\n  },\n  \"zone_id\": \"east-gate\",\n  \"checkin_interval_s\": 10.0,\n  \"missed_checkins_allowed\": 2,\n  \"status\": \"pending\",\n  \"last_seen\": null,\n  \"expires_at\": null,\n  \"battery_pct\": null,\n  \"reported_status\": null,\n  \"simulated\": false,\n  \"origin\": \"api\",\n  \"created_at\": \"2026-10-19T21:33:02.764Z\",\n  \"updated_at\": \"2026-10-19T21:33:02.764Z\",\n  \"secret\": \"ssk_test_example_secret_000000000001\"\n}"
            },
            {
              "name": "409 Exists",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/sensors",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "sensors"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"id\": \"{{sensorId}}\",\n  \"name\": \"East gate motion sensor 2\",\n  \"type\": \"motion\",\n  \"location\": {\n    \"lat\": 38.5005,\n    \"lon\": -97.995\n  },\n  \"checkin_interval_s\": 10,\n  \"missed_checkins_allowed\": 2\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Conflict",
              "code": 409,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"sensor_exists\",\n    \"message\": \"A sensor with id 'east-gate-pir-02' already exists. POST /v1/sensors/east-gate-pir-02/rotate-secret issues a new secret.\"\n  }\n}"
            }
          ]
        },
        {
          "name": "Check in",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Sign this request as the sensor: HMAC-SHA256 over \"<timestamp>.<body>\", keyed with {{sensorSecret}}.",
                  "const cryptoJs = require(\"crypto-js\");",
                  "const secret = pm.variables.get(\"sensorSecret\");",
                  "if (!secret) { throw new Error(\"Set sensorSecret first: send 'Register a sensor' or 'Rotate a sensor's secret'.\"); }",
                  "const body = pm.variables.replaceIn(pm.request.body && pm.request.body.raw ? pm.request.body.raw : \"\");",
                  "pm.request.body.update(body);  // send exactly the bytes we sign",
                  "const ts = Math.floor(Date.now() / 1000).toString();",
                  "const sig = cryptoJs.HmacSHA256(ts + \".\" + body, secret).toString(cryptoJs.enc.Hex);",
                  "pm.request.headers.upsert({ key: \"Ochio-Timestamp\", value: ts });",
                  "pm.request.headers.upsert({ key: \"Ochio-Signature\", value: \"v1=\" + sig });"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/sensors/{{sensorId}}/heartbeat",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sensors",
                "{{sensorId}}",
                "heartbeat"
              ]
            },
            "description": "The sensor's regular sign of life, signed with its secret. Send it every `checkin_interval_s` seconds. An alert from the sensor counts as a check-in too.\n\n**Access:** Signed by the sensor, or an API key with `alerts:write`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `sensor_id` | string | yes | The sensor's id. |\n\n**Headers**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `Ochio-Timestamp` | string | no | Unix time in whole seconds when the request was signed. Needed when a sensor signs the request. |\n| `Ochio-Signature` | string | no | `v1=` and the hex HMAC-SHA256 of the timestamp, a dot and the raw body, keyed with the sensor's secret. See Signing sensor requests. |\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `battery_pct` | number | no | The sensor's battery level, 0 to 100. |\n| `status` | string | no | The sensor's own health word, up to 32 characters: `ok`, `degraded`. |\n\n**Returns:** `200` with the sensor's `status`, `next_checkin_by` (when the next one is due) and `expires_at` (when it turns silent without one). A repeat of a request Ochio already counted answers `\"repeat\": true` and doesn't count again.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 401 | `invalid_signature` | The signature doesn't match. See Signing. |\n| 404 | `unknown_sensor` | A signed check-in for a sensor that isn't registered. |\n| 404 | `not_found` | The same, sent with an API key. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"battery_pct\": 87,\n  \"status\": \"ok\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "auth": {
              "type": "noauth"
            }
          },
          "response": [
            {
              "name": "200 Checked in",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/sensors/{{sensorId}}/heartbeat",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "sensors",
                    "{{sensorId}}",
                    "heartbeat"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"battery_pct\": 87,\n  \"status\": \"ok\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "auth": {
                  "type": "noauth"
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"sensor_id\": \"east-gate-pir-02\",\n  \"status\": \"online\",\n  \"next_checkin_by\": \"2026-10-19T21:33:12.770Z\",\n  \"expires_at\": \"2026-10-19T21:33:22.770Z\"\n}"
            },
            {
              "name": "200 Repeat",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/sensors/{{sensorId}}/heartbeat",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "sensors",
                    "{{sensorId}}",
                    "heartbeat"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"battery_pct\": 87,\n  \"status\": \"ok\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "auth": {
                  "type": "noauth"
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"sensor_id\": \"east-gate-pir-02\",\n  \"status\": \"online\",\n  \"next_checkin_by\": \"2026-10-19T21:33:12.770Z\",\n  \"expires_at\": \"2026-10-19T21:33:22.770Z\",\n  \"repeat\": true\n}"
            }
          ]
        },
        {
          "name": "Send an alert (signed by the sensor)",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Sign this request as the sensor: HMAC-SHA256 over \"<timestamp>.<body>\", keyed with {{sensorSecret}}.",
                  "const cryptoJs = require(\"crypto-js\");",
                  "const secret = pm.variables.get(\"sensorSecret\");",
                  "if (!secret) { throw new Error(\"Set sensorSecret first: send 'Register a sensor' or 'Rotate a sensor's secret'.\"); }",
                  "const body = pm.variables.replaceIn(pm.request.body && pm.request.body.raw ? pm.request.body.raw : \"\");",
                  "pm.request.body.update(body);  // send exactly the bytes we sign",
                  "const ts = Math.floor(Date.now() / 1000).toString();",
                  "const sig = cryptoJs.HmacSHA256(ts + \".\" + body, secret).toString(cryptoJs.enc.Hex);",
                  "pm.request.headers.upsert({ key: \"Ochio-Timestamp\", value: ts });",
                  "pm.request.headers.upsert({ key: \"Ochio-Signature\", value: \"v1=\" + sig });"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200 or 201\", () => pm.expect([200, 201]).to.include(pm.response.code));",
                  "if (j.mission) setVar('missionId', j.mission.id);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/alerts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "alerts"
              ]
            },
            "description": "Reports an incident. A sensor signs the request with its secret. A connected system, such as a camera system or an alarm panel, can send it with an API key that has `alerts:write` instead.\n\nOchio places the alert in the zone its location falls in, runs the site's rules, and answers with the alert, the mission it started (if any) and what the rules did.\n\n**Access:** Signed by the sensor, or an API key with `alerts:write`.\n\n**Headers**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `Ochio-Timestamp` | string | no | Unix time in whole seconds when the request was signed. Needed when a sensor signs the request. |\n| `Ochio-Signature` | string | no | `v1=` and the hex HMAC-SHA256 of the timestamp, a dot and the raw body, keyed with the sensor's secret. See Signing sensor requests. |\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `id` | string | yes | The sender's own id for this incident, up to 128 characters. With `source`, it identifies the alert. |\n| `source` | string | yes | The id of a registered sensor. A signed request must come from this sensor. |\n| `type` | string | yes | What happened, in your words, up to 64 characters: `motion`, `door_open`, `person`, `tamper`. |\n| `priority` | string | no | `low`, `medium`, `high` or `critical`. Default `medium`. Rules can require a minimum. |\n| `time` | string | no | When it happened: ISO 8601, or Unix seconds or milliseconds, between 2000 and 2100. Default: when Ochio receives it. |\n| `location` | object | no | Where it happened. Default: the sensor's location. |\n| `location.lat` | number | yes | Latitude in decimal degrees, -90 to 90. |\n| `location.lon` | number | yes | Longitude in decimal degrees, -180 to 180. |\n| `version` | integer | no | Starts at 1. Send a higher number, with every field again, to update the alert. |\n| `title` | string | no | A short headline for people, up to 200 characters. |\n| `description` | string | no | More detail, up to 2,000 characters. |\n| `media_url` | string | no | A link to a picture or clip, up to 2,000 characters. |\n| `data` | object | no | Anything else to keep with the alert, as you send it. |\n\n**Returns:** `201` for a new alert, `200` for one Ochio already had, with:   |   | Field | Holds  | `result` | `created`, `updated`, `duplicate` or `stale`.  | `alert` | The alert.  | `mission` | The mission answering it, as `{\"id\", \"status\", \"vehicle_id\"}`, or `null`. A refused mission adds `failed_checks`.  | `rule` | What the rules did. Only for `created` and `updated`.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 401 | `invalid_signature` | A signed request whose signature doesn't match. Nothing was recorded. |\n| 404 | `unknown_sensor` | `source` isn't a registered sensor. |\n| 400 | `invalid_json` | The body isn't JSON. |\n| 400 | `invalid_request` | A field is missing or out of range. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"id\": \"pir02-{{$timestamp}}\",\n  \"source\": \"{{sensorId}}\",\n  \"type\": \"motion\",\n  \"priority\": \"high\",\n  \"title\": \"Motion at the east gate\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "auth": {
              "type": "noauth"
            }
          },
          "response": [
            {
              "name": "201 Created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/alerts",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "alerts"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"id\": \"pir02-{{$timestamp}}\",\n  \"source\": \"{{sensorId}}\",\n  \"type\": \"motion\",\n  \"priority\": \"high\",\n  \"title\": \"Motion at the east gate\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "auth": {
                  "type": "noauth"
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"result\": \"created\",\n  \"alert\": {\n    \"id\": \"alt_5037deb6aeee\",\n    \"source\": \"east-gate-pir-02\",\n    \"source_alert_id\": \"pir02-000412\",\n    \"version\": 1,\n    \"type\": \"motion\",\n    \"priority\": \"high\",\n    \"location\": {\n      \"lat\": 38.5005,\n      \"lon\": -97.995\n    },\n    \"zone_id\": \"east-gate\",\n    \"status\": \"responding\",\n    \"mission_id\": \"msn_e58e7523d2b5\",\n    \"mission_history\": [\n      \"msn_e58e7523d2b5\"\n    ],\n    \"time\": \"2026-10-19T21:33:03.000Z\",\n    \"title\": \"Motion at the east gate\",\n    \"description\": null,\n    \"media_url\": null,\n    \"data\": null,\n    \"received_by\": \"sensor:east-gate-pir-02\",\n    \"dismissed_by\": null,\n    \"resolved_at\": null,\n    \"created_at\": \"2026-10-19T21:33:03.882Z\",\n    \"updated_at\": \"2026-10-19T21:33:03.883Z\"\n  },\n  \"mission\": {\n    \"id\": \"msn_e58e7523d2b5\",\n    \"status\": \"en_route\",\n    \"vehicle_id\": \"drone-2\"\n  },\n  \"rule\": {\n    \"rule_id\": \"perimeter-motion\",\n    \"outcome\": \"mission_created\",\n    \"mission_id\": \"msn_e58e7523d2b5\",\n    \"mission_status\": \"en_route\"\n  }\n}"
            },
            {
              "name": "401 Bad signature",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/alerts",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "alerts"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"id\": \"pir02-{{$timestamp}}\",\n  \"source\": \"{{sensorId}}\",\n  \"type\": \"motion\",\n  \"priority\": \"high\",\n  \"title\": \"Motion at the east gate\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "auth": {
                  "type": "noauth"
                }
              },
              "status": "Unauthorized",
              "code": 401,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"invalid_signature\",\n    \"message\": \"The signature does not match the body. Nothing was recorded.\"\n  }\n}"
            },
            {
              "name": "404 Unknown sensor",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/alerts",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "alerts"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"id\": \"pir02-{{$timestamp}}\",\n  \"source\": \"{{sensorId}}\",\n  \"type\": \"motion\",\n  \"priority\": \"high\",\n  \"title\": \"Motion at the east gate\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "auth": {
                  "type": "noauth"
                }
              },
              "status": "Not Found",
              "code": 404,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"unknown_sensor\",\n    \"message\": \"No registered sensor with id 'no-such-sensor'.\"\n  }\n}"
            }
          ]
        },
        {
          "name": "List sensors",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/sensors?status=silent",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sensors"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "silent"
                }
              ]
            },
            "description": "Every registered sensor, with its status.\n\n**Access:** API key with `read`.\n\n**Query**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `status` | string | no | Only sensors in this status: `pending`, `online` or `silent`. |\n\n**Returns:** `{\"data\": [...]}` with a sensor for each."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/sensors?status=silent",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "sensors"
                  ],
                  "query": [
                    {
                      "key": "status",
                      "value": "silent"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"generator-yard-door-01\",\n      \"name\": \"Generator yard door\",\n      \"type\": \"door\",\n      \"location\": {\n        \"lat\": 38.4979,\n        \"lon\": -98.0047\n      },\n      \"zone_id\": \"generator-yard\",\n      \"checkin_interval_s\": 10.0,\n      \"missed_checkins_allowed\": 2,\n      \"status\": \"silent\",\n      \"last_seen\": \"2026-10-19T21:39:43.634Z\",\n      \"expires_at\": \"2026-10-19T21:40:03.634Z\",\n      \"battery_pct\": null,\n      \"reported_status\": null,\n      \"simulated\": true,\n      \"origin\": \"site\",\n      \"created_at\": \"2026-10-19T21:30:10.072Z\",\n      \"updated_at\": \"2026-10-19T21:40:03.755Z\"\n    }\n  ]\n}"
            }
          ]
        },
        {
          "name": "Get a sensor",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/sensors/{{sensorId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sensors",
                "{{sensorId}}"
              ]
            },
            "description": "One sensor, by id.\n\n**Access:** API key with `read`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `sensor_id` | string | yes | The sensor's id. |\n\n**Returns:** The sensor.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 404 | `not_found` | No sensor with this id. |"
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/sensors/{{sensorId}}",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "sensors",
                    "{{sensorId}}"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"east-gate-pir-02\",\n  \"name\": \"East gate motion sensor 2\",\n  \"type\": \"motion\",\n  \"location\": {\n    \"lat\": 38.5005,\n    \"lon\": -97.995\n  },\n  \"zone_id\": \"east-gate\",\n  \"checkin_interval_s\": 10.0,\n  \"missed_checkins_allowed\": 2,\n  \"status\": \"online\",\n  \"last_seen\": \"2026-10-19T21:33:03.876Z\",\n  \"expires_at\": \"2026-10-19T21:33:23.876Z\",\n  \"battery_pct\": 87.0,\n  \"reported_status\": \"ok\",\n  \"simulated\": false,\n  \"origin\": \"api\",\n  \"created_at\": \"2026-10-19T21:33:02.764Z\",\n  \"updated_at\": \"2026-10-19T21:33:03.876Z\"\n}"
            }
          ]
        },
        {
          "name": "Rotate a sensor's secret",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));",
                  "setVar('sensorSecret', j.secret);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/sensors/{{sensorId}}/rotate-secret",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sensors",
                "{{sensorId}}",
                "rotate-secret"
              ]
            },
            "description": "Gives the sensor a new secret. The old one stops working at once, so update the sensor right after. Use it when a secret may have leaked, or when you replace the device.\n\n**Access:** API key with `sensors:write`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `sensor_id` | string | yes | The sensor's id. |\n\n**Returns:** `200` with `sensor_id` and the new `secret`, shown once.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 404 | `not_found` | No sensor with this id. |"
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "POST",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/sensors/{{sensorId}}/rotate-secret",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "sensors",
                    "{{sensorId}}",
                    "rotate-secret"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"sensor_id\": \"east-gate-pir-02\",\n  \"secret\": \"ssk_test_example_secret_000000000002\"\n}"
            }
          ]
        },
        {
          "name": "Check in with the new secret",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Sign this request as the sensor: HMAC-SHA256 over \"<timestamp>.<body>\", keyed with {{sensorSecret}}.",
                  "const cryptoJs = require(\"crypto-js\");",
                  "const secret = pm.variables.get(\"sensorSecret\");",
                  "if (!secret) { throw new Error(\"Set sensorSecret first: send 'Register a sensor' or 'Rotate a sensor's secret'.\"); }",
                  "const body = pm.variables.replaceIn(pm.request.body && pm.request.body.raw ? pm.request.body.raw : \"\");",
                  "pm.request.body.update(body);  // send exactly the bytes we sign",
                  "const ts = Math.floor(Date.now() / 1000).toString();",
                  "const sig = cryptoJs.HmacSHA256(ts + \".\" + body, secret).toString(cryptoJs.enc.Hex);",
                  "pm.request.headers.upsert({ key: \"Ochio-Timestamp\", value: ts });",
                  "pm.request.headers.upsert({ key: \"Ochio-Signature\", value: \"v1=\" + sig });"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/sensors/{{sensorId}}/heartbeat",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sensors",
                "{{sensorId}}",
                "heartbeat"
              ]
            },
            "description": "The sensor's regular sign of life, signed with its secret. Send it every `checkin_interval_s` seconds. An alert from the sensor counts as a check-in too.\n\n**Access:** Signed by the sensor, or an API key with `alerts:write`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `sensor_id` | string | yes | The sensor's id. |\n\n**Headers**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `Ochio-Timestamp` | string | no | Unix time in whole seconds when the request was signed. Needed when a sensor signs the request. |\n| `Ochio-Signature` | string | no | `v1=` and the hex HMAC-SHA256 of the timestamp, a dot and the raw body, keyed with the sensor's secret. See Signing sensor requests. |\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `battery_pct` | number | no | The sensor's battery level, 0 to 100. |\n| `status` | string | no | The sensor's own health word, up to 32 characters: `ok`, `degraded`. |\n\n**Returns:** `200` with the sensor's `status`, `next_checkin_by` (when the next one is due) and `expires_at` (when it turns silent without one). A repeat of a request Ochio already counted answers `\"repeat\": true` and doesn't count again.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 401 | `invalid_signature` | The signature doesn't match. See Signing. |\n| 404 | `unknown_sensor` | A signed check-in for a sensor that isn't registered. |\n| 404 | `not_found` | The same, sent with an API key. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"battery_pct\": 87,\n  \"status\": \"ok\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "auth": {
              "type": "noauth"
            }
          },
          "response": [
            {
              "name": "200 Checked in",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/sensors/{{sensorId}}/heartbeat",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "sensors",
                    "{{sensorId}}",
                    "heartbeat"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"battery_pct\": 87,\n  \"status\": \"ok\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "auth": {
                  "type": "noauth"
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"sensor_id\": \"east-gate-pir-02\",\n  \"status\": \"online\",\n  \"next_checkin_by\": \"2026-10-19T21:33:12.770Z\",\n  \"expires_at\": \"2026-10-19T21:33:22.770Z\"\n}"
            },
            {
              "name": "200 Repeat",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/sensors/{{sensorId}}/heartbeat",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "sensors",
                    "{{sensorId}}",
                    "heartbeat"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"battery_pct\": 87,\n  \"status\": \"ok\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "auth": {
                  "type": "noauth"
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"sensor_id\": \"east-gate-pir-02\",\n  \"status\": \"online\",\n  \"next_checkin_by\": \"2026-10-19T21:33:12.770Z\",\n  \"expires_at\": \"2026-10-19T21:33:22.770Z\",\n  \"repeat\": true\n}"
            }
          ]
        },
        {
          "name": "Remove a sensor",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/sensors/{{sensorId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sensors",
                "{{sensorId}}"
              ]
            },
            "description": "Removes the sensor. Its alerts stay, and its secret stops working. A `sensor.removed` event goes out.\n\n**Access:** API key with `sensors:write`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `sensor_id` | string | yes | The sensor's id. |\n\n**Returns:** `200` with `{\"id\", \"deleted\": true}`.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 404 | `not_found` | No sensor with this id. |"
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "DELETE",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/sensors/{{sensorId}}",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "sensors",
                    "{{sensorId}}"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"east-gate-pir-02\",\n  \"deleted\": true\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Missions",
      "description": "A mission is a task for one vehicle. Rules, Mission Control, Claude and your own apps all start missions through the same endpoint, and every one of them passes the safety gate.",
      "item": [
        {
          "name": "Request a mission",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 201\", () => pm.expect([201]).to.include(pm.response.code));",
                  "if (j.id) setVar('missionId', j.id);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "Ochio-Client",
                "value": "postman"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/missions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "missions"
              ]
            },
            "description": "Asks Ochio to send a vehicle. The safety gate checks the request, the approval rules decide whether it waits for a person, and Ochio picks the vehicle unless you name one.\n\nSend an `Idempotency-Key` so a retry never starts a second drone.\n\n**Access:** API key with `missions:request`.\n\n**Headers**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `Idempotency-Key` | string | no | A unique key for this mission, up to 255 characters, like a UUID. The same key and body from the same API key within 24 hours returns the first answer, with `Idempotent-Replayed: true`, instead of starting another mission. |\n| `Ochio-Client` | string | no | The name of your app. Its first 40 characters are kept in `trigger.client`, so people can see where a mission came from. |\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | string | yes | `inspect` or `patrol`. |\n| `target` | object | yes | Exactly one of these: |\n| `target.location` | object | no | A point: `{\"lat\", \"lon\"}`. |\n| `target.sensor_id` | string | no | A registered sensor. |\n| `target.zone_id` | string | no | A zone. Required for a patrol. |\n| `target.alert_id` | string | no | An alert. The mission takes it. |\n| `approval` | string | no | `auto` launches when the gate and the key allow it; `ask` waits for a person. Default `auto`. |\n| `priority` | string | no | `low`, `medium`, `high` or `critical`. Default `medium`. |\n| `reason` | string | no | Why, in words, up to 500 characters. People see it in Mission Control and in the report. |\n| `vehicle_id` | string | no | A vehicle to use. Leave it out to let Ochio pick. |\n| `on_scene_s` | number | no | For `inspect`: seconds over the target, 1 to 600. Default: the site's setting (15). |\n\n**Returns:** `201` with the mission. Its `status` is `en_route` when a vehicle launched, `queued` when it waits for one, or `pending_approval`. A refused mission answers `422` instead, with the mission in `details.mission`.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 422 | `safety_check_failed` | The safety gate refused it; `details.failed_checks` says why. |\n| 400 | `invalid_target` | Not exactly one target, an id that doesn't exist, or a patrol without a zone. |\n| 400 | `invalid_vehicle` | `vehicle_id` doesn't exist. |\n| 400 | `invalid_request` | A field is missing or out of range. |\n| 409 | `idempotency_conflict` | The `Idempotency-Key` was used with a different body. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"patrol\",\n  \"target\": {\n    \"zone_id\": \"north-fence\"\n  },\n  \"priority\": \"medium\",\n  \"reason\": \"Evening patrol of the north fence\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "201 Created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "{{$guid}}"
                  },
                  {
                    "key": "Ochio-Client",
                    "value": "postman"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/missions",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "missions"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"type\": \"patrol\",\n  \"target\": {\n    \"zone_id\": \"north-fence\"\n  },\n  \"priority\": \"medium\",\n  \"reason\": \"Evening patrol of the north fence\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"msn_520f729ca856\",\n  \"type\": \"patrol\",\n  \"status\": \"en_route\",\n  \"priority\": \"medium\",\n  \"reason\": \"Evening patrol of the north fence\",\n  \"target\": {\n    \"kind\": \"zone\",\n    \"zone_id\": \"north-fence\",\n    \"location\": {\n      \"lat\": 38.5037001,\n      \"lon\": -98.0030001\n    },\n    \"name\": \"North fence\"\n  },\n  \"patrol_points\": [\n    {\n      \"lat\": 38.5025,\n      \"lon\": -98.0065\n    },\n    {\n      \"lat\": 38.5047,\n      \"lon\": -98.0065\n    },\n    {\n      \"lat\": 38.5049,\n      \"lon\": -97.9995\n    },\n    {\n      \"lat\": 38.5027,\n      \"lon\": -97.9995\n    }\n  ],\n  \"vehicle_id\": \"drone-1\",\n  \"requested_vehicle_id\": null,\n  \"requested_by\": \"key:operator\",\n  \"trigger\": {\n    \"kind\": \"request\",\n    \"rule_id\": null,\n    \"sensor_id\": null,\n    \"alert_ids\": [],\n    \"client\": \"night-desk\"\n  },\n  \"approval\": {\n    \"mode\": \"auto\",\n    \"required\": false,\n    \"reasons\": [],\n    \"decision\": null,\n    \"decided_by\": null,\n    \"decided_at\": null,\n    \"note\": null\n  },\n  \"safety\": {\n    \"result\": \"passed\",\n    \"checks\": [\n      {\n        \"name\": \"inside_operating_area\",\n        \"passed\": true,\n        \"detail\": \"Target is inside the Depot operating area.\"\n      },\n      {\n        \"name\": \"outside_no_fly_zones\",\n        \"passed\": true,\n        \"detail\": \"Target is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"vehicle_capable\",\n        \"passed\": true,\n        \"detail\": \"2 vehicles with a camera.\"\n      },\n      {\n        \"name\": \"path_clear\",\n        \"passed\": true,\n        \"detail\": \"The straight path from the dock is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"within_range\",\n        \"passed\": true,\n        \"detail\": \"Round trip 2.6 km is within Drone 2's 6.0 km range.\"\n      },\n      {\n        \"name\": \"battery\",\n        \"passed\": true,\n        \"detail\": \"Drone 1 has 100% battery.\"\n      }\n    ],\n    \"checked_at\": \"2026-10-19T21:33:07.207Z\"\n  },\n  \"on_scene_s\": 15.0,\n  \"progress\": {\n    \"phase\": \"en_route\",\n    \"distance_to_target_m\": 432,\n    \"eta_s\": 36,\n    \"battery_pct\": 100.0,\n    \"distance_flown_m\": 0,\n    \"detections\": 0\n  },\n  \"history\": [\n    {\n      \"status\": \"requested\",\n      \"time\": \"2026-10-19T21:33:07.207Z\",\n      \"actor\": \"key:operator\",\n      \"note\": \"Evening patrol of the north fence\"\n    },\n    {\n      \"status\": \"en_route\",\n      \"time\": \"2026-10-19T21:33:07.208Z\",\n      \"actor\": \"vehicle:drone-1\",\n      \"note\": \"Drone 1 launched\"\n    }\n  ],\n  \"alert_ids\": [],\n  \"detection_ids\": [],\n  \"result\": null,\n  \"report_id\": null,\n  \"track\": [\n    [\n      38.499,\n      -98.001\n    ]\n  ],\n  \"created_at\": \"2026-10-19T21:33:07.207Z\",\n  \"updated_at\": \"2026-10-19T21:33:07.207Z\",\n  \"started_at\": \"2026-10-19T21:33:07.208Z\",\n  \"ended_at\": null\n}"
            },
            {
              "name": "201 Waits for approval",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "{{$guid}}"
                  },
                  {
                    "key": "Ochio-Client",
                    "value": "postman"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/missions",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "missions"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"type\": \"patrol\",\n  \"target\": {\n    \"zone_id\": \"north-fence\"\n  },\n  \"priority\": \"medium\",\n  \"reason\": \"Evening patrol of the north fence\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"msn_ac7bd7106919\",\n  \"type\": \"inspect\",\n  \"status\": \"pending_approval\",\n  \"priority\": \"medium\",\n  \"reason\": \"Check the generator yard before the shift change\",\n  \"target\": {\n    \"kind\": \"zone\",\n    \"zone_id\": \"generator-yard\",\n    \"location\": {\n      \"lat\": 38.4976991,\n      \"lon\": -98.0047977\n    },\n    \"name\": \"Generator yard\"\n  },\n  \"patrol_points\": null,\n  \"vehicle_id\": null,\n  \"requested_vehicle_id\": null,\n  \"requested_by\": \"key:partner\",\n  \"trigger\": {\n    \"kind\": \"request\",\n    \"rule_id\": null,\n    \"sensor_id\": null,\n    \"alert_ids\": [],\n    \"client\": null\n  },\n  \"approval\": {\n    \"mode\": \"auto\",\n    \"required\": true,\n    \"reasons\": [\n      \"key:partner can request missions but not launch them\"\n    ],\n    \"decision\": null,\n    \"decided_by\": null,\n    \"decided_at\": null,\n    \"note\": null\n  },\n  \"safety\": {\n    \"result\": \"passed\",\n    \"checks\": [\n      {\n        \"name\": \"inside_operating_area\",\n        \"passed\": true,\n        \"detail\": \"Target is inside the Depot operating area.\"\n      },\n      {\n        \"name\": \"outside_no_fly_zones\",\n        \"passed\": true,\n        \"detail\": \"Target is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"vehicle_capable\",\n        \"passed\": true,\n        \"detail\": \"2 vehicles with a camera.\"\n      },\n      {\n        \"name\": \"path_clear\",\n        \"passed\": true,\n        \"detail\": \"The straight path from the dock is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"within_range\",\n        \"passed\": true,\n        \"detail\": \"Round trip 0.7 km is within Drone 1's 6.0 km range.\"\n      },\n      {\n        \"name\": \"battery\",\n        \"passed\": true,\n        \"detail\": \"Drone 1 has 100% battery.\"\n      }\n    ],\n    \"checked_at\": \"2026-10-19T21:33:07.212Z\"\n  },\n  \"on_scene_s\": 15.0,\n  \"progress\": {\n    \"phase\": \"pending_approval\"\n  },\n  \"history\": [\n    {\n      \"status\": \"requested\",\n      \"time\": \"2026-10-19T21:33:07.212Z\",\n      \"actor\": \"key:partner\",\n      \"note\": \"Check the generator yard before the shift change\"\n    },\n    {\n      \"status\": \"pending_approval\",\n      \"time\": \"2026-10-19T21:33:07.212Z\",\n      \"actor\": \"core\",\n      \"note\": \"key:partner can request missions but not launch them\"\n    }\n  ],\n  \"alert_ids\": [],\n  \"detection_ids\": [],\n  \"result\": null,\n  \"report_id\": null,\n  \"track\": [],\n  \"created_at\": \"2026-10-19T21:33:07.212Z\",\n  \"updated_at\": \"2026-10-19T21:33:07.212Z\",\n  \"started_at\": null,\n  \"ended_at\": null\n}"
            },
            {
              "name": "201 Replayed",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "{{$guid}}"
                  },
                  {
                    "key": "Ochio-Client",
                    "value": "postman"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/missions",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "missions"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"type\": \"patrol\",\n  \"target\": {\n    \"zone_id\": \"north-fence\"\n  },\n  \"priority\": \"medium\",\n  \"reason\": \"Evening patrol of the north fence\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                },
                {
                  "key": "Idempotent-Replayed",
                  "value": "true"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"msn_520f729ca856\",\n  \"type\": \"patrol\",\n  \"status\": \"en_route\",\n  \"priority\": \"medium\",\n  \"reason\": \"Evening patrol of the north fence\",\n  \"target\": {\n    \"kind\": \"zone\",\n    \"zone_id\": \"north-fence\",\n    \"location\": {\n      \"lat\": 38.5037001,\n      \"lon\": -98.0030001\n    },\n    \"name\": \"North fence\"\n  },\n  \"patrol_points\": [\n    {\n      \"lat\": 38.5025,\n      \"lon\": -98.0065\n    },\n    {\n      \"lat\": 38.5047,\n      \"lon\": -98.0065\n    },\n    {\n      \"lat\": 38.5049,\n      \"lon\": -97.9995\n    },\n    {\n      \"lat\": 38.5027,\n      \"lon\": -97.9995\n    }\n  ],\n  \"vehicle_id\": \"drone-1\",\n  \"requested_vehicle_id\": null,\n  \"requested_by\": \"key:operator\",\n  \"trigger\": {\n    \"kind\": \"request\",\n    \"rule_id\": null,\n    \"sensor_id\": null,\n    \"alert_ids\": [],\n    \"client\": \"night-desk\"\n  },\n  \"approval\": {\n    \"mode\": \"auto\",\n    \"required\": false,\n    \"reasons\": [],\n    \"decision\": null,\n    \"decided_by\": null,\n    \"decided_at\": null,\n    \"note\": null\n  },\n  \"safety\": {\n    \"result\": \"passed\",\n    \"checks\": [\n      {\n        \"name\": \"inside_operating_area\",\n        \"passed\": true,\n        \"detail\": \"Target is inside the Depot operating area.\"\n      },\n      {\n        \"name\": \"outside_no_fly_zones\",\n        \"passed\": true,\n        \"detail\": \"Target is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"vehicle_capable\",\n        \"passed\": true,\n        \"detail\": \"2 vehicles with a camera.\"\n      },\n      {\n        \"name\": \"path_clear\",\n        \"passed\": true,\n        \"detail\": \"The straight path from the dock is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"within_range\",\n        \"passed\": true,\n        \"detail\": \"Round trip 2.6 km is within Drone 2's 6.0 km range.\"\n      },\n      {\n        \"name\": \"battery\",\n        \"passed\": true,\n        \"detail\": \"Drone 1 has 100% battery.\"\n      }\n    ],\n    \"checked_at\": \"2026-10-19T21:33:07.207Z\"\n  },\n  \"on_scene_s\": 15.0,\n  \"progress\": {\n    \"phase\": \"en_route\",\n    \"distance_to_target_m\": 432,\n    \"eta_s\": 36,\n    \"battery_pct\": 100.0,\n    \"distance_flown_m\": 0,\n    \"detections\": 0\n  },\n  \"history\": [\n    {\n      \"status\": \"requested\",\n      \"time\": \"2026-10-19T21:33:07.207Z\",\n      \"actor\": \"key:operator\",\n      \"note\": \"Evening patrol of the north fence\"\n    },\n    {\n      \"status\": \"en_route\",\n      \"time\": \"2026-10-19T21:33:07.208Z\",\n      \"actor\": \"vehicle:drone-1\",\n      \"note\": \"Drone 1 launched\"\n    }\n  ],\n  \"alert_ids\": [],\n  \"detection_ids\": [],\n  \"result\": null,\n  \"report_id\": null,\n  \"track\": [\n    [\n      38.499,\n      -98.001\n    ]\n  ],\n  \"created_at\": \"2026-10-19T21:33:07.207Z\",\n  \"updated_at\": \"2026-10-19T21:33:07.207Z\",\n  \"started_at\": \"2026-10-19T21:33:07.208Z\",\n  \"ended_at\": null\n}"
            },
            {
              "name": "422 422 Refused",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "{{$guid}}"
                  },
                  {
                    "key": "Ochio-Client",
                    "value": "postman"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/missions",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "missions"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"type\": \"patrol\",\n  \"target\": {\n    \"zone_id\": \"north-fence\"\n  },\n  \"priority\": \"medium\",\n  \"reason\": \"Evening patrol of the north fence\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Unprocessable Content",
              "code": 422,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"safety_check_failed\",\n    \"message\": \"Refused by the safety gate: Target is inside the Fuel farm no-fly zone.\",\n    \"details\": {\n      \"mission_id\": \"msn_d6d5f719f173\",\n      \"failed_checks\": [\n        {\n          \"name\": \"outside_no_fly_zones\",\n          \"passed\": false,\n          \"detail\": \"Target is inside the Fuel farm no-fly zone.\"\n        }\n      ],\n      \"mission\": {\n        \"id\": \"msn_d6d5f719f173\",\n        \"type\": \"inspect\",\n        \"status\": \"rejected\",\n        \"priority\": \"medium\",\n        \"reason\": \"Check the fuel farm\",\n        \"target\": {\n          \"kind\": \"zone\",\n          \"zone_id\": \"fuel-farm\",\n          \"location\": {\n            \"lat\": 38.5004117,\n            \"lon\": -98.0068067\n          },\n          \"name\": \"Fuel farm\"\n        },\n        \"patrol_points\": null,\n        \"vehicle_id\": null,\n        \"requested_vehicle_id\": null,\n        \"requested_by\": \"key:operator\",\n        \"trigger\": {\n          \"kind\": \"request\",\n          \"rule_id\": null,\n          \"sensor_id\": null,\n          \"alert_ids\": [],\n          \"client\": null\n        },\n        \"approval\": {\n          \"mode\": \"auto\",\n          \"required\": false,\n          \"reasons\": [],\n          \"decision\": null,\n          \"decided_by\": null,\n          \"decided_at\": null,\n          \"note\": null\n        },\n        \"safety\": {\n          \"result\": \"refused\",\n          \"checks\": [\n            {\n              \"name\": \"inside_operating_area\",\n              \"passed\": true,\n              \"detail\": \"Target is inside the Depot operating area.\"\n            },\n            {\n              \"name\": \"outside_no_fly_zones\",\n              \"passed\": false,\n              \"detail\": \"Target is inside the Fuel farm no-fly zone.\"\n            },\n            {\n              \"name\": \"vehicle_capable\",\n              \"passed\": true,\n              \"detail\": \"2 vehicles with a camera.\"\n            },\n            {\n              \"name\": \"path_clear\",\n              \"passed\": null,\n              \"detail\": \"Not checked: the target is inside a no-fly zone.\"\n            },\n            {\n              \"name\": \"within_range\",\n              \"passed\": null,\n              \"detail\": \"Not checked: no clear path.\"\n            },\n            {\n              \"name\": \"battery\",\n              \"passed\": null,\n              \"detail\": \"Not checked: no vehicle can fly the route.\"\n            }\n          ],\n          \"checked_at\": \"2026-10-19T21:33:07.222Z\"\n        },\n        \"on_scene_s\": 15.0,\n        \"progress\": {\n          \"phase\": \"rejected\"\n        },\n        \"history\": [\n          {\n            \"status\": \"requested\",\n            \"time\": \"2026-10-19T21:33:07.222Z\",\n            \"actor\": \"key:operator\",\n            \"note\": \"Check the fuel farm\"\n          },\n          {\n            \"status\": \"rejected\",\n            \"time\": \"2026-10-19T21:33:07.222Z\",\n            \"actor\": \"core\",\n            \"note\": \"outside_no_fly_zones: Target is inside the Fuel farm no-fly zone.\"\n          }\n        ],\n        \"alert_ids\": [],\n        \"detection_ids\": [],\n        \"result\": {\n          \"outcome\": \"rejected\",\n          \"reason\": \"Refused by the safety gate\",\n          \"failed_checks\": [\n            \"outside_no_fly_zones\"\n          ]\n        },\n        \"report_id\": null,\n        \"track\": [],\n        \"created_at\": \"2026-10-19T21:33:07.222Z\",\n        \"updated_at\": \"2026-10-19T21:33:07.222Z\",\n        \"started_at\": null,\n        \"ended_at\": \"2026-10-19T21:33:07.222Z\"\n      }\n    }\n  }\n}"
            }
          ]
        },
        {
          "name": "Request a mission that waits for approval",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 201\", () => pm.expect([201]).to.include(pm.response.code));",
                  "if (j.id) setVar('pendingMissionId', j.id);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/missions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "missions"
              ]
            },
            "description": "Asks Ochio to send a vehicle. The safety gate checks the request, the approval rules decide whether it waits for a person, and Ochio picks the vehicle unless you name one.\n\nSend an `Idempotency-Key` so a retry never starts a second drone.\n\n**Access:** API key with `missions:request`.\n\n**Headers**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `Idempotency-Key` | string | no | A unique key for this mission, up to 255 characters, like a UUID. The same key and body from the same API key within 24 hours returns the first answer, with `Idempotent-Replayed: true`, instead of starting another mission. |\n| `Ochio-Client` | string | no | The name of your app. Its first 40 characters are kept in `trigger.client`, so people can see where a mission came from. |\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | string | yes | `inspect` or `patrol`. |\n| `target` | object | yes | Exactly one of these: |\n| `target.location` | object | no | A point: `{\"lat\", \"lon\"}`. |\n| `target.sensor_id` | string | no | A registered sensor. |\n| `target.zone_id` | string | no | A zone. Required for a patrol. |\n| `target.alert_id` | string | no | An alert. The mission takes it. |\n| `approval` | string | no | `auto` launches when the gate and the key allow it; `ask` waits for a person. Default `auto`. |\n| `priority` | string | no | `low`, `medium`, `high` or `critical`. Default `medium`. |\n| `reason` | string | no | Why, in words, up to 500 characters. People see it in Mission Control and in the report. |\n| `vehicle_id` | string | no | A vehicle to use. Leave it out to let Ochio pick. |\n| `on_scene_s` | number | no | For `inspect`: seconds over the target, 1 to 600. Default: the site's setting (15). |\n\n**Returns:** `201` with the mission. Its `status` is `en_route` when a vehicle launched, `queued` when it waits for one, or `pending_approval`. A refused mission answers `422` instead, with the mission in `details.mission`.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 422 | `safety_check_failed` | The safety gate refused it; `details.failed_checks` says why. |\n| 400 | `invalid_target` | Not exactly one target, an id that doesn't exist, or a patrol without a zone. |\n| 400 | `invalid_vehicle` | `vehicle_id` doesn't exist. |\n| 400 | `invalid_request` | A field is missing or out of range. |\n| 409 | `idempotency_conflict` | The `Idempotency-Key` was used with a different body. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"inspect\",\n  \"target\": {\n    \"location\": {\n      \"lat\": 38.4975,\n      \"lon\": -98.004\n    }\n  },\n  \"approval\": \"ask\",\n  \"priority\": \"low\",\n  \"reason\": \"Look at the parked trailer\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "201 Waits for approval",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/missions",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "missions"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"type\": \"inspect\",\n  \"target\": {\n    \"location\": {\n      \"lat\": 38.4975,\n      \"lon\": -98.004\n    }\n  },\n  \"approval\": \"ask\",\n  \"priority\": \"low\",\n  \"reason\": \"Look at the parked trailer\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"msn_1e2ffbc6d2f8\",\n  \"type\": \"inspect\",\n  \"status\": \"pending_approval\",\n  \"priority\": \"low\",\n  \"reason\": \"Look at the parked trailer\",\n  \"target\": {\n    \"kind\": \"location\",\n    \"location\": {\n      \"lat\": 38.4975,\n      \"lon\": -98.004\n    },\n    \"zone_id\": \"generator-yard\",\n    \"name\": \"38.49750, -98.00400\"\n  },\n  \"patrol_points\": null,\n  \"vehicle_id\": null,\n  \"requested_vehicle_id\": null,\n  \"requested_by\": \"key:operator\",\n  \"trigger\": {\n    \"kind\": \"request\",\n    \"rule_id\": null,\n    \"sensor_id\": null,\n    \"alert_ids\": [],\n    \"client\": null\n  },\n  \"approval\": {\n    \"mode\": \"ask\",\n    \"required\": true,\n    \"reasons\": [\n      \"the request asked for approval\"\n    ],\n    \"decision\": null,\n    \"decided_by\": null,\n    \"decided_at\": null,\n    \"note\": null\n  },\n  \"safety\": {\n    \"result\": \"passed\",\n    \"checks\": [\n      {\n        \"name\": \"inside_operating_area\",\n        \"passed\": true,\n        \"detail\": \"Target is inside the Depot operating area.\"\n      },\n      {\n        \"name\": \"outside_no_fly_zones\",\n        \"passed\": true,\n        \"detail\": \"Target is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"vehicle_capable\",\n        \"passed\": true,\n        \"detail\": \"2 vehicles with a camera.\"\n      },\n      {\n        \"name\": \"path_clear\",\n        \"passed\": true,\n        \"detail\": \"The straight path from the dock is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"within_range\",\n        \"passed\": true,\n        \"detail\": \"Round trip 0.6 km is within Drone 1's 6.0 km range.\"\n      },\n      {\n        \"name\": \"battery\",\n        \"passed\": true,\n        \"detail\": \"Drone 1 has 100% battery.\"\n      }\n    ],\n    \"checked_at\": \"2026-10-19T21:33:07.217Z\"\n  },\n  \"on_scene_s\": 15.0,\n  \"progress\": {\n    \"phase\": \"pending_approval\"\n  },\n  \"history\": [\n    {\n      \"status\": \"requested\",\n      \"time\": \"2026-10-19T21:33:07.217Z\",\n      \"actor\": \"key:operator\",\n      \"note\": \"Look at the parked trailer\"\n    },\n    {\n      \"status\": \"pending_approval\",\n      \"time\": \"2026-10-19T21:33:07.217Z\",\n      \"actor\": \"core\",\n      \"note\": \"the request asked for approval\"\n    }\n  ],\n  \"alert_ids\": [],\n  \"detection_ids\": [],\n  \"result\": null,\n  \"report_id\": null,\n  \"track\": [],\n  \"created_at\": \"2026-10-19T21:33:07.217Z\",\n  \"updated_at\": \"2026-10-19T21:33:07.217Z\",\n  \"started_at\": null,\n  \"ended_at\": null\n}"
            }
          ]
        },
        {
          "name": "Request a mission the safety gate refuses",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 422\", () => pm.expect([422]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/missions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "missions"
              ]
            },
            "description": "Asks Ochio to send a vehicle. The safety gate checks the request, the approval rules decide whether it waits for a person, and Ochio picks the vehicle unless you name one.\n\nSend an `Idempotency-Key` so a retry never starts a second drone.\n\n**Access:** API key with `missions:request`.\n\n**Headers**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `Idempotency-Key` | string | no | A unique key for this mission, up to 255 characters, like a UUID. The same key and body from the same API key within 24 hours returns the first answer, with `Idempotent-Replayed: true`, instead of starting another mission. |\n| `Ochio-Client` | string | no | The name of your app. Its first 40 characters are kept in `trigger.client`, so people can see where a mission came from. |\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `type` | string | yes | `inspect` or `patrol`. |\n| `target` | object | yes | Exactly one of these: |\n| `target.location` | object | no | A point: `{\"lat\", \"lon\"}`. |\n| `target.sensor_id` | string | no | A registered sensor. |\n| `target.zone_id` | string | no | A zone. Required for a patrol. |\n| `target.alert_id` | string | no | An alert. The mission takes it. |\n| `approval` | string | no | `auto` launches when the gate and the key allow it; `ask` waits for a person. Default `auto`. |\n| `priority` | string | no | `low`, `medium`, `high` or `critical`. Default `medium`. |\n| `reason` | string | no | Why, in words, up to 500 characters. People see it in Mission Control and in the report. |\n| `vehicle_id` | string | no | A vehicle to use. Leave it out to let Ochio pick. |\n| `on_scene_s` | number | no | For `inspect`: seconds over the target, 1 to 600. Default: the site's setting (15). |\n\n**Returns:** `201` with the mission. Its `status` is `en_route` when a vehicle launched, `queued` when it waits for one, or `pending_approval`. A refused mission answers `422` instead, with the mission in `details.mission`.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 422 | `safety_check_failed` | The safety gate refused it; `details.failed_checks` says why. |\n| 400 | `invalid_target` | Not exactly one target, an id that doesn't exist, or a patrol without a zone. |\n| 400 | `invalid_vehicle` | `vehicle_id` doesn't exist. |\n| 400 | `invalid_request` | A field is missing or out of range. |\n| 409 | `idempotency_conflict` | The `Idempotency-Key` was used with a different body. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"inspect\",\n  \"target\": {\n    \"zone_id\": \"fuel-farm\"\n  },\n  \"reason\": \"Check the fuel farm\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "422 Refused",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/missions",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "missions"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"type\": \"inspect\",\n  \"target\": {\n    \"zone_id\": \"fuel-farm\"\n  },\n  \"reason\": \"Check the fuel farm\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Unprocessable Content",
              "code": 422,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"safety_check_failed\",\n    \"message\": \"Refused by the safety gate: Target is inside the Fuel farm no-fly zone.\",\n    \"details\": {\n      \"mission_id\": \"msn_d6d5f719f173\",\n      \"failed_checks\": [\n        {\n          \"name\": \"outside_no_fly_zones\",\n          \"passed\": false,\n          \"detail\": \"Target is inside the Fuel farm no-fly zone.\"\n        }\n      ],\n      \"mission\": {\n        \"id\": \"msn_d6d5f719f173\",\n        \"type\": \"inspect\",\n        \"status\": \"rejected\",\n        \"priority\": \"medium\",\n        \"reason\": \"Check the fuel farm\",\n        \"target\": {\n          \"kind\": \"zone\",\n          \"zone_id\": \"fuel-farm\",\n          \"location\": {\n            \"lat\": 38.5004117,\n            \"lon\": -98.0068067\n          },\n          \"name\": \"Fuel farm\"\n        },\n        \"patrol_points\": null,\n        \"vehicle_id\": null,\n        \"requested_vehicle_id\": null,\n        \"requested_by\": \"key:operator\",\n        \"trigger\": {\n          \"kind\": \"request\",\n          \"rule_id\": null,\n          \"sensor_id\": null,\n          \"alert_ids\": [],\n          \"client\": null\n        },\n        \"approval\": {\n          \"mode\": \"auto\",\n          \"required\": false,\n          \"reasons\": [],\n          \"decision\": null,\n          \"decided_by\": null,\n          \"decided_at\": null,\n          \"note\": null\n        },\n        \"safety\": {\n          \"result\": \"refused\",\n          \"checks\": [\n            {\n              \"name\": \"inside_operating_area\",\n              \"passed\": true,\n              \"detail\": \"Target is inside the Depot operating area.\"\n            },\n            {\n              \"name\": \"outside_no_fly_zones\",\n              \"passed\": false,\n              \"detail\": \"Target is inside the Fuel farm no-fly zone.\"\n            },\n            {\n              \"name\": \"vehicle_capable\",\n              \"passed\": true,\n              \"detail\": \"2 vehicles with a camera.\"\n            },\n            {\n              \"name\": \"path_clear\",\n              \"passed\": null,\n              \"detail\": \"Not checked: the target is inside a no-fly zone.\"\n            },\n            {\n              \"name\": \"within_range\",\n              \"passed\": null,\n              \"detail\": \"Not checked: no clear path.\"\n            },\n            {\n              \"name\": \"battery\",\n              \"passed\": null,\n              \"detail\": \"Not checked: no vehicle can fly the route.\"\n            }\n          ],\n          \"checked_at\": \"2026-10-19T21:33:07.222Z\"\n        },\n        \"on_scene_s\": 15.0,\n        \"progress\": {\n          \"phase\": \"rejected\"\n        },\n        \"history\": [\n          {\n            \"status\": \"requested\",\n            \"time\": \"2026-10-19T21:33:07.222Z\",\n            \"actor\": \"key:operator\",\n            \"note\": \"Check the fuel farm\"\n          },\n          {\n            \"status\": \"rejected\",\n            \"time\": \"2026-10-19T21:33:07.222Z\",\n            \"actor\": \"core\",\n            \"note\": \"outside_no_fly_zones: Target is inside the Fuel farm no-fly zone.\"\n          }\n        ],\n        \"alert_ids\": [],\n        \"detection_ids\": [],\n        \"result\": {\n          \"outcome\": \"rejected\",\n          \"reason\": \"Refused by the safety gate\",\n          \"failed_checks\": [\n            \"outside_no_fly_zones\"\n          ]\n        },\n        \"report_id\": null,\n        \"track\": [],\n        \"created_at\": \"2026-10-19T21:33:07.222Z\",\n        \"updated_at\": \"2026-10-19T21:33:07.222Z\",\n        \"started_at\": null,\n        \"ended_at\": \"2026-10-19T21:33:07.222Z\"\n      }\n    }\n  }\n}"
            }
          ]
        },
        {
          "name": "List missions",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/missions?status=active",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "missions"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "active"
                }
              ]
            },
            "description": "Missions, newest first.\n\n**Access:** API key with `read`.\n\n**Query**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `status` | string | no | One status, `active` (waiting, queued or flying) or `final` (ended). |\n| `limit` | integer | no | How many to return, 1 to 1,000. Default 100. |\n\n**Returns:** `{\"data\": [...]}` with a mission for each."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/missions?status=active",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "missions"
                  ],
                  "query": [
                    {
                      "key": "status",
                      "value": "active"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"msn_ac7bd7106919\",\n      \"type\": \"inspect\",\n      \"status\": \"queued\",\n      \"priority\": \"medium\",\n      \"reason\": \"Check the generator yard before the shift change\",\n      \"target\": {\n        \"kind\": \"zone\",\n        \"zone_id\": \"generator-yard\",\n        \"location\": {\n          \"lat\": 38.4976991,\n          \"lon\": -98.0047977\n        },\n        \"name\": \"Generator yard\"\n      },\n      \"patrol_points\": null,\n      \"vehicle_id\": null,\n      \"requested_vehicle_id\": null,\n      \"requested_by\": \"key:partner\",\n      \"trigger\": {\n        \"kind\": \"request\",\n        \"rule_id\": null,\n        \"sensor_id\": null,\n        \"alert_ids\": [],\n        \"client\": null\n      },\n      \"approval\": {\n        \"mode\": \"auto\",\n        \"required\": true,\n        \"reasons\": [\n          \"key:partner can request missions but not launch them\"\n        ],\n        \"decision\": \"approved\",\n        \"decided_by\": \"key:operator\",\n        \"decided_at\": \"2026-10-19T21:33:07.215Z\",\n        \"note\": \"Go ahead\"\n      },\n      \"safety\": {\n        \"result\": \"passed\",\n        \"checks\": [\n          {\n            \"name\": \"inside_operating_area\",\n            \"passed\": true,\n            \"detail\": \"Target is inside the Depot operating area.\"\n          },\n          {\n            \"name\": \"outside_no_fly_zones\",\n            \"passed\": true,\n            \"detail\": \"Target is clear of no-fly zones.\"\n          },\n          {\n            \"name\": \"vehicle_capable\",\n            \"passed\": true,\n            \"detail\": \"2 vehicles with a camera.\"\n          },\n          {\n            \"name\": \"path_clear\",\n            \"passed\": true,\n            \"detail\": \"The straight path from the dock is clear of no-fly zones.\"\n          },\n          {\n            \"name\": \"within_range\",\n            \"passed\": true,\n            \"detail\": \"Round trip 0.7 km is within Drone 1's 6.0 km range.\"\n          },\n          {\n            \"name\": \"battery\",\n            \"passed\": true,\n            \"detail\": \"Drone 1 has 100% battery.\"\n          }\n        ],\n        \"checked_at\": \"2026-10-19T21:33:07.215Z\"\n      },\n      \"on_scene_s\": 15.0,\n      \"progress\": {\n        \"phase\": \"queued\",\n        \"waiting_for\": \"vehicle\",\n        \"detail\": \"Waiting for a free vehicle.\"\n      },\n      \"history\": [\n        {\n          \"status\": \"requested\",\n          \"time\": \"2026-10-19T21:33:07.212Z\",\n          \"actor\": \"key:partner\",\n          \"note\": \"Check the generator yard before the shift change\"\n        },\n        {\n          \"status\": \"pending_approval\",\n          \"time\": \"2026-10-19T21:33:07.212Z\",\n          \"actor\": \"core\",\n          \"note\": \"key:partner can request missions but not launch them\"\n        },\n        {\n          \"status\": \"queued\",\n          \"time\": \"2026-10-19T21:33:07.216Z\",\n          \"actor\": \"key:operator\",\n          \"note\": \"Approved: Go ahead. Waiting for a free vehicle.\"\n        }\n      ],\n      \"alert_ids\": [],\n      \"detection_ids\": [],\n      \"result\": null,\n      \"report_id\": null,\n      \"track\": [],\n      \"created_at\": \"2026-10-19T21:33:07.212Z\",\n      \"updated_at\": \"2026-10-19T21:33:07.216Z\",\n      \"started_at\": null,\n      \"ended_at\": null\n    },\n    {\n      \"id\": \"msn_520f729ca856\",\n      \"type\": \"patrol\",\n      \"status\": \"en_route\",\n      \"priority\": \"medium\",\n      \"reason\": \"Evening patrol of the north fence\",\n      \"target\": {\n        \"kind\": \"zone\",\n        \"zone_id\": \"north-fence\",\n        \"location\": {\n          \"lat\": 38.5037001,\n          \"lon\": -98.0030001\n        },\n        \"name\": \"North fence\"\n      },\n      \"patrol_points\": [\n        {\n          \"lat\": 38.5025,\n          \"lon\": -98.0065\n        },\n        {\n          \"lat\": 38.5047,\n          \"lon\": -98.0065\n        },\n        {\n          \"lat\": 38.5049,\n          \"lon\": -97.9995\n        },\n        {\n          \"lat\": 38.5027,\n          \"lon\": -97.9995\n        }\n      ],\n      \"vehicle_id\": \"drone-1\",\n      \"requested_vehicle_id\": null,\n      \"requested_by\": \"key:operator\",\n      \"trigger\": {\n        \"kind\": \"request\",\n        \"rule_id\": null,\n        \"sensor_id\": null,\n        \"alert_ids\": [],\n        \"client\": \"night-desk\"\n      },\n      \"approval\": {\n        \"mode\": \"auto\",\n        \"required\": false,\n        \"reasons\": [],\n        \"decision\": null,\n        \"decided_by\": null,\n        \"decided_at\": null,\n        \"note\": null\n      },\n      \"safety\": {\n        \"result\": \"passed\",\n        \"checks\": [\n          {\n            \"name\": \"inside_operating_area\",\n            \"passed\": true,\n            \"detail\": \"Target is inside the Depot operating area.\"\n          },\n          {\n            \"name\": \"outside_no_fly_zones\",\n            \"passed\": true,\n            \"detail\": \"Target is clear of no-fly zones.\"\n          },\n          {\n            \"name\": \"vehicle_capable\",\n            \"passed\": true,\n            \"detail\": \"2 vehicles with a camera.\"\n          },\n          {\n            \"name\": \"path_clear\",\n            \"passed\": true,\n            \"detail\": \"The straight path from the dock is clear of no-fly zones.\"\n          },\n          {\n            \"name\": \"within_range\",\n            \"passed\": true,\n            \"detail\": \"Round trip 2.6 km is within Drone 2's 6.0 km range.\"\n          },\n          {\n            \"name\": \"battery\",\n            \"passed\": true,\n            \"detail\": \"Drone 1 has 100% battery.\"\n          }\n        ],\n        \"checked_at\": \"2026-10-19T21:33:07.207Z\"\n      },\n      \"on_scene_s\": 15.0,\n      \"progress\": {\n        \"phase\": \"en_route\",\n        \"distance_to_target_m\": 432,\n        \"eta_s\": 36,\n        \"battery_pct\": 100.0,\n        \"distance_flown_m\": 0,\n        \"detections\": 0\n      },\n      \"history\": [\n        {\n          \"status\": \"requested\",\n          \"time\": \"2026-10-19T21:33:07.207Z\",\n          \"actor\": \"key:operator\",\n          \"note\": \"Evening patrol of the north fence\"\n        },\n        {\n          \"status\": \"en_route\",\n          \"time\": \"2026-10-19T21:33:07.208Z\",\n          \"actor\": \"vehicle:drone-1\",\n          \"note\": \"Drone 1 launched\"\n        }\n      ],\n      \"alert_ids\": [],\n      \"detection_ids\": [],\n      \"result\": null,\n      \"report_id\": null,\n      \"track\": [\n        [\n          38.499,\n          -98.001\n        ]\n      ],\n      \"created_at\": \"2026-10-19T21:33:07.207Z\",\n      \"updated_at\": \"2026-10-19T21:33:07.207Z\",\n      \"started_at\": \"2026-10-19T21:33:07.208Z\",\n      \"ended_at\": null\n    }\n  ]\n}"
            }
          ]
        },
        {
          "name": "Get a mission",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));",
                  "if (j.report_id) setVar('reportId', j.report_id);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/missions/{{missionId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "missions",
                "{{missionId}}"
              ]
            },
            "description": "One mission, with its live progress.\n\n**Access:** API key with `read`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `mission_id` | string | yes | The mission's id, `msn_…`. |\n\n**Returns:** The mission.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 404 | `not_found` | No mission with this id. |"
          },
          "response": [
            {
              "name": "200 En route",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/missions/{{missionId}}",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "missions",
                    "{{missionId}}"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"msn_e58e7523d2b5\",\n  \"type\": \"inspect\",\n  \"status\": \"en_route\",\n  \"priority\": \"high\",\n  \"reason\": \"Motion on the perimeter: motion from East gate motion sensor 2\",\n  \"target\": {\n    \"kind\": \"alert\",\n    \"alert_id\": \"alt_5037deb6aeee\",\n    \"sensor_id\": \"east-gate-pir-02\",\n    \"location\": {\n      \"lat\": 38.5005,\n      \"lon\": -97.995\n    },\n    \"zone_id\": \"east-gate\",\n    \"name\": \"East gate motion sensor 2\"\n  },\n  \"patrol_points\": null,\n  \"vehicle_id\": \"drone-2\",\n  \"requested_vehicle_id\": null,\n  \"requested_by\": \"rule:perimeter-motion\",\n  \"trigger\": {\n    \"kind\": \"alert\",\n    \"rule_id\": \"perimeter-motion\",\n    \"sensor_id\": \"east-gate-pir-02\",\n    \"alert_ids\": [\n      \"alt_5037deb6aeee\"\n    ]\n  },\n  \"approval\": {\n    \"mode\": \"auto\",\n    \"required\": false,\n    \"reasons\": [],\n    \"decision\": null,\n    \"decided_by\": null,\n    \"decided_at\": null,\n    \"note\": null\n  },\n  \"safety\": {\n    \"result\": \"passed\",\n    \"checks\": [\n      {\n        \"name\": \"inside_operating_area\",\n        \"passed\": true,\n        \"detail\": \"Target is inside the Depot operating area.\"\n      },\n      {\n        \"name\": \"outside_no_fly_zones\",\n        \"passed\": true,\n        \"detail\": \"Target is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"vehicle_capable\",\n        \"passed\": true,\n        \"detail\": \"2 vehicles with a camera.\"\n      },\n      {\n        \"name\": \"path_clear\",\n        \"passed\": true,\n        \"detail\": \"The straight path from the dock is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"within_range\",\n        \"passed\": true,\n        \"detail\": \"Round trip 1.0 km is within Drone 2's 6.0 km range.\"\n      },\n      {\n        \"name\": \"battery\",\n        \"passed\": true,\n        \"detail\": \"Drone 1 has 100% battery.\"\n      }\n    ],\n    \"checked_at\": \"2026-10-19T21:33:03.883Z\"\n  },\n  \"on_scene_s\": 15.0,\n  \"progress\": {\n    \"phase\": \"en_route\",\n    \"distance_to_target_m\": 482,\n    \"eta_s\": 40,\n    \"battery_pct\": 99.7,\n    \"distance_flown_m\": 41,\n    \"detections\": 0\n  },\n  \"history\": [\n    {\n      \"status\": \"requested\",\n      \"time\": \"2026-10-19T21:33:03.883Z\",\n      \"actor\": \"rule:perimeter-motion\",\n      \"note\": \"Motion on the perimeter: motion from East gate motion sensor 2\"\n    },\n    {\n      \"status\": \"en_route\",\n      \"time\": \"2026-10-19T21:33:03.883Z\",\n      \"actor\": \"vehicle:drone-2\",\n      \"note\": \"Drone 2 launched\"\n    }\n  ],\n  \"alert_ids\": [\n    \"alt_5037deb6aeee\"\n  ],\n  \"detection_ids\": [],\n  \"result\": null,\n  \"report_id\": null,\n  \"track\": [\n    [\n      38.499,\n      -98.0007\n    ],\n    [\n      38.4990346,\n      -98.0005684\n    ],\n    [\n      38.4990693,\n      -98.0004368\n    ]\n  ],\n  \"created_at\": \"2026-10-19T21:33:03.883Z\",\n  \"updated_at\": \"2026-10-19T21:33:03.883Z\",\n  \"started_at\": \"2026-10-19T21:33:03.883Z\",\n  \"ended_at\": null\n}"
            }
          ]
        },
        {
          "name": "Approve a mission",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/missions/{{pendingMissionId}}/approve",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "missions",
                "{{pendingMissionId}}",
                "approve"
              ]
            },
            "description": "Approves a mission waiting in `pending_approval`. The safety gate checks it again, then a ready vehicle launches, or it waits in `queued`.\n\n**Access:** API key with `missions:approve`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `mission_id` | string | yes | The mission's id. |\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `note` | string | no | A short note kept with the decision, up to 500 characters. |\n\n**Returns:** The mission: `en_route`, `queued`, or `rejected` if the gate now refuses it.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 409 | `invalid_state` | It isn't waiting for approval. |\n| 403 | `missing_scope` | The key lacks `missions:approve`. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"note\": \"Go ahead\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 Approved, queued",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/missions/{{pendingMissionId}}/approve",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "missions",
                    "{{pendingMissionId}}",
                    "approve"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"note\": \"Go ahead\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"msn_ac7bd7106919\",\n  \"type\": \"inspect\",\n  \"status\": \"queued\",\n  \"priority\": \"medium\",\n  \"reason\": \"Check the generator yard before the shift change\",\n  \"target\": {\n    \"kind\": \"zone\",\n    \"zone_id\": \"generator-yard\",\n    \"location\": {\n      \"lat\": 38.4976991,\n      \"lon\": -98.0047977\n    },\n    \"name\": \"Generator yard\"\n  },\n  \"patrol_points\": null,\n  \"vehicle_id\": null,\n  \"requested_vehicle_id\": null,\n  \"requested_by\": \"key:partner\",\n  \"trigger\": {\n    \"kind\": \"request\",\n    \"rule_id\": null,\n    \"sensor_id\": null,\n    \"alert_ids\": [],\n    \"client\": null\n  },\n  \"approval\": {\n    \"mode\": \"auto\",\n    \"required\": true,\n    \"reasons\": [\n      \"key:partner can request missions but not launch them\"\n    ],\n    \"decision\": \"approved\",\n    \"decided_by\": \"key:operator\",\n    \"decided_at\": \"2026-10-19T21:33:07.215Z\",\n    \"note\": \"Go ahead\"\n  },\n  \"safety\": {\n    \"result\": \"passed\",\n    \"checks\": [\n      {\n        \"name\": \"inside_operating_area\",\n        \"passed\": true,\n        \"detail\": \"Target is inside the Depot operating area.\"\n      },\n      {\n        \"name\": \"outside_no_fly_zones\",\n        \"passed\": true,\n        \"detail\": \"Target is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"vehicle_capable\",\n        \"passed\": true,\n        \"detail\": \"2 vehicles with a camera.\"\n      },\n      {\n        \"name\": \"path_clear\",\n        \"passed\": true,\n        \"detail\": \"The straight path from the dock is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"within_range\",\n        \"passed\": true,\n        \"detail\": \"Round trip 0.7 km is within Drone 1's 6.0 km range.\"\n      },\n      {\n        \"name\": \"battery\",\n        \"passed\": true,\n        \"detail\": \"Drone 1 has 100% battery.\"\n      }\n    ],\n    \"checked_at\": \"2026-10-19T21:33:07.215Z\"\n  },\n  \"on_scene_s\": 15.0,\n  \"progress\": {\n    \"phase\": \"queued\",\n    \"waiting_for\": \"vehicle\",\n    \"detail\": \"Waiting for a free vehicle.\"\n  },\n  \"history\": [\n    {\n      \"status\": \"requested\",\n      \"time\": \"2026-10-19T21:33:07.212Z\",\n      \"actor\": \"key:partner\",\n      \"note\": \"Check the generator yard before the shift change\"\n    },\n    {\n      \"status\": \"pending_approval\",\n      \"time\": \"2026-10-19T21:33:07.212Z\",\n      \"actor\": \"core\",\n      \"note\": \"key:partner can request missions but not launch them\"\n    },\n    {\n      \"status\": \"queued\",\n      \"time\": \"2026-10-19T21:33:07.216Z\",\n      \"actor\": \"key:operator\",\n      \"note\": \"Approved: Go ahead. Waiting for a free vehicle.\"\n    }\n  ],\n  \"alert_ids\": [],\n  \"detection_ids\": [],\n  \"result\": null,\n  \"report_id\": null,\n  \"track\": [],\n  \"created_at\": \"2026-10-19T21:33:07.212Z\",\n  \"updated_at\": \"2026-10-19T21:33:07.216Z\",\n  \"started_at\": null,\n  \"ended_at\": null\n}"
            },
            {
              "name": "409 Not waiting",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/missions/{{pendingMissionId}}/approve",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "missions",
                    "{{pendingMissionId}}",
                    "approve"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"note\": \"Go ahead\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Conflict",
              "code": 409,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"invalid_state\",\n    \"message\": \"Mission msn_1e2ffbc6d2f8 is denied; only missions waiting for approval can be approved.\"\n  }\n}"
            },
            {
              "name": "403 Missing scope",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/missions/{{pendingMissionId}}/approve",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "missions",
                    "{{pendingMissionId}}",
                    "approve"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"note\": \"Go ahead\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Forbidden",
              "code": 403,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"missing_scope\",\n    \"message\": \"This key does not have the missions:approve scope.\",\n    \"details\": {\n      \"required_scope\": \"missions:approve\"\n    }\n  }\n}"
            }
          ]
        },
        {
          "name": "Deny a mission",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 409\", () => pm.expect([409]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/missions/{{pendingMissionId}}/deny",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "missions",
                "{{pendingMissionId}}",
                "deny"
              ]
            },
            "description": "Turns down a mission waiting in `pending_approval`. Its alerts go back to `open`, and a short report records the decision.\n\n**Access:** API key with `missions:approve`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `mission_id` | string | yes | The mission's id. |\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `note` | string | no | A short note kept with the decision, up to 500 characters. |\n\n**Returns:** The mission, now `denied`.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 409 | `invalid_state` | It isn't waiting for approval. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"note\": \"The trailer is expected\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 Denied",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/missions/{{pendingMissionId}}/deny",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "missions",
                    "{{pendingMissionId}}",
                    "deny"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"note\": \"The trailer is expected\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"msn_1e2ffbc6d2f8\",\n  \"type\": \"inspect\",\n  \"status\": \"denied\",\n  \"priority\": \"low\",\n  \"reason\": \"Look at the parked trailer\",\n  \"target\": {\n    \"kind\": \"location\",\n    \"location\": {\n      \"lat\": 38.4975,\n      \"lon\": -98.004\n    },\n    \"zone_id\": \"generator-yard\",\n    \"name\": \"38.49750, -98.00400\"\n  },\n  \"patrol_points\": null,\n  \"vehicle_id\": null,\n  \"requested_vehicle_id\": null,\n  \"requested_by\": \"key:operator\",\n  \"trigger\": {\n    \"kind\": \"request\",\n    \"rule_id\": null,\n    \"sensor_id\": null,\n    \"alert_ids\": [],\n    \"client\": null\n  },\n  \"approval\": {\n    \"mode\": \"ask\",\n    \"required\": true,\n    \"reasons\": [\n      \"the request asked for approval\"\n    ],\n    \"decision\": \"denied\",\n    \"decided_by\": \"key:operator\",\n    \"decided_at\": \"2026-10-19T21:33:07.219Z\",\n    \"note\": \"The trailer is expected\"\n  },\n  \"safety\": {\n    \"result\": \"passed\",\n    \"checks\": [\n      {\n        \"name\": \"inside_operating_area\",\n        \"passed\": true,\n        \"detail\": \"Target is inside the Depot operating area.\"\n      },\n      {\n        \"name\": \"outside_no_fly_zones\",\n        \"passed\": true,\n        \"detail\": \"Target is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"vehicle_capable\",\n        \"passed\": true,\n        \"detail\": \"2 vehicles with a camera.\"\n      },\n      {\n        \"name\": \"path_clear\",\n        \"passed\": true,\n        \"detail\": \"The straight path from the dock is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"within_range\",\n        \"passed\": true,\n        \"detail\": \"Round trip 0.6 km is within Drone 1's 6.0 km range.\"\n      },\n      {\n        \"name\": \"battery\",\n        \"passed\": true,\n        \"detail\": \"Drone 1 has 100% battery.\"\n      }\n    ],\n    \"checked_at\": \"2026-10-19T21:33:07.217Z\"\n  },\n  \"on_scene_s\": 15.0,\n  \"progress\": {\n    \"phase\": \"denied\"\n  },\n  \"history\": [\n    {\n      \"status\": \"requested\",\n      \"time\": \"2026-10-19T21:33:07.217Z\",\n      \"actor\": \"key:operator\",\n      \"note\": \"Look at the parked trailer\"\n    },\n    {\n      \"status\": \"pending_approval\",\n      \"time\": \"2026-10-19T21:33:07.217Z\",\n      \"actor\": \"core\",\n      \"note\": \"the request asked for approval\"\n    },\n    {\n      \"status\": \"denied\",\n      \"time\": \"2026-10-19T21:33:07.219Z\",\n      \"actor\": \"key:operator\",\n      \"note\": \"key:operator denied the request (The trailer is expected)\"\n    }\n  ],\n  \"alert_ids\": [],\n  \"detection_ids\": [],\n  \"result\": {\n    \"outcome\": \"denied\",\n    \"reason\": \"key:operator denied the request (The trailer is expected)\",\n    \"detections\": 0,\n    \"battery_end_pct\": null,\n    \"distance_flown_m\": 0,\n    \"report_id\": \"rpt_7e62e7adef23\"\n  },\n  \"report_id\": \"rpt_7e62e7adef23\",\n  \"track\": [],\n  \"created_at\": \"2026-10-19T21:33:07.217Z\",\n  \"updated_at\": \"2026-10-19T21:33:07.219Z\",\n  \"started_at\": null,\n  \"ended_at\": \"2026-10-19T21:33:07.219Z\"\n}"
            },
            {
              "name": "409 Not waiting",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/missions/{{pendingMissionId}}/deny",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "missions",
                    "{{pendingMissionId}}",
                    "deny"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"note\": \"The trailer is expected\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Conflict",
              "code": 409,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"invalid_state\",\n    \"message\": \"Mission msn_1e2ffbc6d2f8 is denied; only missions waiting for approval can be approved.\"\n  }\n}"
            }
          ]
        },
        {
          "name": "Cancel a mission",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200 or 409\", () => pm.expect([200, 409]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/missions/{{missionId}}/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "missions",
                "{{missionId}}",
                "cancel"
              ]
            },
            "description": "Stops a mission that hasn't ended, whatever its status. A flying vehicle heads home. Its alerts go back to `open`, and a report records what the drone saw before.\n\n**Access:** API key with `missions:approve`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `mission_id` | string | yes | The mission's id. |\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `note` | string | no | A short note kept with the decision, up to 500 characters. |\n\n**Returns:** The mission, now `cancelled`, with its `result` and `report_id`.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 409 | `invalid_state` | It has already ended. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"note\": \"Guard is walking the fence\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 Cancelled",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/missions/{{missionId}}/cancel",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "missions",
                    "{{missionId}}",
                    "cancel"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"note\": \"Guard is walking the fence\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"msn_520f729ca856\",\n  \"type\": \"patrol\",\n  \"status\": \"cancelled\",\n  \"priority\": \"medium\",\n  \"reason\": \"Evening patrol of the north fence\",\n  \"target\": {\n    \"kind\": \"zone\",\n    \"zone_id\": \"north-fence\",\n    \"location\": {\n      \"lat\": 38.5037001,\n      \"lon\": -98.0030001\n    },\n    \"name\": \"North fence\"\n  },\n  \"patrol_points\": [\n    {\n      \"lat\": 38.5025,\n      \"lon\": -98.0065\n    },\n    {\n      \"lat\": 38.5047,\n      \"lon\": -98.0065\n    },\n    {\n      \"lat\": 38.5049,\n      \"lon\": -97.9995\n    },\n    {\n      \"lat\": 38.5027,\n      \"lon\": -97.9995\n    }\n  ],\n  \"vehicle_id\": \"drone-1\",\n  \"requested_vehicle_id\": null,\n  \"requested_by\": \"key:operator\",\n  \"trigger\": {\n    \"kind\": \"request\",\n    \"rule_id\": null,\n    \"sensor_id\": null,\n    \"alert_ids\": [],\n    \"client\": \"night-desk\"\n  },\n  \"approval\": {\n    \"mode\": \"auto\",\n    \"required\": false,\n    \"reasons\": [],\n    \"decision\": null,\n    \"decided_by\": null,\n    \"decided_at\": null,\n    \"note\": null\n  },\n  \"safety\": {\n    \"result\": \"passed\",\n    \"checks\": [\n      {\n        \"name\": \"inside_operating_area\",\n        \"passed\": true,\n        \"detail\": \"Target is inside the Depot operating area.\"\n      },\n      {\n        \"name\": \"outside_no_fly_zones\",\n        \"passed\": true,\n        \"detail\": \"Target is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"vehicle_capable\",\n        \"passed\": true,\n        \"detail\": \"2 vehicles with a camera.\"\n      },\n      {\n        \"name\": \"path_clear\",\n        \"passed\": true,\n        \"detail\": \"The straight path from the dock is clear of no-fly zones.\"\n      },\n      {\n        \"name\": \"within_range\",\n        \"passed\": true,\n        \"detail\": \"Round trip 2.6 km is within Drone 2's 6.0 km range.\"\n      },\n      {\n        \"name\": \"battery\",\n        \"passed\": true,\n        \"detail\": \"Drone 1 has 100% battery.\"\n      }\n    ],\n    \"checked_at\": \"2026-10-19T21:33:07.207Z\"\n  },\n  \"on_scene_s\": 15.0,\n  \"progress\": {\n    \"phase\": \"cancelled\"\n  },\n  \"history\": [\n    {\n      \"status\": \"requested\",\n      \"time\": \"2026-10-19T21:33:07.207Z\",\n      \"actor\": \"key:operator\",\n      \"note\": \"Evening patrol of the north fence\"\n    },\n    {\n      \"status\": \"en_route\",\n      \"time\": \"2026-10-19T21:33:07.208Z\",\n      \"actor\": \"vehicle:drone-1\",\n      \"note\": \"Drone 1 launched\"\n    },\n    {\n      \"status\": \"on_scene\",\n      \"time\": \"2026-10-19T21:33:43.163Z\",\n      \"actor\": \"vehicle:drone-1\",\n      \"note\": \"Drone 1 over North fence\"\n    },\n    {\n      \"status\": \"cancelled\",\n      \"time\": \"2026-10-19T21:34:00.356Z\",\n      \"actor\": \"key:operator\",\n      \"note\": \"key:operator cancelled it (Guard is walking the fence)\"\n    }\n  ],\n  \"alert_ids\": [],\n  \"detection_ids\": [],\n  \"result\": {\n    \"outcome\": \"cancelled\",\n    \"reason\": \"key:operator cancelled it (Guard is walking the fence)\",\n    \"detections\": 0,\n    \"battery_end_pct\": 94.7,\n    \"distance_flown_m\": 637,\n    \"report_id\": \"rpt_c3d1d1973aca\"\n  },\n  \"report_id\": \"rpt_c3d1d1973aca\",\n  \"track\": [\n    [\n      38.499,\n      -98.001\n    ],\n    [\n      38.4991037,\n      -98.000958\n    ],\n    [\n      38.4992072,\n      -98.000916\n    ]\n  ],\n  \"created_at\": \"2026-10-19T21:33:07.207Z\",\n  \"updated_at\": \"2026-10-19T21:34:00.356Z\",\n  \"started_at\": \"2026-10-19T21:33:07.208Z\",\n  \"ended_at\": \"2026-10-19T21:34:00.356Z\"\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Detections and reports",
      "description": "What the drones saw, and the incident report Ochio writes the moment each mission ends.",
      "item": [
        {
          "name": "List detections",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/detections?mission_id={{missionId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "detections"
              ],
              "query": [
                {
                  "key": "mission_id",
                  "value": "{{missionId}}"
                }
              ]
            },
            "description": "Detections, newest first. A `detection.created` event announces each one as it happens.\n\n**Access:** API key with `read`.\n\n**Query**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `mission_id` | string | no | Only this mission's detections. |\n| `limit` | integer | no | How many to return, 1 to 1,000. Default 100. |\n\n**Returns:** `{\"data\": [...]}` with a detection for each."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/detections?mission_id={{missionId}}",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "detections"
                  ],
                  "query": [
                    {
                      "key": "mission_id",
                      "value": "{{missionId}}"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"det_ff3034b71f11\",\n      \"class\": \"person\",\n      \"confidence\": 0.83,\n      \"location\": {\n        \"lat\": 38.5007,\n        \"lon\": -97.9953\n      },\n      \"zone_id\": \"east-gate\",\n      \"source\": \"vehicle:drone-2\",\n      \"mission_id\": \"msn_e58e7523d2b5\",\n      \"vehicle_id\": \"drone-2\",\n      \"expired\": false,\n      \"expires_at\": \"2026-10-19T21:43:47.392Z\",\n      \"created_at\": \"2026-10-19T21:33:47.392Z\"\n    }\n  ]\n}"
            }
          ]
        },
        {
          "name": "List reports",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));",
                  "if (j.data && j.data.length) setVar('reportId', j.data[0].id);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/reports",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "reports"
              ]
            },
            "description": "Reports, newest first, in short form.\n\n**Access:** API key with `read`.\n\n**Query**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `limit` | integer | no | How many to return, 1 to 1,000. Default 100. |\n\n**Returns:** `{\"data\": [...]}`, each with `id`, `mission_id`, `title`, `outcome`, `summary` and `created_at`."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/reports",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "reports"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"rpt_91632184d289\",\n      \"mission_id\": \"msn_ea2ec77fdfaa\",\n      \"title\": \"Inspection: North fence motion sensor\",\n      \"outcome\": {\n        \"status\": \"completed\",\n        \"reason\": \"Drone 2 landed back on its dock\"\n      },\n      \"summary\": \"Drone 2 checked on North fence motion sensor, which had stopped checking in, and saw no one. It landed back on its dock with 20% battery after flying 1.1 km.\",\n      \"created_at\": \"2026-10-19T21:35:12.126Z\"\n    },\n    {\n      \"id\": \"rpt_97ba18de7a7a\",\n      \"mission_id\": \"msn_ac7bd7106919\",\n      \"title\": \"Inspection: Generator yard\",\n      \"outcome\": {\n        \"status\": \"completed\",\n        \"reason\": \"Drone 1 landed back on its dock\"\n      },\n      \"summary\": \"Drone 1 inspected Generator yard after a request from key:partner (Check the generator yard before the shift change) and saw no one. It landed back on its dock with 84% battery after flying 722 m.\",\n      \"created_at\": \"2026-10-19T21:35:01.666Z\"\n    },\n    {\n      \"id\": \"rpt_3d5775dba56f\",\n      \"mission_id\": \"msn_7c755ad98d22\",\n      \"title\": \"Inspection: Generator yard door\",\n      \"outcome\": {\n        \"status\": \"cancelled\",\n        \"reason\": \"key:operator cancelled it (Maintenance crew on site)\"\n      },\n      \"summary\": \"The inspect mission to Generator yard door after a medium door_open alert from Generator yard door was cancelled: key:operator cancelled it (Maintenance crew on site).\",\n      \"created_at\": \"2026-10-19T21:34:46.533Z\"\n    }\n  ]\n}"
            }
          ]
        },
        {
          "name": "Get a report",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/reports/{{reportId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "reports",
                "{{reportId}}"
              ]
            },
            "description": "One report, as JSON, or as a page a person can read and print. See an example page.\n\n**Access:** API key with `read`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `report_id` | string | yes | The report's id, `rpt_…`. |\n\n**Query**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `format` | string | no | `json` (the default) or `html` for the printable page with a map of the flight. |\n\n**Returns:** The report, or the HTML page.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 404 | `not_found` | No report with this id. |"
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/reports/{{reportId}}",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "reports",
                    "{{reportId}}"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"rpt_ba61bdbb7b36\",\n  \"mission_id\": \"msn_e58e7523d2b5\",\n  \"title\": \"Inspection: East gate motion sensor 2\",\n  \"outcome\": {\n    \"status\": \"completed\",\n    \"reason\": \"Drone 2 landed back on its dock\"\n  },\n  \"summary\": \"Drone 2 checked a critical motion alert from East gate motion sensor 2 and saw 1 person. It landed back on its dock with 90% battery after flying 1.0 km.\",\n  \"trigger\": {\n    \"kind\": \"alert\",\n    \"text\": \"A critical motion alert from East gate motion sensor 2\",\n    \"rule_id\": \"perimeter-motion\",\n    \"sensor_id\": \"east-gate-pir-02\",\n    \"alert_ids\": [\n      \"alt_5037deb6aeee\"\n    ],\n    \"requested_by\": \"rule:perimeter-motion\",\n    \"time\": \"2026-10-19T21:33:03.883Z\"\n  },\n  \"timeline\": [\n    {\n      \"time\": \"2026-10-19T21:33:03.882Z\",\n      \"text\": \"Motion alert (critical) from East gate motion sensor 2\"\n    },\n    {\n      \"time\": \"2026-10-19T21:33:03.883Z\",\n      \"text\": \"Mission requested by rule:perimeter-motion\"\n    },\n    {\n      \"time\": \"2026-10-19T21:33:03.883Z\",\n      \"text\": \"Drone 2 launched toward East gate motion sensor 2\"\n    },\n    {\n      \"time\": \"2026-10-19T21:33:47.392Z\",\n      \"text\": \"Drone 2 on scene\"\n    },\n    {\n      \"time\": \"2026-10-19T21:33:47.392Z\",\n      \"text\": \"Person detected (83%), 34 m from the target\"\n    },\n    {\n      \"time\": \"2026-10-19T21:34:02.486Z\",\n      \"text\": \"Drone 2 heading home\"\n    },\n    {\n      \"time\": \"2026-10-19T21:34:46.141Z\",\n      \"text\": \"Drone 2 landed; mission complete\"\n    }\n  ],\n  \"detections\": [\n    {\n      \"id\": \"det_ff3034b71f11\",\n      \"class\": \"person\",\n      \"confidence\": 0.83,\n      \"location\": {\n        \"lat\": 38.5007,\n        \"lon\": -97.9953\n      },\n      \"zone_id\": \"east-gate\",\n      \"source\": \"vehicle:drone-2\",\n      \"mission_id\": \"msn_e58e7523d2b5\",\n      \"vehicle_id\": \"drone-2\",\n      \"expired\": false,\n      \"expires_at\": \"2026-10-19T21:43:47.392Z\",\n      \"created_at\": \"2026-10-19T21:33:47.392Z\"\n    }\n  ],\n  \"vehicle\": {\n    \"id\": \"drone-2\",\n    \"name\": \"Drone 2\",\n    \"battery_start_pct\": 100.0,\n    \"battery_end_pct\": 89.8,\n    \"distance_flown_m\": 1047,\n    \"flight_time_s\": 102\n  },\n  \"recommendations\": [\n    \"Have security confirm the 1 person seen near East gate (first sighting at 38.50070, -97.99530, 21:33:47 UTC).\"\n  ],\n  \"target\": {\n    \"kind\": \"alert\",\n    \"alert_id\": \"alt_5037deb6aeee\",\n    \"sensor_id\": \"east-gate-pir-02\",\n    \"location\": {\n      \"lat\": 38.5005,\n      \"lon\": -97.995\n    },\n    \"zone_id\": \"east-gate\",\n    \"name\": \"East gate motion sensor 2\"\n  },\n  \"created_at\": \"2026-10-19T21:34:46.141Z\"\n}"
            }
          ]
        },
        {
          "name": "Get a report as a printable page",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/reports/{{reportId}}?format=html",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "reports",
                "{{reportId}}"
              ],
              "query": [
                {
                  "key": "format",
                  "value": "html"
                }
              ]
            },
            "description": "The report as a page a person can read and print, with a map of the flight."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Events",
      "description": "Everything that happens in Ochio is written once, in order, to an event log. Read it page by page, follow it live, or export it.\n\nThe live stream (`GET /v1/events/stream`, Server-Sent Events) isn't in this collection; see the web docs.",
      "item": [
        {
          "name": "List events",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/events?after=0&limit=3",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "events"
              ],
              "query": [
                {
                  "key": "after",
                  "value": "0"
                },
                {
                  "key": "limit",
                  "value": "3"
                }
              ]
            },
            "description": "Pages through the log in order. Start at `after=0`, then pass the `next_after` of each answer until `has_more` is `false`. Or ask for the newest few with `tail`.\n\n**Access:** API key with `read`.\n\n**Query**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `after` | integer | no | Return events after this `seq`. Default 0. |\n| `types` | string | no | Only these types, comma separated. |\n| `limit` | integer | no | Events per page, 1 to 1,000. Default 100. |\n| `tail` | integer | no | Return the newest N events instead (1 to 1,000), oldest first. |\n\n**Returns:** `data` (the events, oldest first), `next_after` (the last `seq` returned) and `has_more`."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/events?after=0&limit=3",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "events"
                  ],
                  "query": [
                    {
                      "key": "after",
                      "value": "0"
                    },
                    {
                      "key": "limit",
                      "value": "3"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"evt_19ba21710b70\",\n      \"seq\": 1,\n      \"type\": \"sensor.registered\",\n      \"time\": \"2026-10-19T21:30:10.072Z\",\n      \"actor\": \"core\",\n      \"subject\": \"north-fence-pir-01\",\n      \"data\": {\n        \"sensor_id\": \"north-fence-pir-01\",\n        \"name\": \"North fence motion sensor\",\n        \"type\": \"motion\",\n        \"location\": {\n          \"lat\": 38.5033,\n          \"lon\": -98.0032\n        },\n        \"zone_id\": \"north-fence\",\n        \"checkin_interval_s\": 10.0,\n        \"missed_checkins_allowed\": 2,\n        \"simulated\": true,\n        \"origin\": \"site\"\n      }\n    },\n    {\n      \"id\": \"evt_41d81835bed4\",\n      \"seq\": 2,\n      \"type\": \"sensor.registered\",\n      \"time\": \"2026-10-19T21:30:10.072Z\",\n      \"actor\": \"core\",\n      \"subject\": \"east-gate-cam-01\",\n      \"data\": {\n        \"sensor_id\": \"east-gate-cam-01\",\n        \"name\": \"East gate camera\",\n        \"type\": \"camera\",\n        \"location\": {\n          \"lat\": 38.5009,\n          \"lon\": -97.9944\n        },\n        \"zone_id\": \"east-gate\",\n        \"checkin_interval_s\": 10.0,\n        \"missed_checkins_allowed\": 2,\n        \"simulated\": true,\n        \"origin\": \"site\"\n      }\n    },\n    {\n      \"id\": \"evt_4a9fd83f915e\",\n      \"seq\": 3,\n      \"type\": \"sensor.registered\",\n      \"time\": \"2026-10-19T21:30:10.072Z\",\n      \"actor\": \"core\",\n      \"subject\": \"generator-yard-door-01\",\n      \"data\": {\n        \"sensor_id\": \"generator-yard-door-01\",\n        \"name\": \"Generator yard door\",\n        \"type\": \"door\",\n        \"location\": {\n          \"lat\": 38.4979,\n          \"lon\": -98.0047\n        },\n        \"zone_id\": \"generator-yard\",\n        \"checkin_interval_s\": 10.0,\n        \"missed_checkins_allowed\": 2,\n        \"simulated\": true,\n        \"origin\": \"site\"\n      }\n    }\n  ],\n  \"next_after\": 3,\n  \"has_more\": true\n}"
            },
            {
              "name": "200 tail=2&types=report.ready",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/events?after=0&limit=3",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "events"
                  ],
                  "query": [
                    {
                      "key": "after",
                      "value": "0"
                    },
                    {
                      "key": "limit",
                      "value": "3"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"evt_6d2ab1fce9f4\",\n      \"seq\": 65,\n      \"type\": \"report.ready\",\n      \"time\": \"2026-10-19T21:35:01.666Z\",\n      \"actor\": \"core\",\n      \"subject\": \"rpt_97ba18de7a7a\",\n      \"data\": {\n        \"report_id\": \"rpt_97ba18de7a7a\",\n        \"mission_id\": \"msn_ac7bd7106919\",\n        \"outcome\": \"completed\",\n        \"summary\": \"Drone 1 inspected Generator yard after a request from key:partner (Check the generator yard before the shift change) and saw no one. It landed back on its dock with 84% battery after flying 722 m.\",\n        \"detections\": 0,\n        \"url\": \"/v1/reports/rpt_97ba18de7a7a?format=html\"\n      }\n    },\n    {\n      \"id\": \"evt_469cf30d4ad9\",\n      \"seq\": 70,\n      \"type\": \"report.ready\",\n      \"time\": \"2026-10-19T21:35:12.127Z\",\n      \"actor\": \"core\",\n      \"subject\": \"rpt_91632184d289\",\n      \"data\": {\n        \"report_id\": \"rpt_91632184d289\",\n        \"mission_id\": \"msn_ea2ec77fdfaa\",\n        \"outcome\": \"completed\",\n        \"summary\": \"Drone 2 checked on North fence motion sensor, which had stopped checking in, and saw no one. It landed back on its dock with 20% battery after flying 1.1 km.\",\n        \"detections\": 0,\n        \"url\": \"/v1/reports/rpt_91632184d289?format=html\"\n      }\n    }\n  ],\n  \"next_after\": 70,\n  \"has_more\": false\n}"
            }
          ]
        },
        {
          "name": "List the newest events",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/events?tail=5",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "events"
              ],
              "query": [
                {
                  "key": "tail",
                  "value": "5"
                }
              ]
            },
            "description": "Pages through the log in order. Start at `after=0`, then pass the `next_after` of each answer until `has_more` is `false`. Or ask for the newest few with `tail`.\n\n**Access:** API key with `read`.\n\n**Query**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `after` | integer | no | Return events after this `seq`. Default 0. |\n| `types` | string | no | Only these types, comma separated. |\n| `limit` | integer | no | Events per page, 1 to 1,000. Default 100. |\n| `tail` | integer | no | Return the newest N events instead (1 to 1,000), oldest first. |\n\n**Returns:** `data` (the events, oldest first), `next_after` (the last `seq` returned) and `has_more`."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/events?tail=5",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "events"
                  ],
                  "query": [
                    {
                      "key": "tail",
                      "value": "5"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"evt_6d2ab1fce9f4\",\n      \"seq\": 65,\n      \"type\": \"report.ready\",\n      \"time\": \"2026-10-19T21:35:01.666Z\",\n      \"actor\": \"core\",\n      \"subject\": \"rpt_97ba18de7a7a\",\n      \"data\": {\n        \"report_id\": \"rpt_97ba18de7a7a\",\n        \"mission_id\": \"msn_ac7bd7106919\",\n        \"outcome\": \"completed\",\n        \"summary\": \"Drone 1 inspected Generator yard after a request from key:partner (Check the generator yard before the shift change) and saw no one. It landed back on its dock with 84% battery after flying 722 m.\",\n        \"detections\": 0,\n        \"url\": \"/v1/reports/rpt_97ba18de7a7a?format=html\"\n      }\n    },\n    {\n      \"id\": \"evt_469cf30d4ad9\",\n      \"seq\": 70,\n      \"type\": \"report.ready\",\n      \"time\": \"2026-10-19T21:35:12.127Z\",\n      \"actor\": \"core\",\n      \"subject\": \"rpt_91632184d289\",\n      \"data\": {\n        \"report_id\": \"rpt_91632184d289\",\n        \"mission_id\": \"msn_ea2ec77fdfaa\",\n        \"outcome\": \"completed\",\n        \"summary\": \"Drone 2 checked on North fence motion sensor, which had stopped checking in, and saw no one. It landed back on its dock with 20% battery after flying 1.1 km.\",\n        \"detections\": 0,\n        \"url\": \"/v1/reports/rpt_91632184d289?format=html\"\n      }\n    }\n  ],\n  \"next_after\": 70,\n  \"has_more\": false\n}"
            }
          ]
        },
        {
          "name": "Export events",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/events/export",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "events",
                "export"
              ]
            },
            "description": "The log as one file, one JSON event per line (NDJSON), up to the newest 100,000 events. Keep it as a record, or load it into a fresh sandbox with the replay tool to run the same night again.\n\n**Access:** API key with `read`.\n\n**Returns:** `application/x-ndjson`, as the download `export.ndjson`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Webhooks",
      "description": "Ochio sends the events you choose to your own URL, signed, as they happen, and keeps trying until you answer.",
      "item": [
        {
          "name": "Create a webhook",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 201\", () => pm.expect([201]).to.include(pm.response.code));",
                  "if (j.id) setVar('webhookId', j.id); if (j.secret) setVar('webhookSecret', j.secret);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ]
            },
            "description": "Subscribes a URL to events. The answer holds the signing secret, shown once.\n\n**Access:** API key with `webhooks:write`.\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `url` | string | yes | Where to send deliveries: `http://` or `https://`, up to 2,000 characters. Use HTTPS outside a closed network. |\n| `event_types` | array | no | Exact types, prefixes like `mission.*`, or `*`. Default `[\"*\"]`. |\n| `description` | string | no | A note, up to 200 characters. |\n| `enabled` | boolean | no | Default `true`. |\n\n**Returns:** `201` with the webhook and its `secret`.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 400 | `invalid_request` | The URL isn't http or https, an event type is unknown, or the URL points back at Ochio itself. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"{{webhookUrl}}\",\n  \"event_types\": [\n    \"mission.*\",\n    \"detection.created\",\n    \"report.ready\"\n  ],\n  \"description\": \"Security desk\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "201 Created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/webhooks",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "webhooks"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"url\": \"{{webhookUrl}}\",\n  \"event_types\": [\n    \"mission.*\",\n    \"detection.created\",\n    \"report.ready\"\n  ],\n  \"description\": \"Security desk\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"whk_1cee4f976d10\",\n  \"url\": \"https://desk.example.com/ochio-webhooks\",\n  \"event_types\": [\n    \"mission.*\",\n    \"detection.created\",\n    \"report.ready\"\n  ],\n  \"description\": \"Security desk\",\n  \"enabled\": true,\n  \"owner\": \"partner\",\n  \"stats\": {\n    \"delivered\": 0,\n    \"failed_attempts\": 0,\n    \"gave_up\": 0,\n    \"last_status\": null,\n    \"last_attempt_at\": null\n  },\n  \"created_at\": \"2026-10-19T21:33:02.762Z\",\n  \"updated_at\": \"2026-10-19T21:33:02.762Z\",\n  \"secret\": \"whsec_test_example_secret_000000000003\"\n}"
            }
          ]
        },
        {
          "name": "List webhooks",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ]
            },
            "description": "Your key's subscriptions; every subscription for a key with `admin`.\n\n**Access:** API key with `read`.\n\n**Returns:** `{\"data\": [...]}` with a webhook for each."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/webhooks",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "webhooks"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"whk_1cee4f976d10\",\n      \"url\": \"https://desk.example.com/ochio-webhooks\",\n      \"event_types\": [\n        \"mission.*\",\n        \"detection.created\",\n        \"report.ready\"\n      ],\n      \"description\": \"Security desk\",\n      \"enabled\": true,\n      \"owner\": \"partner\",\n      \"stats\": {\n        \"delivered\": 17,\n        \"failed_attempts\": 0,\n        \"gave_up\": 0,\n        \"last_status\": 200,\n        \"last_attempt_at\": \"2026-10-19T21:34:46.348Z\"\n      },\n      \"created_at\": \"2026-10-19T21:33:02.762Z\",\n      \"updated_at\": \"2026-10-19T21:33:02.762Z\"\n    }\n  ]\n}"
            }
          ]
        },
        {
          "name": "Get a webhook",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/{{webhookId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "{{webhookId}}"
              ]
            },
            "description": "One subscription, with its delivery counts.\n\n**Access:** API key with `read`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `webhook_id` | string | yes | The webhook's id, `whk_…`. |\n\n**Returns:** The webhook.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 404 | `not_found` | No webhook with this id that this key can see. |"
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/webhooks/{{webhookId}}",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "webhooks",
                    "{{webhookId}}"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"whk_1cee4f976d10\",\n  \"url\": \"https://desk.example.com/ochio-webhooks\",\n  \"event_types\": [\n    \"mission.*\",\n    \"detection.created\",\n    \"report.ready\"\n  ],\n  \"description\": \"Security desk\",\n  \"enabled\": true,\n  \"owner\": \"partner\",\n  \"stats\": {\n    \"delivered\": 17,\n    \"failed_attempts\": 0,\n    \"gave_up\": 0,\n    \"last_status\": 200,\n    \"last_attempt_at\": \"2026-10-19T21:34:46.348Z\"\n  },\n  \"created_at\": \"2026-10-19T21:33:02.762Z\",\n  \"updated_at\": \"2026-10-19T21:33:02.762Z\"\n}"
            }
          ]
        },
        {
          "name": "Send a test delivery",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/{{webhookId}}/test",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "{{webhookId}}",
                "test"
              ]
            },
            "description": "Sends a `webhook.test` event to this subscription only, whatever types it chose. Use it to check your receiver and its signature check. A subscription made with `enabled: false` gets nothing, this test included.\n\n**Access:** API key with `webhooks:write`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `webhook_id` | string | yes | The webhook's id. |\n\n**Returns:** `{\"queued\": true, \"event\": {...}}` with the test event."
          },
          "response": [
            {
              "name": "200 Queued",
              "originalRequest": {
                "method": "POST",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/webhooks/{{webhookId}}/test",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "webhooks",
                    "{{webhookId}}",
                    "test"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"queued\": true,\n  \"event\": {\n    \"id\": \"evt_3e86ddc85305\",\n    \"seq\": 49,\n    \"type\": \"webhook.test\",\n    \"time\": \"2026-10-19T21:34:46.537Z\",\n    \"actor\": \"key:partner\",\n    \"subject\": \"whk_1cee4f976d10\",\n    \"data\": {\n      \"webhook_id\": \"whk_1cee4f976d10\",\n      \"message\": \"Test delivery from Ochio core.\"\n    }\n  }\n}"
            }
          ]
        },
        {
          "name": "List deliveries",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/{{webhookId}}/deliveries?limit=3",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "{{webhookId}}",
                "deliveries"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "3"
                }
              ]
            },
            "description": "Recent delivery attempts, newest first, and what's still waiting to go. Start here when a receiver says it missed something. Ochio keeps the newest 500 attempts per subscription, 200 of them across a restart.\n\n**Access:** API key with `read`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `webhook_id` | string | yes | The webhook's id. |\n\n**Query**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `limit` | integer | no | How many attempts, 1 to 500. Default 100. |\n\n**Returns:** `data`: attempts, each with `event_id`, `event_seq`, `event_type`, `attempt`, `ok`, `status_code`, `error`, `duration_ms` and `next_retry_at`. `pending`: deliveries still to try, with `due_at`."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/webhooks/{{webhookId}}/deliveries?limit=3",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "webhooks",
                    "{{webhookId}}",
                    "deliveries"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "3"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"dlv_15c5d71d2597\",\n      \"webhook_id\": \"whk_1cee4f976d10\",\n      \"event_id\": \"evt_3e86ddc85305\",\n      \"event_seq\": 49,\n      \"event_type\": \"webhook.test\",\n      \"attempt\": 1,\n      \"time\": \"2026-10-19T21:34:47.151Z\",\n      \"ok\": true,\n      \"status_code\": 200,\n      \"error\": null,\n      \"duration_ms\": 2,\n      \"next_retry_at\": null\n    },\n    {\n      \"id\": \"dlv_a25bdc341034\",\n      \"webhook_id\": \"whk_1cee4f976d10\",\n      \"event_id\": \"evt_9606842804d6\",\n      \"event_seq\": 48,\n      \"event_type\": \"report.ready\",\n      \"attempt\": 1,\n      \"time\": \"2026-10-19T21:34:46.951Z\",\n      \"ok\": true,\n      \"status_code\": 200,\n      \"error\": null,\n      \"duration_ms\": 3,\n      \"next_retry_at\": null\n    },\n    {\n      \"id\": \"dlv_205949bc8cf7\",\n      \"webhook_id\": \"whk_1cee4f976d10\",\n      \"event_id\": \"evt_c5788d8f7782\",\n      \"event_seq\": 46,\n      \"event_type\": \"mission.status_changed\",\n      \"attempt\": 1,\n      \"time\": \"2026-10-19T21:34:46.750Z\",\n      \"ok\": true,\n      \"status_code\": 200,\n      \"error\": null,\n      \"duration_ms\": 3,\n      \"next_retry_at\": null\n    }\n  ],\n  \"pending\": []\n}"
            }
          ]
        },
        {
          "name": "Delete a webhook",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/{{webhookId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "{{webhookId}}"
              ]
            },
            "description": "Ends the subscription. Deliveries still waiting are dropped.\n\n**Access:** API key with `webhooks:write`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `webhook_id` | string | yes | The webhook's id. |\n\n**Returns:** `{\"id\", \"deleted\": true}`.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 404 | `not_found` | No webhook with this id that this key can see. |"
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "DELETE",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/webhooks/{{webhookId}}",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "webhooks",
                    "{{webhookId}}"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"whk_1cee4f976d10\",\n  \"deleted\": true\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "API keys",
      "description": "Give each app or connected system its own key, with only the scopes it needs, and revoke it when it's done.",
      "item": [
        {
          "name": "List API keys",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/keys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "keys"
              ]
            },
            "description": "Every key, without the keys themselves.\n\n**Access:** API key with `admin`.\n\n**Returns:** `{\"data\": [...]}` with a key for each."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/keys",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "keys"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"key_9e5cecad4d1f\",\n      \"name\": \"operator\",\n      \"prefix\": \"ochio_ex02\",\n      \"scopes\": [\n        \"read\",\n        \"alerts:write\",\n        \"sensors:write\",\n        \"missions:request\",\n        \"missions:launch\",\n        \"missions:approve\",\n        \"webhooks:write\",\n        \"admin\"\n      ],\n      \"created_at\": \"2026-10-19T21:30:10.072Z\",\n      \"last_used_at\": \"2026-10-19T21:34:02.364Z\"\n    },\n    {\n      \"id\": \"key_365d1809087d\",\n      \"name\": \"partner\",\n      \"prefix\": \"ochio_ex01\",\n      \"scopes\": [\n        \"read\",\n        \"alerts:write\",\n        \"missions:request\",\n        \"webhooks:write\"\n      ],\n      \"created_at\": \"2026-10-19T21:30:10.072Z\",\n      \"last_used_at\": \"2026-10-19T21:34:46.535Z\"\n    }\n  ]\n}"
            }
          ]
        },
        {
          "name": "Create an API key",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 201 or 409\", () => pm.expect([201, 409]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/keys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "keys"
              ]
            },
            "description": "Makes a key. The answer is the only time Ochio shows it.\n\n**Access:** API key with `admin`.\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `name` | string | yes | A name, unique among keys: letters, digits, `.`, `_` and `-`, up to 64 characters. |\n| `scopes` | array | yes | One or more of `read`, `alerts:write`, `sensors:write`, `missions:request`, `missions:launch`, `missions:approve`, `webhooks:write`, `admin`. |\n\n**Returns:** `201` with the key and `key`, the key itself.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 409 | `key_exists` | A key with this name exists. |\n| 400 | `invalid_request` | An unknown scope, or a name that isn't valid. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"vms-connector\",\n  \"scopes\": [\n    \"read\",\n    \"alerts:write\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "201 Created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/keys",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "keys"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"vms-connector\",\n  \"scopes\": [\n    \"read\",\n    \"alerts:write\"\n  ]\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"key_fbf104143394\",\n  \"name\": \"vms-connector\",\n  \"prefix\": \"ochio_ex03\",\n  \"scopes\": [\n    \"read\",\n    \"alerts:write\"\n  ],\n  \"created_at\": \"2026-10-19T21:34:49.545Z\",\n  \"last_used_at\": null,\n  \"key\": \"ochio_ex03_example_key_not_real_000000\"\n}"
            }
          ]
        },
        {
          "name": "Revoke an API key",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200 or 404\", () => pm.expect([200, 404]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/keys/{{keyName}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "keys",
                "{{keyName}}"
              ]
            },
            "description": "Revokes a key at once. A key can't revoke itself; use another admin key.\n\nIts webhook subscriptions stay, and keep receiving deliveries: delete them first if they should stop. Subscriptions belong to a key's name, so a new key with the same name takes them over.\n\n**Access:** API key with `admin`.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `key` | string | yes | The key's id or name. |\n\n**Returns:** `{\"id\", \"name\", \"deleted\": true}`.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 409 | `key_in_use` | That's the key making the request. |\n| 404 | `not_found` | No key with this id or name. |"
          },
          "response": [
            {
              "name": "200 Revoked",
              "originalRequest": {
                "method": "DELETE",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/keys/{{keyName}}",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "keys",
                    "{{keyName}}"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"key_fbf104143394\",\n  \"name\": \"vms-connector\",\n  \"deleted\": true\n}"
            },
            {
              "name": "409 Own key",
              "originalRequest": {
                "method": "DELETE",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/keys/{{keyName}}",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "keys",
                    "{{keyName}}"
                  ]
                }
              },
              "status": "Conflict",
              "code": 409,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"key_in_use\",\n    \"message\": \"That is the key making this request; delete it with another admin key.\"\n  }\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Sandbox controls",
      "description": "These requests exist only in the sandbox's test mode, and need the `admin` scope.",
      "item": [
        {
          "name": "Read the simulation",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dev/state",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dev",
                "state"
              ]
            },
            "description": "`GET /v1/dev/state` returns the simulation speed, the simulated people, which sensors have power, and every event type. `POST /v1/dev/reset` clears alerts, missions, detections, reports and simulated people, and puts the fleet back on its dock, fully charged. `POST /v1/dev/inject` re-sends one exported event; the replay tool uses it.\n\n**Access:** API key with `admin`. Sandbox only.\n\n**Returns:** The state; `{\"reset\": true}` for a reset."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/dev/state",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "dev",
                    "state"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"sim_speed\": 1.0,\n  \"intruders\": [\n    {\n      \"id\": \"int_f5a3fe19\",\n      \"lat\": 38.5007,\n      \"lon\": -97.9953,\n      \"label\": \"Person\",\n      \"zone_id\": \"east-gate\",\n      \"placed_at\": \"2026-10-19T21:33:03.881Z\",\n      \"expires_at\": 1792446483.8811839\n    }\n  ],\n  \"sensor_power\": {\n    \"north-fence-pir-01\": true,\n    \"east-gate-cam-01\": true,\n    \"generator-yard-door-01\": true\n  },\n  \"event_types\": [\n    \"alert.received\",\n    \"alert.updated\",\n    \"alert.resolved\",\n    \"alert.dismissed\",\n    \"sensor.registered\",\n    \"sensor.online\",\n    \"sensor.silent\",\n    \"sensor.recovered\",\n    \"sensor.removed\",\n    \"rule.suppressed\",\n    \"mission.created\",\n    \"mission.status_changed\",\n    \"vehicle.status_changed\",\n    \"detection.created\",\n    \"report.ready\",\n    \"webhook.test\"\n  ]\n}"
            }
          ]
        },
        {
          "name": "Simulate an alert",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 201\", () => pm.expect([201]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/dev/motion",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dev",
                "motion"
              ]
            },
            "description": "A simulated sensor sends an alert, through the same path as a signed one. Optionally, a simulated person appears about 35 m from the sensor, for the drone to find.\n\n**Access:** API key with `admin`. Sandbox only.\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `sensor_id` | string | yes | The sensor that alerts. |\n| `type` | string | no | Default `motion`. |\n| `priority` | string | no | Default `high`. |\n| `alert_id` | string | no | The alert's own id. Default: a new one. |\n| `version` | integer | no | Default 1. |\n| `intruder` | boolean | no | Also place a simulated person near the sensor. Default `false`. |\n\n**Returns:** The same answer as Send an alert, plus `intruder`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"sensor_id\": \"generator-yard-door-01\",\n  \"type\": \"door_open\",\n  \"priority\": \"medium\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "201 Created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/dev/motion",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "dev",
                    "motion"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"sensor_id\": \"generator-yard-door-01\",\n  \"type\": \"door_open\",\n  \"priority\": \"medium\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"result\": \"created\",\n  \"alert\": {\n    \"id\": \"alt_02fcb2845e3a\",\n    \"source\": \"generator-yard-door-01\",\n    \"source_alert_id\": \"bench_e0b6c003\",\n    \"version\": 1,\n    \"type\": \"door_open\",\n    \"priority\": \"medium\",\n    \"location\": {\n      \"lat\": 38.4979,\n      \"lon\": -98.0047\n    },\n    \"zone_id\": \"generator-yard\",\n    \"status\": \"responding\",\n    \"mission_id\": \"msn_7c755ad98d22\",\n    \"mission_history\": [\n      \"msn_7c755ad98d22\"\n    ],\n    \"time\": \"2026-10-19T21:34:46.531Z\",\n    \"title\": null,\n    \"description\": null,\n    \"media_url\": null,\n    \"data\": null,\n    \"received_by\": \"sensor:generator-yard-door-01\",\n    \"dismissed_by\": null,\n    \"resolved_at\": null,\n    \"created_at\": \"2026-10-19T21:34:46.531Z\",\n    \"updated_at\": \"2026-10-19T21:34:46.531Z\"\n  },\n  \"mission\": {\n    \"id\": \"msn_7c755ad98d22\",\n    \"status\": \"pending_approval\",\n    \"vehicle_id\": null\n  },\n  \"rule\": {\n    \"rule_id\": \"generator-yard-door\",\n    \"outcome\": \"mission_created\",\n    \"mission_id\": \"msn_7c755ad98d22\",\n    \"mission_status\": \"pending_approval\"\n  },\n  \"intruder\": null\n}"
            }
          ]
        },
        {
          "name": "Cut or restore a sensor's power",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/dev/sensors/{{simSensorId}}/power",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dev",
                "sensors",
                "{{simSensorId}}",
                "power"
              ]
            },
            "description": "Stops or restarts a simulated sensor's check-ins. With its power off, it turns silent once its check-ins expire.\n\n**Access:** API key with `admin`. Sandbox only.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `sensor_id` | string | yes | A simulated sensor. |\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `on` | boolean | yes | `false` cuts the power; `true` restores it. |\n\n**Returns:** `power`, the sensor's `status`, and `silent_after`: when it will turn silent.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 409 | `not_simulated` | The sensor is real. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"on\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 Power off",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/dev/sensors/{{simSensorId}}/power",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "dev",
                    "sensors",
                    "{{simSensorId}}",
                    "power"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"on\": false\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"sensor_id\": \"east-gate-cam-01\",\n  \"power\": \"off\",\n  \"status\": \"online\",\n  \"silent_after\": \"2026-10-19T21:35:01.921Z\"\n}"
            }
          ]
        },
        {
          "name": "Restore a sensor's power",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/dev/sensors/{{simSensorId}}/power",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dev",
                "sensors",
                "{{simSensorId}}",
                "power"
              ]
            },
            "description": "Stops or restarts a simulated sensor's check-ins. With its power off, it turns silent once its check-ins expire.\n\n**Access:** API key with `admin`. Sandbox only.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `sensor_id` | string | yes | A simulated sensor. |\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `on` | boolean | yes | `false` cuts the power; `true` restores it. |\n\n**Returns:** `power`, the sensor's `status`, and `silent_after`: when it will turn silent.\n\n**Errors**\n\n| Status | Code | When |\n| --- | --- | --- |\n| 409 | `not_simulated` | The sensor is real. |",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"on\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 Power on",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/dev/sensors/{{simSensorId}}/power",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "dev",
                    "sensors",
                    "{{simSensorId}}",
                    "power"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"on\": true\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"sensor_id\": \"east-gate-cam-01\",\n  \"power\": \"on\",\n  \"status\": \"online\",\n  \"silent_after\": null\n}"
            }
          ]
        },
        {
          "name": "Place a simulated person",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 201\", () => pm.expect([201]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/dev/intruders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dev",
                "intruders"
              ]
            },
            "description": "Puts a simulated person on the map for 15 minutes. A drone on scene or on patrol within 60 m sees them.\n\n**Access:** API key with `admin`. Sandbox only.\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `lat` | number | yes | Latitude. |\n| `lon` | number | yes | Longitude. |\n| `label` | string | no | Default `Person`. |\n\n**Returns:** `201` with the person: `id`, position, `zone_id`, `placed_at` and `expires_at` (in Unix seconds).",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"lat\": 38.5007,\n  \"lon\": -97.9953,\n  \"label\": \"Person\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "201 Created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/dev/intruders",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "dev",
                    "intruders"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"lat\": 38.5007,\n  \"lon\": -97.9953,\n  \"label\": \"Person\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"int_f5a3fe19\",\n  \"lat\": 38.5007,\n  \"lon\": -97.9953,\n  \"label\": \"Person\",\n  \"zone_id\": \"east-gate\",\n  \"placed_at\": \"2026-10-19T21:33:03.881Z\",\n  \"expires_at\": 1792446483.8811839\n}"
            }
          ]
        },
        {
          "name": "Clear simulated people",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dev/intruders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dev",
                "intruders"
              ]
            },
            "description": "Removes every simulated person.\n\n**Access:** API key with `admin`. Sandbox only.\n\n**Returns:** `{\"removed\": n}`."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "DELETE",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/v1/dev/intruders",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "dev",
                    "intruders"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"removed\": 1\n}"
            }
          ]
        },
        {
          "name": "Fault a vehicle",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/dev/vehicles/{{vehicleId}}/fault",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dev",
                "vehicles",
                "{{vehicleId}}",
                "fault"
              ]
            },
            "description": "Makes a vehicle report a fault. A mission it's flying fails, and it flies home. `/clear-fault` repairs it; `/battery` sets its battery, as `{\"pct\": 25}`.\n\n**Access:** API key with `admin`. Sandbox only.\n\n**Path**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `vehicle_id` | string | yes | The vehicle. |\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `message` | string | no | The fault, in words. Default `Simulated motor fault`. |\n\n**Returns:** The vehicle.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"message\": \"Motor 3 overheating\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 Fault",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/dev/vehicles/{{vehicleId}}/fault",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "dev",
                    "vehicles",
                    "{{vehicleId}}",
                    "fault"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"message\": \"Motor 3 overheating\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"drone-2\",\n  \"name\": \"Drone 2\",\n  \"type\": \"quadcopter\",\n  \"model\": \"Ochio quad (simulated)\",\n  \"adapter\": \"sim\",\n  \"capabilities\": [\n    \"camera\",\n    \"depth\"\n  ],\n  \"home\": {\n    \"lat\": 38.499,\n    \"lon\": -98.0007\n  },\n  \"position\": {\n    \"lat\": 38.499,\n    \"lon\": -98.0007,\n    \"alt_m\": 0.0\n  },\n  \"heading_deg\": 251.4,\n  \"ground_speed_mps\": 0.0,\n  \"speed_mps\": 12.0,\n  \"range_m\": 6000.0,\n  \"battery_pct\": 25.0,\n  \"status\": \"fault\",\n  \"ready\": false,\n  \"charging\": false,\n  \"mission_id\": null,\n  \"fault\": \"Motor 3 overheating\",\n  \"created_at\": \"2026-10-19T21:30:10.072Z\",\n  \"updated_at\": \"2026-10-19T21:34:49.559Z\"\n}"
            }
          ]
        },
        {
          "name": "Repair a vehicle",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dev/vehicles/{{vehicleId}}/clear-fault",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dev",
                "vehicles",
                "{{vehicleId}}",
                "clear-fault"
              ]
            },
            "description": "Clears a vehicle's fault; a docked vehicle is ready again."
          },
          "response": [
            {
              "name": "200 Repaired",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/dev/vehicles/{{vehicleId}}/clear-fault",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "dev",
                    "vehicles",
                    "{{vehicleId}}",
                    "clear-fault"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"message\": \"Motor 3 overheating\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"drone-2\",\n  \"name\": \"Drone 2\",\n  \"type\": \"quadcopter\",\n  \"model\": \"Ochio quad (simulated)\",\n  \"adapter\": \"sim\",\n  \"capabilities\": [\n    \"camera\",\n    \"depth\"\n  ],\n  \"home\": {\n    \"lat\": 38.499,\n    \"lon\": -98.0007\n  },\n  \"position\": {\n    \"lat\": 38.499,\n    \"lon\": -98.0007,\n    \"alt_m\": 0.0\n  },\n  \"heading_deg\": 251.4,\n  \"ground_speed_mps\": 0.0,\n  \"speed_mps\": 12.0,\n  \"range_m\": 6000.0,\n  \"battery_pct\": 25.0,\n  \"status\": \"docked\",\n  \"ready\": false,\n  \"charging\": true,\n  \"mission_id\": null,\n  \"fault\": null,\n  \"created_at\": \"2026-10-19T21:30:10.072Z\",\n  \"updated_at\": \"2026-10-19T21:34:49.561Z\"\n}"
            }
          ]
        },
        {
          "name": "Set a vehicle's battery",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/dev/vehicles/{{vehicleId}}/battery",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dev",
                "vehicles",
                "{{vehicleId}}",
                "battery"
              ]
            },
            "description": "Sets a vehicle's battery level, 0 to 100. Below the site's minimum it can't take a mission.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"pct\": 25\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/dev/vehicles/{{vehicleId}}/battery",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "dev",
                    "vehicles",
                    "{{vehicleId}}",
                    "battery"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"pct\": 25\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"drone-2\",\n  \"name\": \"Drone 2\",\n  \"type\": \"quadcopter\",\n  \"model\": \"Ochio quad (simulated)\",\n  \"adapter\": \"sim\",\n  \"capabilities\": [\n    \"camera\",\n    \"depth\"\n  ],\n  \"home\": {\n    \"lat\": 38.499,\n    \"lon\": -98.0007\n  },\n  \"position\": {\n    \"lat\": 38.499,\n    \"lon\": -98.0007,\n    \"alt_m\": 0.0\n  },\n  \"heading_deg\": 251.4,\n  \"ground_speed_mps\": 0.0,\n  \"speed_mps\": 12.0,\n  \"range_m\": 6000.0,\n  \"battery_pct\": 25.0,\n  \"status\": \"docked\",\n  \"ready\": false,\n  \"charging\": true,\n  \"mission_id\": null,\n  \"fault\": null,\n  \"created_at\": \"2026-10-19T21:30:10.072Z\",\n  \"updated_at\": \"2026-10-19T21:34:46.140Z\"\n}"
            }
          ]
        },
        {
          "name": "Change the simulation speed",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/dev/sim-speed",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dev",
                "sim-speed"
              ]
            },
            "description": "Flies the drones faster or slower: 0.25 to 20 times real time (1). Cooldowns scale with it. Sandbox only.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"speed\": 1\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/dev/sim-speed",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "dev",
                    "sim-speed"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"speed\": 1\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"sim_speed\": 5.0\n}"
            }
          ]
        },
        {
          "name": "Send a tampered alert",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/dev/tampered-alert",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dev",
                "tampered-alert"
              ]
            },
            "description": "Signs an alert as a sensor, changes the body after signing, and sends it to `POST /v1/alerts`, to show that Ochio refuses it.\n\n**Access:** API key with `admin`. Sandbox only.\n\n**Body**\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `sensor_id` | string | no | Default `north-fence-pir-01`. |\n\n**Returns:** What was signed and sent, Ochio's answer (`401 invalid_signature`), and whether an alert was created.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"sensor_id\": \"north-fence-pir-01\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/v1/dev/tampered-alert",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "v1",
                    "dev",
                    "tampered-alert"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"sensor_id\": \"north-fence-pir-01\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"sent\": \"{\\\"id\\\": \\\"tamper_a56db0a5\\\", \\\"source\\\": \\\"north-fence-pir-01\\\", \\\"type\\\": \\\"motion\\\", \\\"priority\\\": \\\"critical\\\"}\",\n  \"signed\": \"{\\\"id\\\": \\\"tamper_a56db0a5\\\", \\\"source\\\": \\\"north-fence-pir-01\\\", \\\"type\\\": \\\"motion\\\", \\\"priority\\\": \\\"low\\\"}\",\n  \"status\": 401,\n  \"response\": {\n    \"error\": {\n      \"code\": \"invalid_signature\",\n      \"message\": \"The signature does not match the body. Nothing was recorded.\"\n    }\n  },\n  \"alerts_before\": 3,\n  \"alerts_after\": 3,\n  \"alert_created\": false\n}"
            }
          ]
        },
        {
          "name": "Reset the sandbox",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = (() => { try { return pm.response.json(); } catch (e) { return {}; } })();",
                  "const setVar = (k, v) => pm.collectionVariables.set(k, v);",
                  "pm.test(\"answers 200\", () => pm.expect([200]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/dev/reset",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "dev",
                "reset"
              ]
            },
            "description": "Clears alerts, missions, detections, reports and simulated people, and puts the fleet back on its dock, fully charged. Sandbox only."
          },
          "response": []
        }
      ]
    }
  ]
}