Skip to content

Webhooks

Owners add webhooks under Developers → Webhooks: an https address and the events to send there. Everyone in the organization can see them and how their latest deliveries went.

Type Sent when
sandbox.state_changed a sandbox starts, sleeps, wakes, stops, fails or is deleted
scheduled_task.finished a scheduled task’s run ends, with its exit code
model_cap.reached someone reaches their monthly model allowance; once a month for each person
approval.requested, approval.decided an agent asks for approval, and when it’s decided or expires
budget.warning, budget.exceeded a team reaches 80% and 100% of its budget
alert.raised an alert: credits, a full disk, a stuck or moved sandbox, a security notice
webhook.test you press Send a test

Each delivery is a POST of one JSON event:

{
"id": "evt_5b0c3e…",
"type": "sandbox.state_changed",
"created_at": "2026-10-25T18:40:12Z",
"region": "global",
"organization": "org_…",
"data": {
"sandbox": { "id": "ws-…", "name": "Support bot" },
"state": "asleep",
"previous_state": "sleeping",
"error": ""
}
}

Answer with any 2xx status within 10 seconds. Anything else, or no answer, is retried after 10 seconds, 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 12 hours. The same event can occasionally arrive twice, so use its id to ignore repeats.

When you add a webhook you see its secret once (whsec_…). Every delivery carries a Stillbox-Signature header: t=<unix time>,v1=<signature>, where the signature is the HMAC-SHA256, in hex, of the time, a full stop and the raw body, keyed with the secret. Check it, and refuse deliveries more than five minutes old.

import { createHmac, timingSafeEqual } from "node:crypto";
export function verify(secret, header, rawBody) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false;
const expected = Buffer.from(createHmac("sha256", secret).update(`${parts.t}.${rawBody}`).digest("hex"));
const given = Buffer.from(parts.v1 ?? "");
return given.length === expected.length && timingSafeEqual(given, expected);
}
import hashlib, hmac, time
def verify(secret: str, header: str, raw_body: bytes) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
if abs(time.time() - int(parts["t"])) > 300:
return False
expected = hmac.new(secret.encode(), parts["t"].encode() + b"." + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts.get("v1", ""))

Webhooks send event data (sandbox names and states, people’s IDs) to the address you choose, which may be outside your region. Addresses must be public https host names; the platform never connects to private networks on a webhook’s behalf.