API docs
API reference

Webhooks

Ochio sends the events you choose to your own URL, signed, as they happen, and keeps trying until you answer.

How deliveries work

Each delivery is a POST of one event as JSON, with these headers:

HeaderHolds
Ochio-Event-IdThe event's id.
Ochio-Event-TypeThe event's type.
Ochio-Delivery-Attempt1 for the first try, then 2, 3…
Ochio-Timestamp, Ochio-SignatureThe signature. Check it before you trust the body.
User-AgentOchio-Webhooks/1.0
  • Answer with any 2xx within 5 seconds and the delivery counts. Do slow work after you answer.
  • Anything else is retried: 7 tries in all, waiting 1 second, 10 seconds, 100 seconds, then about 17 minutes three times.
  • Ochio sends one delivery at a time per subscription, oldest event first. A retry doesn't hold back newer events, so order by seq.
  • An event can arrive twice. Skip an id you've already handled.
A delivery
POST /ochio-webhooks HTTP/1.1
Host: desk.example.com
Content-Type: application/json
User-Agent: Ochio-Webhooks/1.0
Ochio-Event-Id: evt_0afc92ec29cc
Ochio-Event-Type: report.ready
Ochio-Delivery-Attempt: 1
Ochio-Timestamp: 1792445686
Ochio-Signature: v1=75989541765ed34088d2cf6a266b170e15d503defd734c45c1536116f03d7556

{
  "id": "evt_0afc92ec29cc",
  "seq": 41,
  "type": "report.ready",
  "time": "2026-10-19T21:34:46.141Z",
  "actor": "core",
  "subject": "rpt_ba61bdbb7b36",
  "data": {
    "report_id": "rpt_ba61bdbb7b36",
    "mission_id": "msn_e58e7523d2b5",
    "outcome": "completed",
    "summary": "Drone 2 checked a critical motion alert from East gate motion sensor 2 and saw 1 person. It landed back on its dock with 90% battery after flying 1.0 km.",
    "detections": 1,
    "url": "/v1/reports/rpt_ba61bdbb7b36?format=html"
  }
}
The body arrives as compact JSON, signed byte for byte; it's spaced out here to read.

The webhook object

FieldHolds
idThe subscription's id, whk_….
urlWhere deliveries go.
event_typesThe event types it receives.
descriptionYour note about it.
enabledWhether it receives deliveries. It's set when the subscription is made; to change it, delete the subscription and make it again.
ownerThe name of the key that made it. A key without admin sees only its own subscriptions.
statsdelivered, failed_attempts, gave_up, last_status and last_attempt_at.
The webhook object
{
  "id": "whk_1cee4f976d10",
  "url": "https://desk.example.com/ochio-webhooks",
  "event_types": [
    "mission.*",
    "detection.created",
    "report.ready"
  ],
  "description": "Security desk",
  "enabled": true,
  "owner": "partner",
  "stats": {
    "delivered": 17,
    "failed_attempts": 0,
    "gave_up": 0,
    "last_status": 200,
    "last_attempt_at": "2026-10-19T21:34:46.348Z"
  },
  "created_at": "2026-10-19T21:33:02.762Z",
  "updated_at": "2026-10-19T21:33:02.762Z"
}

Create a webhook

POST/v1/webhooks
AccessAPI key · webhooks:write

Subscribes a URL to events. The answer holds the signing secret, shown once.

Body
urlstringrequired
Where to send deliveries: http:// or https://, up to 2,000 characters. Use HTTPS outside a closed network.
event_typesarray
Exact types, prefixes like mission.*, or *. Default ["*"].
descriptionstring
A note, up to 200 characters.
enabledboolean
Default true.
Returns

201 with the webhook and its secret.

Errors
StatusCodeWhen
400invalid_requestThe URL isn't http or https, an event type is unknown, or the URL points back at Ochio itself.
Request
curl -X POST "$OCHIO_URL/v1/webhooks" \
  -H "Authorization: Bearer $OCHIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://desk.example.com/ochio-webhooks",
    "event_types": [
      "mission.*",
      "detection.created",
      "report.ready"
    ],
    "description": "Security desk"
  }'
Response
{
  "id": "whk_1cee4f976d10",
  "url": "https://desk.example.com/ochio-webhooks",
  "event_types": [
    "mission.*",
    "detection.created",
    "report.ready"
  ],
  "description": "Security desk",
  "enabled": true,
  "owner": "partner",
  "stats": {
    "delivered": 0,
    "failed_attempts": 0,
    "gave_up": 0,
    "last_status": null,
    "last_attempt_at": null
  },
  "created_at": "2026-10-19T21:33:02.762Z",
  "updated_at": "2026-10-19T21:33:02.762Z",
  "secret": "whsec_test_example_secret_000000000003"
}

List webhooks

GET/v1/webhooks
AccessAPI key · read

Your key's subscriptions; every subscription for a key with admin.

Returns

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

Request
curl "$OCHIO_URL/v1/webhooks" \
  -H "Authorization: Bearer $OCHIO_API_KEY"
