Documentation / Webhooks

Webhooks

Configure an endpoint under Settings → Webhooks and BotForge will POST a signed JSON payload for each subscribed event.

Event catalogue

EventDescription
bot.publishedA new flow version was published
subscriber.createdA new subscriber joined a bot
subscriber.blockedA subscriber blocked the bot
broadcast.completedA broadcast finished sending
broadcast.failedA broadcast failed to send
message.inboundAn inbound message was received

Verifying signatures

Every request includes an X-BotForge-Signature header: an HMAC-SHA256 hex digest of the raw request body, keyed with your endpoint secret.

const expected = crypto
  .createHmac("sha256", endpointSecret)
  .update(rawBody)
  .digest("hex");

if (expected !== req.headers["x-botforge-signature"]) {
  return res.status(401).end();
}

Retries and backoff

Deliveries that don't receive a 2xx within 5 seconds are retried with exponential backoff: 1m, 5m, 30m, 2h, then 12h, for up to 24 hours. After the final attempt fails, the endpoint is flagged and you'll be notified by email. Endpoints with a >50% failure rate over 1 hour are temporarily disabled.

Payload example

{
  "id": "evt_3n7f",
  "type": "broadcast.completed",
  "createdAt": "2024-05-02T14:03:11Z",
  "data": {
    "broadcastId": "bcast_7f1",
    "botId": "bot_9k2",
    "stats": { "total": 4210, "delivered": 4180, "blocked": 19, "failed": 11 }
  }
}