Skip to content

Twilio SMS

The Twilio SMS webhook receives delivery status callbacks for SMS messages sent through Twilio. These updates track whether messages were sent, delivered, or failed.

POST /api/rpc/webhooks/twilio/sms

Twilio signs webhook requests using HMAC-SHA1. The platform validates every request before processing.

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

The signature is computed over the full request URL with POST parameters sorted alphabetically and appended. Configure the auth token using the TWILIO_WEBHOOK_AUTH_TOKEN environment variable.

Twilio StatusPlatform EventDescription
sentsms_sentMessage sent to carrier
deliveredsms_deliveredMessage delivered to recipient
failedsms_failedMessage failed to send
undeliveredsms_undeliveredMessage could not be delivered
queuedSkipped (message queued)
sendingSkipped (message being sent)
receivingSkipped
receivedSkipped

The callback is sent as form-encoded data with these key fields:

FieldDescription
MessageSidTwilio’s unique message ID
MessageStatusCurrent delivery status
ToRecipient phone number
FromSender phone number
ErrorCodeTwilio error code (if failed)
ErrorMessageError description (if failed)
AccountSidYour Twilio account ID
NumSegmentsNumber of SMS segments
{
"success": true,
"processed": 1
}
  1. In your Twilio console, configure the Status Callback URL on your messaging service or phone number.
  2. Set the URL to your platform’s Twilio SMS webhook endpoint.
  3. Set the TWILIO_WEBHOOK_AUTH_TOKEN environment variable to your Twilio auth token.