Playground key
create a key →

API reference

Webhooks.

Register endpoint URLs and DroidHub POSTs signed JSON events to each as streams go live, end, and change controller. Every endpoint gets its own signing secret (whsec_…); each delivery carries X-DroidHub-Event and X-DroidHub-Signature (hex HMAC-SHA256 of the raw body).

Each event is sent once, with a 5 s timeout and no retries. Respond 2xx fast and do heavy work async. Redirects aren't followed, so register your endpoint's final URL. To catch anything missed, reconcile with GET /v1/streams/:id.

Endpoint requirements

Webhook URLs must be https and must resolve to a public address — loopback, link-local and private ranges are rejected at registration and at delivery.

Register an endpoint

Returns the endpoint with its whsec_… signing secret — shown exactly once, here. Store it to verify deliveries.

BodyTypeDescription
urlrequiredstring (https)Public https URL to deliver events to (max 2048 chars).
201 response
{
  "endpoint": {
    "id": "…",
    "url": "https://api.example.com/droidhub/webhook",
    "enabled": true,
    "createdAt": "…",
    "secret": "whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"   // shown once
  }
}
POST/v1/webhookswebhooks:manageTry it

List endpoints

Returns { endpoints: [{ id, url, enabled, createdAt }] }. Signing secrets are never included after creation.

GET/v1/webhookswebhooks:manageTry it

Delete an endpoint

Deliveries to it stop immediately. Returns { ok: true }, or 404 if unknown.

DELETE/v1/webhooks/:idwebhooks:manageTry it
destructive — changes real data

Event types

TypeFired whendata
stream.liveThe first camera connects and the stream goes live.{ streamId, name, livekitRoomName }
stream.hls_readyThe main camera's HLS recording started and its playlist URL is known. The playlist plays a few seconds later. Sent again with a new URL when that camera reconnects.{ streamId, hlsPlaybackUrl }
stream.endedThe room closes after every participant has left. A robot or viewer still connected keeps the stream live.{ streamId, hlsPlaybackUrl }
stream.estoppedAn e-stop latches. Control is revoked and only robots can send data.{ streamId, reason, by }
stream.estop_clearedThe e-stop is cleared. Nobody holds control until one is assigned.{ streamId }
controller.assignedA participant becomes the controller.{ streamId, identity, assignedBy }
controller.revokedControl ends: revoked by the API or the dashboard, the controller disconnected or timed out, or an e-stop latched.{ streamId, identity, reason }
camera.connectedA camera joins the stream under a name that wasn't connected.{ streamId, camera, identity }
camera.disconnectedThe last connection under a camera's name leaves, or the room closes.{ streamId, camera, identity }
camera.hls_readyA camera's HLS recording started and its playlist URL is known; it plays a few seconds later. Sent for every recorded camera, the main one included.{ streamId, camera, hlsPlaybackUrl }
webhook.testYou asked for a test delivery (POST /api/v2/org/webhooks/:id/test). Sent to that endpoint only, paused or not.{ endpointId }

Sample delivery

POST <your endpoint>
POST /droidhub/webhook
Content-Type: application/json
X-DroidHub-Event: controller.assigned
X-DroidHub-Signature: 3e1f0b2a8c…   (hex HMAC-SHA256 of the raw body)

{
  "id": "evt_V1StGXR8_Z5jdHi6B-myT",
  "type": "controller.assigned",
  "createdAt": "2026-06-12T09:30:00.000Z",
  "data": { "streamId": "…", "identity": "operator-jane", "assignedBy": "api" }
}

Verifying the signature

Compute HMAC-SHA256 over the raw request body (before any JSON parsing) with your endpoint secret and compare in constant time.

verify.ts (Node + Express)
import { createHmac, timingSafeEqual } from "node:crypto";

function verifySignature(rawBody, signatureHeader, secret) {
  const expected = createHmac("sha256", secret).update(rawBody).digest();
  const received = Buffer.from(signatureHeader ?? "", "hex");
  return (
    received.length === expected.length && timingSafeEqual(received, expected)
  );
}

// Mount with express.raw so req.body is the raw Buffer:
app.post("/droidhub/webhook", (req, res) => {
  const ok = verifySignature(
    req.body, // Buffer of the raw payload
    req.get("X-DroidHub-Signature"),
    process.env.DROIDHUB_WEBHOOK_SECRET, // whsec_…
  );
  if (!ok) return res.status(401).end();
  const event = JSON.parse(req.body);
  // handle event.type / event.data …
  res.status(204).end();
});