API docs
API reference

Missions

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.

Types and targets

TypeWhat the drone does
inspectFlies to the target, looks for on_scene_s seconds (15 by default), and flies home.
patrolFlies the outline of a zone, corner to corner, and flies home.

A mission has exactly one target:

TargetFlies to
{"location": {"lat", "lon"}}That point.
{"sensor_id": "…"}The sensor's location.
{"zone_id": "…"}The zone's center for an inspection; its outline for a patrol. Patrols need a zone.
{"alert_id": "…"}Where the alert happened. If the alert is open with no mission, the mission takes it and it turns responding.

Who flies it

Name a vehicle with vehicle_id, or leave it out and Ochio picks one. It takes the ready vehicle that gets to the target first: on its dock, without a fault, with a camera, with a clear path and the range for the round trip, and with at least the site's minimum battery (30% in the sandbox).

If no vehicle is ready, the mission waits in queued. progress.waiting_for says whether it waits for a free vehicle or for a battery to charge. Queued missions launch as soon as a vehicle is ready, highest priority first, then oldest.

The safety gate

Every mission request passes six checks, whoever sends it. A failed check refuses the mission, except the battery check, which makes it wait. A refused mission is recorded as rejected, never flies, and the API answers 422 safety_check_failed.

CheckFails whenThen
inside_operating_areaThe target is outside the site's operating area.Refused
outside_no_fly_zonesThe target is inside a no-fly zone.Refused
vehicle_capableNo vehicle has what the mission needs: a camera, for both types.Refused
path_clearEvery straight path from a dock to the target, or between patrol corners, crosses a no-fly zone.Refused
within_rangeThe round trip is longer than the vehicle's range.Refused
batteryEvery capable vehicle is below the site's minimum battery.Waits in queued

Each check reports passed as true, false, or null when an earlier failure meant it couldn't run: a target inside a no-fly zone has no path to check. The gate's result is passed, waiting (battery only) or refused.

The gate runs again when a person approves a mission, since things may have changed while it waited.

Response
{
  "error": {
    "code": "safety_check_failed",
    "message": "Refused by the safety gate: Target is inside the Fuel farm no-fly zone.",
    "details": {
      "mission_id": "msn_d6d5f719f173",
      "failed_checks": [
        {
          "name": "outside_no_fly_zones",
          "passed": false,
          "detail": "Target is inside the Fuel farm no-fly zone."
        }
      ],
      "mission": {
        "id": "msn_d6d5f719f173",
        "type": "inspect",
        "status": "rejected",
        "priority": "medium",
        "reason": "Check the fuel farm",
        "target": {
          "kind": "zone",
          "zone_id": "fuel-farm",
          "location": {
            "lat": 38.5004117,
            "lon": -98.0068067
          },
          "name": "Fuel farm"
        },
        "patrol_points": null,
        "vehicle_id": null,
        "requested_vehicle_id": null,
        "requested_by": "key:operator",
        "trigger": {
          "kind": "request",
          "rule_id": null,
          "sensor_id": null,
          "alert_ids": [],
          "client": null
        },
        "approval": {
          "mode": "auto",
          "required": false,
          "reasons": [],
          "decision": null,
          "decided_by": null,
          "decided_at": null,
          "note": null
        },
        "safety": {
          "result": "refused",
          "checks": [
            {
              "name": "inside_operating_area",
              "passed": true,
              "detail": "Target is inside the Depot operating area."
            },
            {
              "name": "outside_no_fly_zones",
              "passed": false,
              "detail": "Target is inside the Fuel farm no-fly zone."
            },
            {
              "name": "vehicle_capable",
              "passed": true,
              "detail": "2 vehicles with a camera."
            },
            {
              "name": "path_clear",
              "passed": null,
              "detail": "Not checked: the target is inside a no-fly zone."
            },
            {
              "name": "within_range",
              "passed": null,
              "detail": "Not checked: no clear path."
            },
            {
              "name": "battery",
              "passed": null,
              "detail": "Not checked: no vehicle can fly the route."
            }
          ],
          "checked_at": "2026-10-19T21:33:07.222Z"
        },
        "on_scene_s": 15.0,
        "progress": {
          "phase": "rejected"
        },
        "history": [
          {
            "status": "requested",
            "time": "2026-10-19T21:33:07.222Z",
            "actor": "key:operator",
            "note": "Check the fuel farm"
          },
          {
            "status": "rejected",
            "time": "2026-10-19T21:33:07.222Z",
            "actor": "core",
            "note": "outside_no_fly_zones: Target is inside the Fuel farm no-fly zone."
          }
        ],
        "alert_ids": [],
        "detection_ids": [],
        "result": {
          "outcome": "rejected",
          "reason": "Refused by the safety gate",
          "failed_checks": [
            "outside_no_fly_zones"
          ]
        },
        "report_id": null,
        "track": [],
        "created_at": "2026-10-19T21:33:07.222Z",
        "updated_at": "2026-10-19T21:33:07.222Z",
        "started_at": null,
        "ended_at": "2026-10-19T21:33:07.222Z"
      }
    }
  }
}

