Webhooks
Receive signed notifications when experiments complete or roll back and when recommendations are created.
Add webhook endpoints per project (admin role). Each has a secret (min. 16 characters) stored encrypted. Private and loopback addresses are rejected.
Events
experiment.completed—{ experiment_id, winner, reason }experiment.rolled_back—{ experiment_id, reason }recommendation.created—{ id, title }
Payload and signature
POST https://your-server/hooks
X-Event: experiment.completed
X-Delivery-Id: 3f9c… (stable across retries — use it to de-duplicate)
X-Timestamp: 1795158000 (Unix seconds when this attempt was signed)
X-Signature: <hex HMAC-SHA256 of "<X-Timestamp>.<raw body>" using your webhook secret>
{ "event": "experiment.completed", "project_id": "…", "created_at": "2026-11-20T10:00:00Z", "data": { … } }import crypto from "node:crypto";
const ts = req.headers["x-timestamp"];
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) throw new Error("stale webhook"); // replay protection
const expected = crypto.createHmac("sha256", process.env.WEBHOOK_SECRET).update(`${ts}.`).update(rawBody).digest("hex");
const ok = crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(req.headers["x-signature"]));Delivery and retries
Respond with any 2xx within 5 seconds. Non-2xx responses, timeouts and connection errors are retried with exponential backoff: after 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours — six attempts in total — after which the delivery is marked dead. Redirects are not followed, and the destination is re-checked against private and loopback addresses before every attempt.
Deliveries can arrive more than once and out of order; de-duplicate on X-Delivery-Id. Admins can list deliveries (GET /v1/projects/{id}/webhooks/deliveries) and resend one, including dead ones (POST …/deliveries/{delivery_id}/redeliver).