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
| Type | What the drone does |
|---|---|
inspect | Flies to the target, looks for on_scene_s seconds (15 by default), and flies home. |
patrol | Flies the outline of a zone, corner to corner, and flies home. |
A mission has exactly one target:
| Target | Flies 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.
| Check | Fails when | Then |
|---|---|---|
inside_operating_area | The target is outside the site's operating area. | Refused |
outside_no_fly_zones | The target is inside a no-fly zone. | Refused |
vehicle_capable | No vehicle has what the mission needs: a camera, for both types. | Refused |
path_clear | Every straight path from a dock to the target, or between patrol corners, crosses a no-fly zone. | Refused |
within_range | The round trip is longer than the vehicle's range. | Refused |
battery | Every 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.
{
"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:requestbut notmissions: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
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.| Status | Means |
|---|---|
pending_approval | Waiting for a person to approve or deny it. |
queued | Approved, or needing no approval, and waiting for a ready vehicle. |
en_route | The vehicle launched and is flying to the target. |
on_scene | Over the target, looking; or flying the patrol. |
returning | Done looking and flying home. Its alerts are resolved when it lands. |
completed | Landed back on its dock. Final. |
failed | Stopped by a vehicle fault, a battery below the critical level, or Ochio restarting during the flight. The vehicle flies home. Final. |
cancelled | Someone cancelled it. A flying vehicle heads home. Final. |
denied | A person turned it down. Final. |
rejected | The 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:
| Phase | Fields |
|---|---|
pending_approval | Just the phase. |
queued | waiting_for (vehicle or battery) and a detail sentence. |
en_route | distance_to_target_m and eta_s. |
on_scene | An inspection: on_scene_remaining_s. A patrol: patrol_point of patrol_points. |
returning | distance_to_home_m and eta_s. |
| Final | Just the phase. |
While the vehicle flies, progress also carries battery_pct, distance_flown_m and the number of detections.
{
"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.
Attributesmsn_….inspect or patrol.low to critical. Queued missions launch highest first.kind (location, sensor, zone or alert), the id it was given, location, zone_id and a name people read.key:<name> or rule:<id>.kind (request, alert or sensor_silent), rule_id, sensor_id, alert_ids, and the client named in the Ochio-Client header.mode, whether it's required and the reasons, then the decision, decided_by, decided_at and note.time, actor and note.outcome, reason, detections, battery_end_pct, distance_flown_m and report_id. A rejected mission has outcome, reason and failed_checks instead.rejected mission has none.[lat, lon] pairs.{
"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
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.
Idempotent-Replayed: true, instead of starting another mission.trigger.client, so people can see where a mission came from.inspect or patrol.{"lat", "lon"}.auto launches when the gate and the key allow it; ask waits for a person. Default auto.low, medium, high or critical. Default medium.inspect: seconds over the target, 1 to 600. Default: the site's setting (15).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.
| Status | Code | When |
|---|---|---|
422 | safety_check_failed | The safety gate refused it; details.failed_checks says why. |
400 | invalid_target | Not exactly one target, an id that doesn't exist, or a patrol without a zone. |
400 | invalid_vehicle | vehicle_id doesn't exist. |
400 | invalid_request | A field is missing or out of range. |
409 | idempotency_conflict | The Idempotency-Key was used with a different body. |
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"
}'import os
import requests
r = requests.post(
f"{os.environ['OCHIO_URL']}/v1/missions",
headers={
"Authorization": f"Bearer {os.environ['OCHIO_API_KEY']}",
"Idempotency-Key": "3b1e7c52-0d7f-4b8e-a1c4-5d2f9e6a7b10",
"Ochio-Client": "night-desk",
},
json={
"type": "patrol",
"target": {
"zone_id": "north-fence"
},
"priority": "medium",
"reason": "Evening patrol of the north fence"
},
)
print(r.status_code, r.json())const res = await fetch(`${process.env.OCHIO_URL}/v1/missions`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.OCHIO_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": "3b1e7c52-0d7f-4b8e-a1c4-5d2f9e6a7b10",
"Ochio-Client": "night-desk",
},
body: JSON.stringify({
type: "patrol",
target: {
zone_id: "north-fence"
},
priority: "medium",
reason: "Evening patrol of the north fence"
}),
});
console.log(res.status, await res.json());{
"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
}{
"id": "msn_ac7bd7106919",
"type": "inspect",
"status": "pending_approval",
"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": 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 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.212Z"
},
"on_scene_s": 15.0,
"progress": {
"phase": "pending_approval"
},
"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"
}
],
"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.212Z",
"started_at": null,
"ended_at": null
}HTTP/1.1 201 Created
Idempotent-Replayed: true
{
"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
}{
"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"
}
}
}
}List missions
Missions, newest first.
Queryactive (waiting, queued or flying) or final (ended).{"data": [...]} with a mission for each.
curl "$OCHIO_URL/v1/missions?status=active" \
-H "Authorization: Bearer $OCHIO_API_KEY"import os
import requests
r = requests.get(
f"{os.environ['OCHIO_URL']}/v1/missions",
headers={"Authorization": f"Bearer {os.environ['OCHIO_API_KEY']}"},
params={
"status": "active"
},
)
print(r.status_code, r.json())const res = await fetch(`${process.env.OCHIO_URL}/v1/missions?status=active`, {
headers: { Authorization: `Bearer ${process.env.OCHIO_API_KEY}` },
});
console.log(res.status, await res.json());{
"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
One mission, with its live progress.
Pathmsn_….The mission.
Errors| Status | Code | When |
|---|---|---|
404 | not_found | No mission with this id. |
curl "$OCHIO_URL/v1/missions/msn_e58e7523d2b5" \
-H "Authorization: Bearer $OCHIO_API_KEY"import os
import requests
r = requests.get(
f"{os.environ['OCHIO_URL']}/v1/missions/msn_e58e7523d2b5",
headers={"Authorization": f"Bearer {os.environ['OCHIO_API_KEY']}"},
)
print(r.status_code, r.json())const res = await fetch(`${process.env.OCHIO_URL}/v1/missions/msn_e58e7523d2b5`, {
headers: { Authorization: `Bearer ${process.env.OCHIO_API_KEY}` },
});
console.log(res.status, await res.json());{
"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
Approves a mission waiting in pending_approval. The safety gate checks it again, then a ready vehicle launches, or it waits in queued.
The body is optional.
The mission: en_route, queued, or rejected if the gate now refuses it.
| Status | Code | When |
|---|---|---|
409 | invalid_state | It isn't waiting for approval. |
403 | missing_scope | The key lacks missions:approve. |
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"
}'import os
import requests
r = requests.post(
f"{os.environ['OCHIO_URL']}/v1/missions/msn_ac7bd7106919/approve",
headers={"Authorization": f"Bearer {os.environ['OCHIO_API_KEY']}"},
json={
"note": "Go ahead"
},
)
print(r.status_code, r.json())const res = await fetch(`${process.env.OCHIO_URL}/v1/missions/msn_ac7bd7106919/approve`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.OCHIO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
note: "Go ahead"
}),
});
console.log(res.status, await res.json());{
"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
}{
"error": {
"code": "invalid_state",
"message": "Mission msn_1e2ffbc6d2f8 is denied; only missions waiting for approval can be approved."
}
}{
"error": {
"code": "missing_scope",
"message": "This key does not have the missions:approve scope.",
"details": {
"required_scope": "missions:approve"
}
}
}Deny a mission
Turns down a mission waiting in pending_approval. Its alerts go back to open, and a short report records the decision.
The body is optional.
The mission, now denied.
| Status | Code | When |
|---|---|---|
409 | invalid_state | It isn't waiting for approval. |
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"
}'import os
import requests
r = requests.post(
f"{os.environ['OCHIO_URL']}/v1/missions/msn_1e2ffbc6d2f8/deny",
headers={"Authorization": f"Bearer {os.environ['OCHIO_API_KEY']}"},
json={
"note": "The trailer is expected"
},
)
print(r.status_code, r.json())const res = await fetch(`${process.env.OCHIO_URL}/v1/missions/msn_1e2ffbc6d2f8/deny`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.OCHIO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
note: "The trailer is expected"
}),
});
console.log(res.status, await res.json());{
"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
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.
The body is optional.
The mission, now cancelled, with its result and report_id.
| Status | Code | When |
|---|---|---|
409 | invalid_state | It has already ended. |
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"
}'import os
import requests
r = requests.post(
f"{os.environ['OCHIO_URL']}/v1/missions/msn_520f729ca856/cancel",
headers={"Authorization": f"Bearer {os.environ['OCHIO_API_KEY']}"},
json={
"note": "Guard is walking the fence"
},
)
print(r.status_code, r.json())const res = await fetch(`${process.env.OCHIO_URL}/v1/missions/msn_520f729ca856/cancel`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.OCHIO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
note: "Guard is walking the fence"
}),
});
console.log(res.status, await res.json());{
"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"
}