Approvals

A mission waits in pending_approval when any of these is true:

  • the request says "approval": "ask";
  • the rule that started it says ask;
  • the key that asked has missions:request but not missions:launch, as the partner key does.

approval.reasons lists which. A key with missions:approve then approves or denies it, and people do the same in Mission Control. Missions Claude requests wait for a person by default; see Claude.

Life cycle

The mission life cycle A request is refused by the safety gate (rejected), waits for approval (pending_approval, then approved or denied), or goes to queued. From queued a ready vehicle flies en_route, on_scene, returning, completed. Any status before the end can be cancelled; a flying mission fails on a vehicle fault, a critical battery or a restart. requested pending_approval denied queued en_route on_scene returning completed rejected cancelled failed needs approval safety gate refuses approve deny ready arrives looked lands cancel, from any status before the end fault, battery, restart
A request that needs no approval skips pending_approval, and one that finds a ready vehicle goes straight to en_route. A mission can be cancelled from any status before the end, pending_approval included. Dashed boxes are final.
StatusMeans
pending_approvalWaiting for a person to approve or deny it.
queuedApproved, or needing no approval, and waiting for a ready vehicle.
en_routeThe vehicle launched and is flying to the target.
on_sceneOver the target, looking; or flying the patrol.
returningDone looking and flying home. Its alerts are resolved when it lands.
completedLanded back on its dock. Final.
failedStopped by a vehicle fault, a battery below the critical level, or Ochio restarting during the flight. The vehicle flies home. Final.
cancelledSomeone cancelled it. A flying vehicle heads home. Final.
deniedA person turned it down. Final.
rejectedThe safety gate refused it. It never flew. Final.

Each change is added to the mission's history and sent as a mission.status_changed event. A new mission is announced with mission.created, which carries the status it starts in.

Progress

progress holds live numbers for the phase the mission is in:

PhaseFields
pending_approvalJust the phase.
queuedwaiting_for (vehicle or battery) and a detail sentence.
en_routedistance_to_target_m and eta_s.
on_sceneAn inspection: on_scene_remaining_s. A patrol: patrol_point of patrol_points.
returningdistance_to_home_m and eta_s.
FinalJust the phase.

While the vehicle flies, progress also carries battery_pct, distance_flown_m and the number of detections.

Progress on scene
{
  "phase": "on_scene",
  "on_scene_remaining_s": 14,
  "battery_pct": 95.6,
  "distance_flown_m": 523,
  "detections": 1
}

The mission object

The full record of one mission, from request to landing. This one answered an alert at the east gate and saw one person.