Response
{
  "data": [
    {
      "id": "whk_1cee4f976d10",
      "url": "https://desk.example.com/ochio-webhooks",
      "event_types": [
        "mission.*",
        "detection.created",
        "report.ready"
      ],
      "description": "Security desk",
      "enabled": true,
      "owner": "partner",
      "stats": {
        "delivered": 17,
        "failed_attempts": 0,
        "gave_up": 0,
        "last_status": 200,
        "last_attempt_at": "2026-10-19T21:34:46.348Z"
      },
      "created_at": "2026-10-19T21:33:02.762Z",
      "updated_at": "2026-10-19T21:33:02.762Z"
    }
  ]
}

Get a webhook

GET/v1/webhooks/{webhook_id}
AccessAPI key · read

One subscription, with its delivery counts.

Path
webhook_idstringrequired
The webhook's id, whk_….
Returns

The webhook.

Errors
StatusCodeWhen
404not_foundNo webhook with this id that this key can see.
Request
curl "$OCHIO_URL/v1/webhooks/whk_1cee4f976d10" \
  -H "Authorization: Bearer $OCHIO_API_KEY"
Response
{
  "id": "whk_1cee4f976d10",
  "url": "https://desk.example.com/ochio-webhooks",
  "event_types": [
    "mission.*",
    "detection.created",
    "report.ready"
  ],
  "description": "Security desk",
  "enabled": true,
  "owner": "partner",
  "stats": {
    "delivered": 17,
    "failed_attempts": 0,
    "gave_up": 0,
    "last_status": 200,
    "last_attempt_at": "2026-10-19T21:34:46.348Z"
  },
  "created_at": "2026-10-19T21:33:02.762Z",
  "updated_at": "2026-10-19T21:33:02.762Z"
}

List deliveries

GET/v1/webhooks/{webhook_id}/deliveries
AccessAPI key · read

Recent delivery attempts, newest first, and what's still waiting to go. Start here when a receiver says it missed something. Ochio keeps the newest 500 attempts per subscription, 200 of them across a restart.

Path
webhook_idstringrequired
The webhook's id.
Query
limitinteger
How many attempts, 1 to 500. Default 100.
Returns

data: attempts, each with event_id, event_seq, event_type, attempt, ok, status_code, error, duration_ms and next_retry_at. pending: deliveries still to try, with due_at.

Request
curl "$OCHIO_URL/v1/webhooks/whk_1cee4f976d10/deliveries?limit=3" \
  -H "Authorization: Bearer $OCHIO_API_KEY"
Response
{
  "data": [
    {
      "id": "dlv_15c5d71d2597",
      "webhook_id": "whk_1cee4f976d10",
      "event_id": "evt_3e86ddc85305",
      "event_seq": 49,
      "event_type": "webhook.test",
      "attempt": 1,
      "time": "2026-10-19T21:34:47.151Z",
      "ok": true,
      "status_code": 200,
      "error": null,
      "duration_ms": 2,
      "next_retry_at": null
    },
    {
      "id": "dlv_a25bdc341034",
      "webhook_id": "whk_1cee4f976d10",
      "event_id": "evt_9606842804d6",
      "event_seq": 48,
      "event_type": "report.ready",
      "attempt": 1,
      "time": "2026-10-19T21:34:46.951Z",
      "ok": true,
      "status_code": 200,
      "error": null,
      "duration_ms": 3,
      "next_retry_at": null
    },
    {
      "id": "dlv_205949bc8cf7",
      "webhook_id": "whk_1cee4f976d10",
      "event_id": "evt_c5788d8f7782",
      "event_seq": 46,
      "event_type": "mission.status_changed",
      "attempt": 1,
      "time": "2026-10-19T21:34:46.750Z",
      "ok": true,
      "status_code": 200,
      "error": null,
      "duration_ms": 3,
      "next_retry_at": null
    }
  ],
  "pending": []
}

Send a test delivery

POST/v1/webhooks/{webhook_id}/test
AccessAPI key · webhooks:write

Sends a webhook.test event to this subscription only, whatever types it chose. Use it to check your receiver and its signature check. A subscription made with enabled: false gets nothing, this test included.

Path
webhook_idstringrequired
The webhook's id.
Returns

{"queued": true, "event": {...}} with the test event.

Request
curl -X POST "$OCHIO_URL/v1/webhooks/whk_1cee4f976d10/test" \
  -H "Authorization: Bearer $OCHIO_API_KEY"
Response
{
  "queued": true,
  "event": {
    "id": "evt_3e86ddc85305",
    "seq": 49,
    "type": "webhook.test",
    "time": "2026-10-19T21:34:46.537Z",
    "actor": "key:partner",
    "subject": "whk_1cee4f976d10",
    "data": {
      "webhook_id": "whk_1cee4f976d10",
      "message": "Test delivery from Ochio core."
    }
  }
}

Delete a webhook

DELETE/v1/webhooks/{webhook_id}
AccessAPI key · webhooks:write

Ends the subscription. Deliveries still waiting are dropped.

Path
webhook_idstringrequired
The webhook's id.
Returns

{"id", "deleted": true}.

Errors
StatusCodeWhen
404not_foundNo webhook with this id that this key can see.
Request
curl -X DELETE "$OCHIO_URL/v1/webhooks/whk_1cee4f976d10" \
  -H "Authorization: Bearer $OCHIO_API_KEY"
Response
{
  "id": "whk_1cee4f976d10",
  "deleted": true
}