Skip to main content
A webhook is an HTTPS URL registered for your organization. When a session changes status, the platform sends a signed POST to every subscribed webhook, so you can react without polling. Each webhook has a url, a list of enabled_events, and a signing secret returned once at creation.

Events

  • "*" subscribes to the session.status_updated firehose.
  • Each subscribed type is delivered separately: with both session.status_updated and session.failed, a failure sends two deliveries.
  • List the types programmatically with List event types.

Delivery payload

All event types share this shape:
Delivery payload
created_at is when the status changed (UTC, RFC 3339, milliseconds). status is any session state. previous_status is null when unknown.

Verifying deliveries

Always verify before trusting a delivery. The SDK helper checks the signature, rejects deliveries older than 5 minutes (tune with tolerance_s / toleranceS), and parses the event. On failure it raises WebhookVerificationError. Respond with 400.
Without an SDK: compute HMAC-SHA256(secret, "{timestamp}." + raw_body), hex-encode it, prefix sha256=, compare it to X-H-Webhook-Signature in constant time, and reject timestamps more than a few minutes old.

Delivery semantics

Deliveries are at-least-once, with a 10-second timeout per attempt. An unreachable endpoint or a non-2xx response is retried with increasing backoff, up to 8 attempts over about 24 hours, then the event is dropped. So:
  • Deduplicate. The event id and X-H-Webhook-Delivery are stable across retries.
  • Ignore arrival order. A retried old event can land after a newer one. Trust status, previous_status, and created_at.
  • Return 2xx fast. Do slow work after responding.
  • Treat it as a trigger. Fetch the authoritative state with Get session status.
Retrieve reports each webhook’s latest delivery (last_delivery_status, last_delivery_error, last_delivery_at, last_success_at, consecutive_failures), so you can check its health without reading receiver logs.

Testing an endpoint

Ping sends a signed ping event through the real delivery path and returns your endpoint’s response synchronously. Use it to check the URL, signature verification, and connectivity.

Rotating the secret

Rotate returns a new secret, and deliveries are signed with it from then on. The verify helpers accept a list of secrets for the switch:
  1. Pass ["whsec_old", "whsec_new"] to the verify helper as soon as you have the new secret. Deliveries rejected in between are retried.
  2. Once deliveries verify against the new secret, remove the old one.

Constraints

  • Target URLs must be https:// and resolve to a public address. A HEAD request checks reachability when you register or change the URL. Deliveries to private or internal hosts fail and count as failed attempts.
  • The secret is returned only by Create and Rotate.
  • Up to 10 webhooks per organization.
  • A disabled webhook stays registered but receives nothing.
  • After 50 consecutive failed attempts, a webhook is disabled. Fix the receiver, then re-enable it with Update ({"disabled": false}).
Related: Schedules, Watch and steer sessions