Attributes
idstring
The mission's id, msn_….
typestring
inspect or patrol.
statusstring
Where it is in its life cycle.
prioritystring
low to critical. Queued missions launch highest first.
reasonstringor null
Why it was requested, in words.
targetobject
What it flies to: kind (location, sensor, zone or alert), the id it was given, location, zone_id and a name people read.
patrol_pointsarrayor null
For a patrol, the corners of the zone it flies, in order.
vehicle_idstringor null
The vehicle flying it, once one is assigned.
requested_vehicle_idstringor null
The vehicle the request asked for, if any.
requested_bystring
Who asked: key:<name> or rule:<id>.
triggerobject
What started it: kind (request, alert or sensor_silent), rule_id, sensor_id, alert_ids, and the client named in the Ochio-Client header.
approvalobject
mode, whether it's required and the reasons, then the decision, decided_by, decided_at and note.
safetyobject
The safety gate's result and its checks.
on_scene_snumber
For an inspection, how long the drone looks, in seconds.
progressobject
Live numbers for the current phase. See progress.
historyarray
Every status it has had, each with time, actor and note.
alert_idsarray
Alerts it answers.
detection_idsarray
What its drone saw.
resultobjector null
Once it ends: outcome, reason, detections, battery_end_pct, distance_flown_m and report_id. A rejected mission has outcome, reason and failed_checks instead.
report_idstringor null
Its incident report, once it ends. A rejected mission has none.
trackarray
The path flown, as [lat, lon] pairs.
created_atstring
When it was requested.
updated_atstring
When it last changed.
started_atstringor null
When its vehicle launched.
ended_atstringor null
When it ended.
The mission object
{
  "id": "msn_e58e7523d2b5",
  "type": "inspect",
  "status": "completed",
  "priority": "high",
  "reason": "Motion on the perimeter: motion from East gate motion sensor 2",
  "target": {
    "kind": "alert",
    "alert_id": "alt_5037deb6aeee",
    "sensor_id": "east-gate-pir-02",
    "location": {
      "lat": 38.5005,
      "lon": -97.995
    },
    "zone_id": "east-gate",
    "name": "East gate motion sensor 2"
  },
  "patrol_points": null,
  "vehicle_id": "drone-2",
  "requested_vehicle_id": null,
  "requested_by": "rule:perimeter-motion",
  "trigger": {
    "kind": "alert",
    "rule_id": "perimeter-motion",
    "sensor_id": "east-gate-pir-02",
    "alert_ids": [
      "alt_5037deb6aeee"
    ]
  },
  "approval": {
    "mode": "auto",
    "required": false,
    "reasons": [],
    "decision": null,
    "decided_by": null,
    "decided_at": null,
    "note": null
  },
  "safety": {
    "result": "passed",
    "checks": [
      {
        "name": "inside_operating_area",
        "passed": true,
        "detail": "Target is inside the Depot operating area."
      },
      {
        "name": "outside_no_fly_zones",
        "passed": true,
        "detail": "Target is clear of no-fly zones."
      },
      {
        "name": "vehicle_capable",
        "passed": true,
        "detail": "2 vehicles with a camera."
      },
      {
        "name": "path_clear",
        "passed": true,
        "detail": "The straight path from the dock is clear of no-fly zones."
      },
      {
        "name": "within_range",
        "passed": true,
        "detail": "Round trip 1.0 km is within Drone 2's 6.0 km range."
      },
      {
        "name": "battery",
        "passed": true,
        "detail": "Drone 1 has 100% battery."
      }
    ],
    "checked_at": "2026-10-19T21:33:03.883Z"
  },
  "on_scene_s": 15.0,
  "progress": {
    "phase": "completed"
  },
  "history": [
    {
      "status": "requested",
      "time": "2026-10-19T21:33:03.883Z",
      "actor": "rule:perimeter-motion",
      "note": "Motion on the perimeter: motion from East gate motion sensor 2"
    },
    {
      "status": "en_route",
      "time": "2026-10-19T21:33:03.883Z",
      "actor": "vehicle:drone-2",
      "note": "Drone 2 launched"
    },
    {
      "status": "on_scene",
      "time": "2026-10-19T21:33:47.392Z",
      "actor": "vehicle:drone-2",
      "note": "Drone 2 over East gate motion sensor 2"
    },
    {
      "status": "returning",
      "time": "2026-10-19T21:34:02.486Z",
      "actor": "vehicle:drone-2",
      "note": "Drone 2 heading home"
    },
    {
      "status": "completed",
      "time": "2026-10-19T21:34:46.141Z",
      "actor": "vehicle:drone-2",
      "note": "Drone 2 landed back on its dock"
    }
  ],
  "alert_ids": [
    "alt_5037deb6aeee"
  ],
  "detection_ids": [
    "det_ff3034b71f11"
  ],
  "result": {
    "outcome": "completed",
    "reason": "Drone 2 landed back on its dock",
    "detections": 1,
    "battery_end_pct": 89.8,
    "distance_flown_m": 1047,
    "report_id": "rpt_ba61bdbb7b36"
  },
  "report_id": "rpt_ba61bdbb7b36",
  "track": [
    [
      38.499,
      -98.0007
    ],
    [
      38.4990346,
      -98.0005684
    ],
    [
      38.4990693,
      -98.0004368
    ]
  ],
  "created_at": "2026-10-19T21:33:03.883Z",
  "updated_at": "2026-10-19T21:34:46.141Z",
  "started_at": "2026-10-19T21:33:03.883Z",
  "ended_at": "2026-10-19T21:34:46.141Z"
}

Request a mission

POST/v1/missions
AccessAPI key · missions:request

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.

Send an Idempotency-Key so a retry never starts a second drone.

Headers
Idempotency-Keystring
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.
Ochio-Clientstring
The name of your app. Its first 40 characters are kept in trigger.client, so people can see where a mission came from.
Body
typestringrequired
inspect or patrol.
targetobjectrequired
Exactly one of these:
locationobject
A point: {"lat", "lon"}.
sensor_idstring
A registered sensor.
zone_idstring
A zone. Required for a patrol.
alert_idstring
An alert. The mission takes it.
approvalstring
auto launches when the gate and the key allow it; ask waits for a person. Default auto.
prioritystring
low, medium, high or critical. Default medium.
reasonstring
Why, in words, up to 500 characters. People see it in Mission Control and in the report.
vehicle_idstring
A vehicle to use. Leave it out to let Ochio pick.
on_scene_snumber
For inspect: seconds over the target, 1 to 600. Default: the site's setting (15).
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.

Errors
StatusCodeWhen
422safety_check_failedThe safety gate refused it; details.failed_checks says why.
400invalid_targetNot exactly one target, an id that doesn't exist, or a patrol without a zone.
400invalid_vehiclevehicle_id doesn't exist.
400invalid_requestA field is missing or out of range.
409idempotency_conflictThe Idempotency-Key was used with a different body.
Request
curl -X POST "$OCHIO_URL/v1/missions" \
  -H "Authorization: Bearer $OCHIO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 3b1e7c52-0d7f-4b8e-a1c4-5d2f9e6a7b10" \
  -H "Ochio-Client: night-desk" \
  -d '{
    "type": "patrol",
    "target": {
      "zone_id": "north-fence"
    },
    "priority": "medium",
    "reason": "Evening patrol of the north fence"
  }'
