Ochio API
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.
How it works
Every request goes through the same loop, and the safety gate sits in the middle of it, so no app, rule or AI agent can go around it.
A sensor, a camera system or your own app sends an alert.
Your site's rules send a drone at once, ask a person first, or leave the alert for review.
Operating area, no-fly zones, the path, range and battery. A mission that fails a check never flies.
The ready drone that gets there first flies out, looks, and reports what it sees.
Every change reaches your systems as it happens, and each mission ends with an incident report.
Where the API lives
Ochio runs on premise or in your cloud, so each site's API is served by its own Ochio server. Every path starts with /v1.
Your administrator gives you the server's address and an API key. To try the API before that, run the sandbox on your computer. It answers at http://127.0.0.1:8700.
The examples on these pages read the address and the key from two environment variables, so they work as you paste them.
# your Ochio server, or the sandbox
export OCHIO_URL="http://127.0.0.1:8700"
export OCHIO_API_KEY="ochio_..."Quick start
Three requests: check the server, send an alert, and follow the drone it sends. They use the sandbox's demo site, where a high-priority alert on the north fence sends a drone at once.
1. Check the server
The health check needs no key. It tells you Ochio is up and which version answers.
curl "$OCHIO_URL/v1/health"import os
import requests
r = requests.get(f"{os.environ['OCHIO_URL']}/v1/health")
print(r.status_code, r.json())const res = await fetch(`${process.env.OCHIO_URL}/v1/health`);
console.log(res.status, await res.json());{
"status": "ok",
"version": "1.0.0",
"time": "2026-10-19T21:33:02.751Z",
"dev_mode": true,
"instance_id": "inst_72ff46ed59a2"
}2. Send an alert
This alert comes from a connected camera system, so it uses an API key. It names the sensor it's about, and Ochio places it in that sensor's zone.
The answer shows the alert, the rule that matched, and the mission it started: en_route means a drone is already on its way. A real sensor signs its alerts instead; see Send an alert.
curl -X POST "$OCHIO_URL/v1/alerts" \
-H "Authorization: Bearer $OCHIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "nf-cam-3-000981",
"source": "north-fence-pir-01",
"type": "person",
"priority": "high",
"title": "Person at the north fence"
}'import os
import requests
r = requests.post(
f"{os.environ['OCHIO_URL']}/v1/alerts",
headers={"Authorization": f"Bearer {os.environ['OCHIO_API_KEY']}"},
json={
"id": "nf-cam-3-000981",
"source": "north-fence-pir-01",
"type": "person",
"priority": "high",
"title": "Person at the north fence"
},
)
print(r.status_code, r.json())const res = await fetch(`${process.env.OCHIO_URL}/v1/alerts`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.OCHIO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
id: "nf-cam-3-000981",
source: "north-fence-pir-01",
type: "person",
priority: "high",
title: "Person at the north fence"
}),
});
console.log(res.status, await res.json());{
"result": "created",
"alert": {
"id": "alt_6cba16a5d837",
"source": "north-fence-pir-01",
"source_alert_id": "nf-cam-3-000981",
"version": 1,
"type": "person",
"priority": "high",
"location": {
"lat": 38.5033,
"lon": -98.0032
},
"zone_id": "north-fence",
"status": "responding",
"mission_id": "msn_d10f14f3ab2c",
"mission_history": [
"msn_d10f14f3ab2c"
],
"time": "2026-10-19T21:44:10.457Z",
"title": "Person at the north fence",
"description": null,
"media_url": null,
"data": null,
"received_by": "key:partner",
"dismissed_by": null,
"resolved_at": null,
"created_at": "2026-10-19T21:44:10.457Z",
"updated_at": "2026-10-19T21:44:10.458Z"
},
"mission": {
"id": "msn_d10f14f3ab2c",
"status": "en_route",
"vehicle_id": "drone-1"
},
"rule": {
"rule_id": "perimeter-motion",
"outcome": "mission_created",
"mission_id": "msn_d10f14f3ab2c",
"mission_status": "en_route"
}
}3. Follow the mission
Read the mission with the id from the answer. progress says how far the drone is from the target and when it gets there. When the mission ends, report_id points to its incident report.
To have every step pushed to you instead, subscribe a webhook or open the live stream.
curl "$OCHIO_URL/v1/missions/msn_d10f14f3ab2c" \
-H "Authorization: Bearer $OCHIO_API_KEY"import os
import requests
r = requests.get(
f"{os.environ['OCHIO_URL']}/v1/missions/msn_d10f14f3ab2c",
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_d10f14f3ab2c`, {
headers: { Authorization: `Bearer ${process.env.OCHIO_API_KEY}` },
});
console.log(res.status, await res.json());{
"id": "msn_d10f14f3ab2c",
"type": "inspect",
"status": "en_route",
"priority": "high",
"reason": "Motion on the perimeter: person from North fence motion sensor",
"target": {
"kind": "alert",
"alert_id": "alt_6cba16a5d837",
"sensor_id": "north-fence-pir-01",
"location": {
"lat": 38.5033,
"lon": -98.0032
},
"zone_id": "north-fence",
"name": "North fence motion sensor"
},
"patrol_points": null,
"vehicle_id": "drone-1",
"requested_vehicle_id": null,
"requested_by": "rule:perimeter-motion",
"trigger": {
"kind": "alert",
"rule_id": "perimeter-motion",
"sensor_id": "north-fence-pir-01",
"alert_ids": [
"alt_6cba16a5d837"
]
},
"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 1's 6.0 km range."
},
{
"name": "battery",
"passed": true,
"detail": "Drone 1 has 100% battery."
}
],
"checked_at": "2026-10-19T21:44:10.457Z"
},
"on_scene_s": 15.0,
"progress": {
"phase": "en_route",
"distance_to_target_m": 467,
"eta_s": 39,
"battery_pct": 99.6,
"distance_flown_m": 48,
"detections": 0
},
"history": [
{
"status": "requested",
"time": "2026-10-19T21:44:10.457Z",
"actor": "rule:perimeter-motion",
"note": "Motion on the perimeter: person from North fence motion sensor"
},
{
"status": "en_route",
"time": "2026-10-19T21:44:10.457Z",
"actor": "vehicle:drone-1",
"note": "Drone 1 launched"
}
],
"alert_ids": [
"alt_6cba16a5d837"
],
"detection_ids": [],
"result": null,
"report_id": null,
"track": [
[
38.499,
-98.001
],
[
38.4991012,
-98.0010518
],
[
38.499202,
-98.0011033
]
],
"created_at": "2026-10-19T21:44:10.457Z",
"updated_at": "2026-10-19T21:44:10.457Z",
"started_at": "2026-10-19T21:44:10.457Z",
"ended_at": null
}Conventions
- Requests and answers are JSON in UTF-8. Send
Content-Type: application/jsonwith a body. - Times are ISO 8601 in UTC with milliseconds and a
Z, like2026-10-19T21:33:03.882Z. Alerts also accept Unix seconds or milliseconds. - Positions are
{"lat", "lon"}in decimal degrees. Field names carry their units:_mmeters,_sseconds,_pctpercent,_mpsmeters per second. - Ids made by Ochio carry a prefix:
alt_alerts,msn_missions,det_detections,rpt_reports,evt_events,whk_webhooks,dlv_deliveries,key_API keys. Sensors, vehicles, zones and rules have readable ids, likenorth-fence-pir-01. - Lists answer
{"data": [...]}. Alerts, missions, detections and reports come newest first and takelimit(1 to 1,000, default 100; a value outside is brought into range). Events have their own paging. - Errors answer
{"error": {"code", "message", "details"}}with an HTTP status. See Errors. - v1 is stable: new fields may be added, but nothing in v1 is renamed or removed. Ignore fields you don't use.
What you can build
Postman and OpenAPI
Every endpoint on these pages is also in a Postman collection and an OpenAPI 3.1 file, with the same examples. Postman and OpenAPI shows how to import and run them.