Webhooks

Receive real-time notifications when message events occur.

Webhook Events

Message Events

Verification Events

Webhook Payload

{
  "event": "message.delivered",
  "data": {
    "id": "msg_abc123",
    "to": "+15551234567",
    "from": "+18885551234",
    "text": "Hello!",
    "status": "delivered",
    "deliveredAt": "2026-01-22T12:01:30.000Z"
  },
  "timestamp": "2026-01-22T12:01:30.000Z",
  "apiVersion": "v1"
}

Security

Verify webhook signatures using HMAC-SHA256:

const crypto = require('crypto');

function verifyWebhook(payload, signature, secret) {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

Retry Policy

Failed webhooks are retried with exponential backoff: