Skip to Content
Sendable Docs

Webhooks Dashboard

Configure and manage webhooks for real-time event notifications.

What Are Webhooks?

Webhooks are HTTP callbacks Sendable pushes to your application when subscribed events happen, such as:

  • outgoing message status changes
  • incoming messages
  • session socket connect or disconnect events
  • WhatsApp account events: edits, reactions, deletes, group changes and join requests, calls, labels, channels, contacts, account settings, and history sync

This is the recommended way to react to delivery state and inbound traffic without polling.

Setting Up Webhooks

Step 1: Create an Endpoint

Your application needs a public HTTPS endpoint that accepts POST requests and preserves the raw body for signature verification.

import express from 'express'
import { Sendable } from '@sendable-dev/sdk'

const sendable = new Sendable({
  apiKey: process.env.SENDABLE_API_KEY!,
  apiKeyScope: 'session',
  webhookSecret: process.env.SENDABLE_WEBHOOK_SECRET,
})

app.post('/webhook', express.raw({ type: 'application/json' }), async (req, res) => {
  const payload = req.body.toString()

  try {
    const event = await sendable.webhooks.verifyAndParse(payload, req.headers)
    handleEvent(event).catch(console.error)
    return res.sendStatus(200)
  } catch {
    return res.status(401).send('Invalid signature')
  }
})

Step 2: Add the Webhook in Dashboard

  1. Go to your session
  2. Open the Webhooks tab
  3. Click Add Webhook
  4. Enter your URL
  5. Choose subscribed event types
  6. Save

Step 3: Save the Secret

Every endpoint has a signing secret in the form whsec_.... Store it in SENDABLE_WEBHOOK_SECRET and never expose it to the browser.

Event Types

Message Events

EventWhen It FiresUse Case
message.sentWhatsApp accepted an API sendTrack outbound traffic
message.deliveredMessage deliveredConfirm delivery
message.readRecipient read messageTrack engagement
message.failedAPI send failedRetry or alert
message.receivedDirect incoming messageStore or respond
message-personal.receivedPersonal chat messagePersonal inbox flows
message-group.receivedGroup or community messageGroup automations

Session Events

EventWhen It FiresUse Case
session.socket-connectedSession goes onlineResume sending
session.socket-disconnectedSession goes offlineAlert team, pause sending

Normalized Events

EventWhen It FiresUse Case
message.deleted / message.edited / message.reactionMessage revoked, edited, or reacted toKeep a mirror in sync
status.received / status.postedContact posted a status (opt-in) / you posted oneStatus feeds
chat.upsert / chat.updated / chat.deleted / chat.lockedChat app-state changedInbox sync
group.upserted / group.updated / group.participants.updatedGroup joined, changed, or membership changedGroup automations
group.join-request / group.member-tag.updatedJoin request or member tag changeApprove members, moderation
contact.upserted / contact.updatedContacts synced or changedCRM sync
label.edited / label.association.updatedBusiness labels changedCRM pipelines
call.updatedIncoming call statusAuto-reject, call logs
newsletter.*Channel reactions, views, admins, settingsChannel analytics
settings.updated / message-capping.updated / blocklist.*Account settings, caps, blocklistCompliance and limits
history.synced / history.statusHistory sync progressKnow when backfill is done

See Webhook Events for payloads. Each one can also be replayed from GET /v1/events.

Security

Signature Verification

Sendable uses Standard Webhooks signatures. Requests include:

  • webhook-id
  • webhook-timestamp
  • webhook-signature

The SDK also accepts the older svix-* header names.

You should verify against the raw request body before parsing JSON:

const payload = req.body.toString()
const event = await sendable.webhooks.verifyAndParse(payload, req.headers)

Best Practices

Respond Quickly

Return HTTP 200 after verification and push real work into background jobs when possible.

Handle Duplicates

Webhook delivery is at-least-once, so build idempotency around the envelope:

async function handleEvent(event) {
  const key = `${event.type}-${event.data.id ?? event.data.sessionId}-${event.createdAt}`

  if (await wasProcessed(key)) {
    return
  }

  await processEvent(event)
}

Log Failures

async function processEvent(event) {
  if (event.type === 'message.failed') {
    console.error('message failed', event.data.id, event.data.status)
  }
}

Use Cases

Delivery Tracking

if (event.type === 'message.delivered') {
  await updateOrderStatus(event.data.id, 'delivered')
}

Incoming Chat Automation

if (event.type === 'message.received') {
  await saveMessage(event.data)
  await maybeAutoReply(event.data.chatId, event.data.text?.content)
}

Session Monitoring

if (event.type === 'session.socket-disconnected') {
  await notifyOps(`Session ${event.data.sessionId} disconnected`)
}

Troubleshooting

Invalid Signature

  • Use the raw body, not JSON.stringify(req.body)
  • Verify the whsec_... secret matches the endpoint in the dashboard
  • Make sure body parsing middleware is not running before verification

Missing Events

  • Confirm the webhook is active
  • Confirm the event type is subscribed
  • Check delivery logs in the dashboard

On this page