Response
{
  "id": "msn_520f729ca856",
  "type": "patrol",
  "status": "en_route",
  "priority": "medium",
  "reason": "Evening patrol of the north fence",
  "target": {
    "kind": "zone",
    "zone_id": "north-fence",
    "location": {
      "lat": 38.5037001,
      "lon": -98.0030001
    },
    "name": "North fence"
  },
  "patrol_points": [
    {
      "lat": 38.5025,
      "lon": -98.0065
    },
    {
      "lat": 38.5047,
      "lon": -98.0065
    },
    {
      "lat": 38.5049,
      "lon": -97.9995
    },
    {
      "lat": 38.5027,
      "lon": -97.9995
    }
  ],
  "vehicle_id": "drone-1",
  "requested_vehicle_id": null,
  "requested_by": "key:operator",
  "trigger": {
    "kind": "request",
    "rule_id": null,
    "sensor_id": null,
    "alert_ids": [],
    "client": "night-desk"
  },
  "approval": {
    "mode": "auto",
    "required": false,
    "reasons": [],
    "decision": null,
    "decided_by": null,
    "decided_at": null,
    "note": null
  },
  "safety": {
    "result": "passed",
    "checks": [
      {
        "name": "inside_operating_area",
        "passed": true,
        "detail": "Target is inside the Depot operating area."
      },
      {
        "name": "outside_no_fly_zones",
        "passed": true,
        "detail": "Target is clear of no-fly zones."
      },
      {
        "name": "vehicle_capable",
        "passed": true,
        "detail": "2 vehicles with a camera."
      },
      {
        "name": "path_clear",
        "passed": true,
        "detail": "The straight path from the dock is clear of no-fly zones."
      },
      {
        "name": "within_range",
        "passed": true,
        "detail": "Round trip 2.6 km is within Drone 2's 6.0 km range."
      },
      {
        "name": "battery",
        "passed": true,
        "detail": "Drone 1 has 100% battery."
      }
    ],
    "checked_at": "2026-10-19T21:33:07.207Z"
  },
  "on_scene_s": 15.0,
  "progress": {
    "phase": "en_route",
    "distance_to_target_m": 432,
    "eta_s": 36,
    "battery_pct": 100.0,
    "distance_flown_m": 0,
    "detections": 0
  },
  "history": [
    {
      "status": "requested",
      "time": "2026-10-19T21:33:07.207Z",
      "actor": "key:operator",
      "note": "Evening patrol of the north fence"
    },
    {
      "status": "en_route",
      "time": "2026-10-19T21:33:07.208Z",
      "actor": "vehicle:drone-1",
      "note": "Drone 1 launched"
    }
  ],
  "alert_ids": [],
  "detection_ids": [],
  "result": null,
  "report_id": null,
  "track": [
    [
      38.499,
      -98.001
    ]
  ],
  "created_at": "2026-10-19T21:33:07.207Z",
  "updated_at": "2026-10-19T21:33:07.207Z",
  "started_at": "2026-10-19T21:33:07.208Z",
  "ended_at": null
}

List missions

GET/v1/missions
AccessAPI key · read

Missions, newest first.

Query
statusstring
One status, active (waiting, queued or flying) or final (ended).
limitinteger
How many to return, 1 to 1,000. Default 100.
Returns

{"data": [...]} with a mission for each.

Request
curl "$OCHIO_URL/v1/missions?status=active" \
  -H "Authorization: Bearer $OCHIO_API_KEY"
