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:
| Header | Holds |
|---|---|
Ochio-Event-Id | The event's id. |
Ochio-Event-Type | The event's type. |
Ochio-Delivery-Attempt | 1 for the first try, then 2, 3… |
Ochio-Timestamp, Ochio-Signature | The signature. Check it before you trust the body. |
User-Agent | Ochio-Webhooks/1.0 |
- Answer with any
2xxwithin 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
idyou've already handled.
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 webhook object
| Field | Holds |
|---|---|
id | The subscription's id, whk_…. |
url | Where deliveries go. |
event_types | The event types it receives. |
description | Your note about it. |
enabled | Whether it receives deliveries. It's set when the subscription is made; to change it, delete the subscription and make it again. |
owner | The name of the key that made it. A key without admin sees only its own subscriptions. |
stats | delivered, failed_attempts, gave_up, last_status and last_attempt_at. |
{
"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
Subscribes a URL to events. The answer holds the signing secret, shown once.
Bodyhttp:// or https://, up to 2,000 characters. Use HTTPS outside a closed network.mission.*, or *. Default ["*"].true.201 with the webhook and its secret.
| Status | Code | When |
|---|---|---|
400 | invalid_request | The URL isn't http or https, an event type is unknown, or the URL points back at Ochio itself. |
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"
}'import os
import requests
r = requests.post(
f"{os.environ['OCHIO_URL']}/v1/webhooks",
headers={"Authorization": f"Bearer {os.environ['OCHIO_API_KEY']}"},
json={
"url": "https://desk.example.com/ochio-webhooks",
"event_types": [
"mission.*",
"detection.created",
"report.ready"
],
"description": "Security desk"
},
)
print(r.status_code, r.json())const res = await fetch(`${process.env.OCHIO_URL}/v1/webhooks`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.OCHIO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://desk.example.com/ochio-webhooks",
event_types: [
"mission.*",
"detection.created",
"report.ready"
],
description: "Security desk"
}),
});
console.log(res.status, await res.json());{
"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
Your key's subscriptions; every subscription for a key with admin.
{"data": [...]} with a webhook for each.
curl "$OCHIO_URL/v1/webhooks" \
-H "Authorization: Bearer $OCHIO_API_KEY"import os
import requests
r = requests.get(
f"{os.environ['OCHIO_URL']}/v1/webhooks",
headers={"Authorization": f"Bearer {os.environ['OCHIO_API_KEY']}"},
)
print(r.status_code, r.json())const res = await fetch(`${process.env.OCHIO_URL}/v1/webhooks`, {
headers: { Authorization: `Bearer ${process.env.OCHIO_API_KEY}` },
});
console.log(res.status, await res.json());{
"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
One subscription, with its delivery counts.
Pathwhk_….The webhook.
Errors| Status | Code | When |
|---|---|---|
404 | not_found | No webhook with this id that this key can see. |
curl "$OCHIO_URL/v1/webhooks/whk_1cee4f976d10" \
-H "Authorization: Bearer $OCHIO_API_KEY"import os
import requests
r = requests.get(
f"{os.environ['OCHIO_URL']}/v1/webhooks/whk_1cee4f976d10",
headers={"Authorization": f"Bearer {os.environ['OCHIO_API_KEY']}"},
)
print(r.status_code, r.json())const res = await fetch(`${process.env.OCHIO_URL}/v1/webhooks/whk_1cee4f976d10`, {
headers: { Authorization: `Bearer ${process.env.OCHIO_API_KEY}` },
});
console.log(res.status, await res.json());{
"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
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.
Pathdata: 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.
curl "$OCHIO_URL/v1/webhooks/whk_1cee4f976d10/deliveries?limit=3" \
-H "Authorization: Bearer $OCHIO_API_KEY"import os
import requests
r = requests.get(
f"{os.environ['OCHIO_URL']}/v1/webhooks/whk_1cee4f976d10/deliveries",
headers={"Authorization": f"Bearer {os.environ['OCHIO_API_KEY']}"},
params={
"limit": 3
},
)
print(r.status_code, r.json())const res = await fetch(`${process.env.OCHIO_URL}/v1/webhooks/whk_1cee4f976d10/deliveries?limit=3`, {
headers: { Authorization: `Bearer ${process.env.OCHIO_API_KEY}` },
});
console.log(res.status, await res.json());{
"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
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.
{"queued": true, "event": {...}} with the test event.
curl -X POST "$OCHIO_URL/v1/webhooks/whk_1cee4f976d10/test" \
-H "Authorization: Bearer $OCHIO_API_KEY"import os
import requests
r = requests.post(
f"{os.environ['OCHIO_URL']}/v1/webhooks/whk_1cee4f976d10/test",
headers={"Authorization": f"Bearer {os.environ['OCHIO_API_KEY']}"},
)
print(r.status_code, r.json())const res = await fetch(`${process.env.OCHIO_URL}/v1/webhooks/whk_1cee4f976d10/test`, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.OCHIO_API_KEY}` },
});
console.log(res.status, await res.json());{
"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
Ends the subscription. Deliveries still waiting are dropped.
Path{"id", "deleted": true}.
| Status | Code | When |
|---|---|---|
404 | not_found | No webhook with this id that this key can see. |
curl -X DELETE "$OCHIO_URL/v1/webhooks/whk_1cee4f976d10" \
-H "Authorization: Bearer $OCHIO_API_KEY"import os
import requests
r = requests.delete(
f"{os.environ['OCHIO_URL']}/v1/webhooks/whk_1cee4f976d10",
headers={"Authorization": f"Bearer {os.environ['OCHIO_API_KEY']}"},
)
print(r.status_code, r.json())const res = await fetch(`${process.env.OCHIO_URL}/v1/webhooks/whk_1cee4f976d10`, {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.OCHIO_API_KEY}` },
});
console.log(res.status, await res.json());{
"id": "whk_1cee4f976d10",
"deleted": true
}