API docs
API v1

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.

REST and JSONSigned webhooksLive event streamOpenAPI 3.1

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.

01An alert comes in

A sensor, a camera system or your own app sends an alert.

02Rules decide

Your site's rules send a drone at once, ask a person first, or leave the alert for review.

03The safety gate checks

Operating area, no-fly zones, the path, range and battery. A mission that fails a check never flies.

04A drone flies

The ready drone that gets there first flies out, looks, and reports what it sees.

05Results go out

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.

Set up your shell
# 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

GET/v1/health
AccessNo key needed

The health check needs no key. It tells you Ochio is up and which version answers.

Request
curl "$OCHIO_URL/v1/health"
Response
{
  "status": "ok",
  "version": "1.0.0",
  "time": "2026-10-19T21:33:02.751Z",
  "dev_mode": true,
  "instance_id": "inst_72ff46ed59a2"
}

2. Send an alert

POST/v1/alerts
AccessAPI key · alerts:write

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.

Request
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"
  }'
Response
{
  "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

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

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.

Request
curl "$OCHIO_URL/v1/missions/msn_d10f14f3ab2c" \
  -H "Authorization: Bearer $OCHIO_API_KEY"
Response
{
  "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/json with a body.
  • Times are ISO 8601 in UTC with milliseconds and a Z, like 2026-10-19T21:33:03.882Z. Alerts also accept Unix seconds or milliseconds.
  • Positions are {"lat", "lon"} in decimal degrees. Field names carry their units: _m meters, _s seconds, _pct percent, _mps meters 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, like north-fence-pir-01.
  • Lists answer {"data": [...]}. Alerts, missions, detections and reports come newest first and take limit (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.