Response
{
  "data": [
    {
      "id": "msn_ac7bd7106919",
      "type": "inspect",
      "status": "queued",
      "priority": "medium",
      "reason": "Check the generator yard before the shift change",
      "target": {
        "kind": "zone",
        "zone_id": "generator-yard",
        "location": {
          "lat": 38.4976991,
          "lon": -98.0047977
        },
        "name": "Generator yard"
      },
      "patrol_points": null,
      "vehicle_id": null,
      "requested_vehicle_id": null,
      "requested_by": "key:partner",
      "trigger": {
        "kind": "request",
        "rule_id": null,
        "sensor_id": null,
        "alert_ids": [],
        "client": null
      },
      "approval": {
        "mode": "auto",
        "required": true,
        "reasons": [
          "key:partner can request missions but not launch them"
        ],
        "decision": "approved",
        "decided_by": "key:operator",
        "decided_at": "2026-10-19T21:33:07.215Z",
        "note": "Go ahead"
      },
      "safety": {
        "result": "passed",
        "checks": [
          {
            "name": "inside_operating_area",
            "passed": true,
            "detail": "Target is inside the Depot operating area."
          },
          {
            "name": "outside_no_fly_zones",
            "passed": true,
            "detail": "Target is clear of no-fly zones."
          },
          {
            "name": "vehicle_capable",
            "passed": true,
            "detail": "2 vehicles with a camera."
          },
          {
            "name": "path_clear",
            "passed": true,
            "detail": "The straight path from the dock is clear of no-fly zones."
          },
          {
            "name": "within_range",
            "passed": true,
            "detail": "Round trip 0.7 km is within Drone 1's 6.0 km range."
          },
          {
            "name": "battery",
            "passed": true,
            "detail": "Drone 1 has 100% battery."
          }
        ],
        "checked_at": "2026-10-19T21:33:07.215Z"
      },
      "on_scene_s": 15.0,
      "progress": {
        "phase": "queued",
        "waiting_for": "vehicle",
        "detail": "Waiting for a free vehicle."
      },
      "history": [
        {
          "status": "requested",
          "time": "2026-10-19T21:33:07.212Z",
          "actor": "key:partner",
          "note": "Check the generator yard before the shift change"
        },
        {
          "status": "pending_approval",
          "time": "2026-10-19T21:33:07.212Z",
          "actor": "core",
          "note": "key:partner can request missions but not launch them"
        },
        {
          "status": "queued",
          "time": "2026-10-19T21:33:07.216Z",
          "actor": "key:operator",
          "note": "Approved: Go ahead. Waiting for a free vehicle."
        }
      ],
      "alert_ids": [],
      "detection_ids": [],
      "result": null,
      "report_id": null,
      "track": [],
      "created_at": "2026-10-19T21:33:07.212Z",
      "updated_at": "2026-10-19T21:33:07.216Z",
      "started_at": null,
      "ended_at": null
    },
    {
      "id": "msn_520f729ca856",
      "type": "patrol",
      "status": "en_route",
      "priority": "medium",
      "reason": "Evening patrol of the north fence",
      "target": {
        "kind": "zone",
        "zone_id": "north-fence",
        "location": {
          "lat": 38.5037001,
          "lon": -98.0030001
        },
        "name": "North fence"
      },
      "patrol_points": [
        {
          "lat": 38.5025,
          "lon": -98.0065
        },
        {
          "lat": 38.5047,
          "lon": -98.0065
        },
        {
          "lat": 38.5049,
          "lon": -97.9995
        },
        {
          "lat": 38.5027,
          "lon": -97.9995
        }
      ],
      "vehicle_id": "drone-1",
      "requested_vehicle_id": null,
      "requested_by": "key:operator",
      "trigger": {
        "kind": "request",
        "rule_id": null,
        "sensor_id": null,
        "alert_ids": [],
        "client": "night-desk"
      },
      "approval": {
        "mode": "auto",
        "required": false,
        "reasons": [],
        "decision": null,
        "decided_by": null,
        "decided_at": null,
        "note": null
      },
      "safety": {
        "result": "passed",
        "checks": [
          {
            "name": "inside_operating_area",
            "passed": true,
            "detail": "Target is inside the Depot operating area."
          },
          {
            "name": "outside_no_fly_zones",
            "passed": true,
            "detail": "Target is clear of no-fly zones."
          },
          {
            "name": "vehicle_capable",
            "passed": true,
            "detail": "2 vehicles with a camera."
          },
          {
            "name": "path_clear",
            "passed": true,
            "detail": "The straight path from the dock is clear of no-fly zones."
          },
          {
            "name": "within_range",
            "passed": true,
            "detail": "Round trip 2.6 km is within Drone 2's 6.0 km range."
          },
          {
            "name": "battery",
            "passed": true,
            "detail": "Drone 1 has 100% battery."
          }
        ],
        "checked_at": "2026-10-19T21:33:07.207Z"
      },
      "on_scene_s": 15.0,
      "progress": {
        "phase": "en_route",
        "distance_to_target_m": 432,
        "eta_s": 36,
        "battery_pct": 100.0,
        "distance_flown_m": 0,
        "detections": 0
      },
      "history": [
        {
          "status": "requested",
          "time": "2026-10-19T21:33:07.207Z",
          "actor": "key:operator",
          "note": "Evening patrol of the north fence"
        },
        {
          "status": "en_route",
          "time": "2026-10-19T21:33:07.208Z",
          "actor": "vehicle:drone-1",
          "note": "Drone 1 launched"
        }
      ],
      "alert_ids": [],
      "detection_ids": [],
      "result": null,
      "report_id": null,
      "track": [
        [
          38.499,
          -98.001
        ]
      ],
      "created_at": "2026-10-19T21:33:07.207Z",
      "updated_at": "2026-10-19T21:33:07.207Z",
      "started_at": "2026-10-19T21:33:07.208Z",
      "ended_at": null
    }
  ]
}

Get a mission

GET/v1/missions/{mission_id}
AccessAPI key · read

One mission, with its live progress.

Path
mission_idstringrequired
The mission's id, msn_….
Returns

The mission.

Errors
StatusCodeWhen
404not_foundNo mission with this id.
Request
curl "$OCHIO_URL/v1/missions/msn_e58e7523d2b5" \
  -H "Authorization: Bearer $OCHIO_API_KEY"
