API docs
Get started

Errors

Every error has the same shape: an HTTP status, a code your program can check, and a message a person can read.

The error shape

The body of every error is one error object:

FieldWhat it holds
codeA short, stable code, like safety_check_failed. Check this in your code.
messageA sentence for a person. It may change, so don't parse it.
detailsPresent on some errors: the failed safety checks, the fields that aren't valid, or the scope a key is missing.

Most requests that aren't valid list each problem in details, with the field it's about.

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"
      }
    }
  }
}

HTTP statuses

StatusMeans
200 OKDone. Also the answer to an alert Ochio already had (updated, duplicate or stale).
201 CreatedA new alert, sensor, mission, webhook or key.
400 Bad RequestThe body or a parameter isn't valid. Fix the request before you send it again.
401 UnauthorizedNo key, a key Ochio doesn't know, or a sensor signature that doesn't check out.
403 ForbiddenThe key is valid but lacks the scope this needs.
404 Not FoundNo such record, or no such endpoint.
405 Method Not AllowedThe path exists, but not with this method.
409 ConflictThe request clashes with the record's state: approving a mission that isn't waiting, a sensor id that's taken.
422 UnprocessableThe safety gate refused the mission. It's recorded as rejected and never flies.

Error codes

CodeStatusWhat happenedWhat to do
invalid_request400A field is missing, has the wrong type, or is out of range. details usually lists each one.Fix the fields named in details or the message.
invalid_json400The body of an alert or check-in isn't valid JSON.Send one JSON object.
invalid_target400A mission's target doesn't have exactly one of its four kinds, names something that doesn't exist, or a patrol has no zone.Send one target; patrols need zone_id.
invalid_vehicle400vehicle_id names a vehicle that doesn't exist.Use an id from GET /v1/vehicles.
unauthorized401No API key, or not sent as Bearer.Send Authorization: Bearer <key>.
invalid_key401The key isn't valid.Check the key; ask an admin for a new one.
missing_signature401One of the two signature headers is missing.Send both headers.
invalid_signature401The signature doesn't match the body.Sign the exact bytes you send, with the current secret.
timestamp_out_of_range401The signing time is more than 300 seconds off.Set the sensor's clock, then sign again.
missing_scope403The key lacks the scope this needs; on most endpoints details.required_scope names it.Use a key with that scope.
not_found404No record with that id, or no such endpoint.Check the id and the path.
unknown_sensor404An alert, or a signed check-in, names a sensor that isn't registered.Register it first.
method_not_allowed405Wrong method for this path.Check the method.
sensor_exists409A sensor with that id is already registered.Pick another id, or rotate the existing sensor's secret.
key_exists409An API key with that name exists.Pick another name.
key_in_use409A key tried to revoke itself.Revoke it with another admin key.
invalid_state409The mission isn't in a state that allows this: approving one that isn't waiting, or cancelling one that has ended.Read the mission's status first.
alert_closed409The alert is already resolved or dismissed.Nothing to do.
idempotency_conflict409The Idempotency-Key was used before with a different body.Use a new key for a new mission.
not_simulated409A sandbox control was used on a real sensor.Use it on simulated sensors only.
safety_check_failed422The safety gate refused the mission. details.failed_checks says why.Change the target or the vehicle. Don't retry as is.

Retrying safely

  • Network errors and 5xx answers are worth retrying, with a growing wait. 4xx answers mean the request itself needs a change.
  • Alerts are safe to send again: the same source, id and version answer duplicate and change nothing.
  • Missions are safe to send again with the same Idempotency-Key: Ochio answers with the first mission instead of starting a second one, for 24 hours.
  • Approvals, denials and cancels can't happen twice: a second one answers 409 invalid_state.
  • Webhook deliveries are retried by Ochio. Receivers should skip an event id they've already handled.