Documentation / Webhooks

Webhooks

Configure an endpoint under Settings → Webhooks and Meshwire 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-Meshwire-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 }
  }
}

Go deeper

Delivery, retries and read-only diagnostics

Outbound webhooks POST a signed JSON payload to the endpoint you configure; inbound webhooks trigger flows on external events, with each trigger listening for its own event name so one endpoint can drive several flows.\nDiagnostics that touch Telegram itself — the shipped smoke and diagnose scripts — are strictly read-only: they never register webhooks or send commands, because a diagnostic tool that can mutate production state is an incident waiting to happen. Registration happens only inside the guarded application flows.\nIf your install sits behind a proxy or WAF, a challenge page can intercept a webhook call; the system detects that shape and tells you to hard-refresh rather than silently retrying into the same wall.