Response
{
  "id": "msn_e58e7523d2b5",
  "type": "inspect",
  "status": "en_route",
  "priority": "high",
  "reason": "Motion on the perimeter: motion from East gate motion sensor 2",
  "target": {
    "kind": "alert",
    "alert_id": "alt_5037deb6aeee",
    "sensor_id": "east-gate-pir-02",
    "location": {
      "lat": 38.5005,
      "lon": -97.995
    },
    "zone_id": "east-gate",
    "name": "East gate motion sensor 2"
  },
  "patrol_points": null,
  "vehicle_id": "drone-2",
  "requested_vehicle_id": null,
  "requested_by": "rule:perimeter-motion",
  "trigger": {
    "kind": "alert",
    "rule_id": "perimeter-motion",
    "sensor_id": "east-gate-pir-02",
    "alert_ids": [
      "alt_5037deb6aeee"
    ]
  },
  "approval": {
    "mode": "auto",
    "required": false,
    "reasons": [],
    "decision": null,
    "decided_by": null,
    "decided_at": null,
    "note": null
  },
  "safety": {
    "result": "passed",
    "checks": [
      {
        "name": "inside_operating_area",
        "passed": true,
        "detail": "Target is inside the Depot operating area."
      },
      {
        "name": "outside_no_fly_zones",
        "passed": true,
        "detail": "Target is clear of no-fly zones."
      },
      {
        "name": "vehicle_capable",
        "passed": true,
        "detail": "2 vehicles with a camera."
      },
      {
        "name": "path_clear",
        "passed": true,
        "detail": "The straight path from the dock is clear of no-fly zones."
      },
      {
        "name": "within_range",
        "passed": true,
        "detail": "Round trip 1.0 km is within Drone 2's 6.0 km range."
      },
      {
        "name": "battery",
        "passed": true,
        "detail": "Drone 1 has 100% battery."
      }
    ],
    "checked_at": "2026-10-19T21:33:03.883Z"
  },
  "on_scene_s": 15.0,
  "progress": {
    "phase": "en_route",
    "distance_to_target_m": 482,
    "eta_s": 40,
    "battery_pct": 99.7,
    "distance_flown_m": 41,
    "detections": 0
  },
  "history": [
    {
      "status": "requested",
      "time": "2026-10-19T21:33:03.883Z",
      "actor": "rule:perimeter-motion",
      "note": "Motion on the perimeter: motion from East gate motion sensor 2"
    },
    {
      "status": "en_route",
      "time": "2026-10-19T21:33:03.883Z",
      "actor": "vehicle:drone-2",
      "note": "Drone 2 launched"
    }
  ],
  "alert_ids": [
    "alt_5037deb6aeee"
  ],
  "detection_ids": [],
  "result": null,
  "report_id": null,
  "track": [
    [
      38.499,
      -98.0007
    ],
    [
      38.4990346,
      -98.0005684
    ],
    [
      38.4990693,
      -98.0004368
    ]
  ],
  "created_at": "2026-10-19T21:33:03.883Z",
  "updated_at": "2026-10-19T21:33:03.883Z",
  "started_at": "2026-10-19T21:33:03.883Z",
  "ended_at": null
}

Approve a mission

POST/v1/missions/{mission_id}/approve
AccessAPI key · missions:approve

Approves a mission waiting in pending_approval. The safety gate checks it again, then a ready vehicle launches, or it waits in queued.

Path
mission_idstringrequired
The mission's id.
Body

The body is optional.

notestring
A short note kept with the decision, up to 500 characters.
Returns

The mission: en_route, queued, or rejected if the gate now refuses it.

Errors
StatusCodeWhen
409invalid_stateIt isn't waiting for approval.
403missing_scopeThe key lacks missions:approve.
Request
curl -X POST "$OCHIO_URL/v1/missions/msn_ac7bd7106919/approve" \
  -H "Authorization: Bearer $OCHIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "note": "Go ahead"
  }'
