Skip to content

Twilio WhatsApp

The Twilio WhatsApp webhook receives delivery status callbacks for WhatsApp messages sent through Twilio’s WhatsApp Business API. These updates track whether messages were sent, delivered, read, or failed.

POST /api/rpc/webhooks/twilio/whatsapp

Twilio signs webhook requests using HMAC-SHA1, the same method used for SMS callbacks.

HeaderDescription
X-Twilio-SignatureHMAC-SHA1 signature (base64)

Configure the auth token using the TWILIO_WEBHOOK_AUTH_TOKEN environment variable.

Twilio StatusPlatform EventDescription
sentwhatsapp_sentMessage sent to WhatsApp
deliveredwhatsapp_deliveredMessage delivered to recipient
readwhatsapp_readRecipient read the message
failedwhatsapp_failedMessage failed to send
undeliveredwhatsapp_failedMessage could not be delivered
queuedSkipped (message queued)
sendingSkipped (message being sent)

The callback is sent as form-encoded data. Phone numbers include the whatsapp: prefix, which the platform strips automatically.

FieldDescription
MessageSidTwilio’s unique message ID
MessageStatusCurrent delivery status
ToRecipient (with whatsapp: prefix)
FromSender (with whatsapp: prefix)
ErrorCodeTwilio error code (if failed)
ErrorMessageError description (if failed)
AccountSidYour Twilio account ID
ChannelPrefixwhatsapp
{
"success": true,
"processed": 1
}
  1. In your Twilio console, configure the Status Callback URL on your WhatsApp sender.
  2. Set the URL to your platform’s Twilio WhatsApp webhook endpoint.
  3. Set the TWILIO_WEBHOOK_AUTH_TOKEN environment variable to your Twilio auth token.