Webhooks & Events

Receive real-time notifications about message delivery status, template approvals, and platform events via HTTP callbacks.

What are Webhooks?

Webhooks are HTTP callbacks that Sent sends to your application when events occur. Instead of polling the API for updates, webhooks push events to your endpoint in real-time.

Webhook vs Polling

ApproachLatencyEfficiencyComplexity
WebhooksSecondsHigh (push)Medium
PollingMinutesLow (pull)Low

Choose Your Implementation

Webhook Event Types

EventDescriptionUse Case
messagesMessage status changes (sent, delivered, failed)Track delivery
templatesTemplate approval status changesMonitor approvals

Implementation Paths

Path A: Simple Webhook (5 minutes)

For basic message status tracking:

Configure endpoint - Set up your webhook URL

Verify signatures - Ensure webhook authenticity

Handle events - Process message status updates

Path B: Production Webhook (30 minutes)

For mission-critical applications:

Complete Path A

Implement idempotency - Handle duplicate events

Queue-based processing - Scale with queues

Local development - Test webhooks locally

Quick Example

// Express.js webhook handler
app.post('/webhooks/sent', async (req, res) => {
  // Acknowledge immediately — prevents retries on slow processing
  res.sendStatus(200);

  const { field, payload } = req.body;

  if (field === 'messages') {
    const { message_id, message_status } = payload;

    // Update your database
    await db.messages.update(message_id, {
      status: message_status
    });

    // Trigger business logic
    if (message_status === 'DELIVERED') {
      await sendDeliveryNotification(message_id);
    }
  }
});

Webhook Guides

New to webhooks? Start with Getting Started to set up your first webhook endpoint.


On this page