Response
{
  "id": "msn_ac7bd7106919",
  "type": "inspect",
  "status": "queued",
  "priority": "medium",
  "reason": "Check the generator yard before the shift change",
  "target": {
    "kind": "zone",
    "zone_id": "generator-yard",
    "location": {
      "lat": 38.4976991,
      "lon": -98.0047977
    },
    "name": "Generator yard"
  },
  "patrol_points": null,
  "vehicle_id": null,
  "requested_vehicle_id": null,
  "requested_by": "key:partner",
  "trigger": {
    "kind": "request",
    "rule_id": null,
    "sensor_id": null,
    "alert_ids": [],
    "client": null
  },
  "approval": {
    "mode": "auto",
    "required": true,
    "reasons": [
      "key:partner can request missions but not launch them"
    ],
    "decision": "approved",
    "decided_by": "key:operator",
    "decided_at": "2026-10-19T21:33:07.215Z",
    "note": "Go ahead"
  },
  "safety": {
    "result": "passed",
    "checks": [
      {
        "name": "inside_operating_area",
        "passed": true,
        "detail": "Target is inside the Depot operating area."
      },
      {
        "name": "outside_no_fly_zones",
        "passed": true,
        "detail": "Target is clear of no-fly zones."
      },
      {
        "name": "vehicle_capable",
        "passed": true,
        "detail": "2 vehicles with a camera."
      },
      {
        "name": "path_clear",
        "passed": true,
        "detail": "The straight path from the dock is clear of no-fly zones."
      },
      {
        "name": "within_range",
        "passed": true,
        "detail": "Round trip 0.7 km is within Drone 1's 6.0 km range."
      },
      {
        "name": "battery",
        "passed": true,
        "detail": "Drone 1 has 100% battery."
      }
    ],
    "checked_at": "2026-10-19T21:33:07.215Z"
  },
  "on_scene_s": 15.0,
  "progress": {
    "phase": "queued",
    "waiting_for": "vehicle",
    "detail": "Waiting for a free vehicle."
  },
  "history": [
    {
      "status": "requested",
      "time": "2026-10-19T21:33:07.212Z",
      "actor": "key:partner",
      "note": "Check the generator yard before the shift change"
    },
    {
      "status": "pending_approval",
      "time": "2026-10-19T21:33:07.212Z",
      "actor": "core",
      "note": "key:partner can request missions but not launch them"
    },
    {
      "status": "queued",
      "time": "2026-10-19T21:33:07.216Z",
      "actor": "key:operator",
      "note": "Approved: Go ahead. Waiting for a free vehicle."
    }
  ],
  "alert_ids": [],
  "detection_ids": [],
  "result": null,
  "report_id": null,
  "track": [],
  "created_at": "2026-10-19T21:33:07.212Z",
  "updated_at": "2026-10-19T21:33:07.216Z",
  "started_at": null,
  "ended_at": null
}

Deny a mission

POST/v1/missions/{mission_id}/deny
AccessAPI key · missions:approve

Turns down a mission waiting in pending_approval. Its alerts go back to open, and a short report records the decision.

Path
mission_idstringrequired
The mission's id.
Body

The body is optional.

notestring
A short note kept with the decision, up to 500 characters.
Returns

The mission, now denied.

Errors
StatusCodeWhen
409invalid_stateIt isn't waiting for approval.
Request
curl -X POST "$OCHIO_URL/v1/missions/msn_1e2ffbc6d2f8/deny" \
  -H "Authorization: Bearer $OCHIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "note": "The trailer is expected"
  }'
Response
{
  "id": "msn_1e2ffbc6d2f8",
  "type": "inspect",
  "status": "denied",
  "priority": "low",
  "reason": "Look at the parked trailer",
  "target": {
    "kind": "location",
    "location": {
      "lat": 38.4975,
      "lon": -98.004
    },
    "zone_id": "generator-yard",
    "name": "38.49750, -98.00400"
  },
  "patrol_points": null,
  "vehicle_id": null,
  "requested_vehicle_id": null,
  "requested_by": "key:operator",
  "trigger": {
    "kind": "request",
    "rule_id": null,
    "sensor_id": null,
    "alert_ids": [],
    "client": null
  },
  "approval": {
    "mode": "ask",
    "required": true,
    "reasons": [
      "the request asked for approval"
    ],
    "decision": "denied",
    "decided_by": "key:operator",
    "decided_at": "2026-10-19T21:33:07.219Z",
    "note": "The trailer is expected"
  },
  "safety": {
    "result": "passed",
    "checks": [
      {
        "name": "inside_operating_area",
        "passed": true,
        "detail": "Target is inside the Depot operating area."
      },
      {
        "name": "outside_no_fly_zones",
        "passed": true,
        "detail": "Target is clear of no-fly zones."
      },
      {
        "name": "vehicle_capable",
        "passed": true,
        "detail": "2 vehicles with a camera."
      },
      {
        "name": "path_clear",
        "passed": true,
        "detail": "The straight path from the dock is clear of no-fly zones."
      },
      {
        "name": "within_range",
        "passed": true,
        "detail": "Round trip 0.6 km is within Drone 1's 6.0 km range."
      },
      {
        "name": "battery",
        "passed": true,
        "detail": "Drone 1 has 100% battery."
      }
    ],
    "checked_at": "2026-10-19T21:33:07.217Z"
  },
  "on_scene_s": 15.0,
  "progress": {
    "phase": "denied"
  },
  "history": [
    {
      "status": "requested",
      "time": "2026-10-19T21:33:07.217Z",
      "actor": "key:operator",
      "note": "Look at the parked trailer"
    },
    {
      "status": "pending_approval",
      "time": "2026-10-19T21:33:07.217Z",
      "actor": "core",
      "note": "the request asked for approval"
    },
    {
      "status": "denied",
      "time": "2026-10-19T21:33:07.219Z",
      "actor": "key:operator",
      "note": "key:operator denied the request (The trailer is expected)"
    }
  ],
  "alert_ids": [],
  "detection_ids": [],
  "result": {
    "outcome": "denied",
    "reason": "key:operator denied the request (The trailer is expected)",
    "detections": 0,
    "battery_end_pct": null,
    "distance_flown_m": 0,
    "report_id": "rpt_7e62e7adef23"
  },
  "report_id": "rpt_7e62e7adef23",
  "track": [],
  "created_at": "2026-10-19T21:33:07.217Z",
  "updated_at": "2026-10-19T21:33:07.219Z",
  "started_at": null,
  "ended_at": "2026-10-19T21:33:07.219Z"
}

Cancel a mission

POST/v1/missions/{mission_id}/cancel
AccessAPI key · missions:approve

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.

Path
mission_idstringrequired
The mission's id.
Body

The body is optional.

notestring
A short note kept with the decision, up to 500 characters.
Returns

The mission, now cancelled, with its result and report_id.

Errors
StatusCodeWhen
409invalid_stateIt has already ended.
Request
curl -X POST "$OCHIO_URL/v1/missions/msn_520f729ca856/cancel" \
  -H "Authorization: Bearer $OCHIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "note": "Guard is walking the fence"
  }'
Response
{
  "id": "msn_520f729ca856",
  "type": "patrol",
  "status": "cancelled",
  "priority": "medium",
  "reason": "Evening patrol of the north fence",
  "target": {
    "kind": "zone",
    "zone_id": "north-fence",
    "location": {
      "lat": 38.5037001,
      "lon": -98.0030001
    },
    "name": "North fence"
  },
  "patrol_points": [
    {
      "lat": 38.5025,
      "lon": -98.0065
    },
    {
      "lat": 38.5047,
      "lon": -98.0065
    },
    {
      "lat": 38.5049,
      "lon": -97.9995
    },
    {
      "lat": 38.5027,
      "lon": -97.9995
    }
  ],
  "vehicle_id": "drone-1",
  "requested_vehicle_id": null,
  "requested_by": "key:operator",
  "trigger": {
    "kind": "request",
    "rule_id": null,
    "sensor_id": null,
    "alert_ids": [],
    "client": "night-desk"
  },
  "approval": {
    "mode": "auto",
    "required": false,
    "reasons": [],
    "decision": null,
    "decided_by": null,
    "decided_at": null,
    "note": null
  },
  "safety": {
    "result": "passed",
    "checks": [
      {
        "name": "inside_operating_area",
        "passed": true,
        "detail": "Target is inside the Depot operating area."
      },
      {
        "name": "outside_no_fly_zones",
        "passed": true,
        "detail": "Target is clear of no-fly zones."
      },
      {
        "name": "vehicle_capable",
        "passed": true,
        "detail": "2 vehicles with a camera."
      },
      {
        "name": "path_clear",
        "passed": true,
        "detail": "The straight path from the dock is clear of no-fly zones."
      },
      {
        "name": "within_range",
        "passed": true,
        "detail": "Round trip 2.6 km is within Drone 2's 6.0 km range."
      },
      {
        "name": "battery",
        "passed": true,
        "detail": "Drone 1 has 100% battery."
      }
    ],
    "checked_at": "2026-10-19T21:33:07.207Z"
  },
  "on_scene_s": 15.0,
  "progress": {
    "phase": "cancelled"
  },
  "history": [
    {
      "status": "requested",
      "time": "2026-10-19T21:33:07.207Z",
      "actor": "key:operator",
      "note": "Evening patrol of the north fence"
    },
    {
      "status": "en_route",
      "time": "2026-10-19T21:33:07.208Z",
      "actor": "vehicle:drone-1",
      "note": "Drone 1 launched"
    },
    {
      "status": "on_scene",
      "time": "2026-10-19T21:33:43.163Z",
      "actor": "vehicle:drone-1",
      "note": "Drone 1 over North fence"
    },
    {
      "status": "cancelled",
      "time": "2026-10-19T21:34:00.356Z",
      "actor": "key:operator",
      "note": "key:operator cancelled it (Guard is walking the fence)"
    }
  ],
  "alert_ids": [],
  "detection_ids": [],
  "result": {
    "outcome": "cancelled",
    "reason": "key:operator cancelled it (Guard is walking the fence)",
    "detections": 0,
    "battery_end_pct": 94.7,
    "distance_flown_m": 637,
    "report_id": "rpt_c3d1d1973aca"
  },
  "report_id": "rpt_c3d1d1973aca",
  "track": [
    [
      38.499,
      -98.001
    ],
    [
      38.4991037,
      -98.000958
    ],
    [
      38.4992072,
      -98.000916
    ]
  ],
  "created_at": "2026-10-19T21:33:07.207Z",
  "updated_at": "2026-10-19T21:34:00.356Z",
  "started_at": "2026-10-19T21:33:07.208Z",
  "ended_at": "2026-10-19T21:34:00.356Z"
}