Reference

Webhook events

Normalized EmailEvent and DeliveryEvent fields from provider webhook parsers.

Email parsers return EmailEvent[]. SMS and WhatsApp parsers return DeliveryEvent[]. Use toDeliveryEvent to put email events on the same ingest path as SMS / WhatsApp.

The one rule

Branch on event.type and keep provider-specific details in event.raw when you need them.

DeliveryEvent

FieldTypeMeaning
channel"email" | "sms" | "whatsapp" | "push"Messaging channel
providerstringParser id (e.g. "twilio-sms")
typeunion belowNormalized lifecycle type
messageIdstring?Provider message id when present
recipientstring?Address or phone when present
timestampDate?Event time when present
rawunknownOriginal provider payload

EmailEvent

FieldTypeMeaning
providerstringParser id (e.g. "sndr", "resend").
typeunion belowNormalized lifecycle type.
messageIdstring?Provider message id when present.
recipientstring?Primary recipient when present.
timestampDate?Event time when present.
rawunknownOriginal provider payload.

Normalized type values

ValueChannelsMeaning
queuedSMSAccepted / queued by the provider
sentSMS / WhatsAppHanded to the network
deliveredAllDelivered (or mailbox accepted for email)
failedSMS / WhatsAppPermanent failure
readSMS / WhatsAppRead receipt
bouncedEmailHard failure or bounce
complainedEmailSpam complaint
openedEmailOpen tracking
clickedEmailClick tracking
deferredEmailTemporary deferral
unknownAllUnmapped or informational event

Mapping helpers

import { toDeliveryEvent } from "sently/webhooks";

const delivery = toDeliveryEvent(emailEvent);

SNDR mapping

SNDR typeNormalized type
email.delivereddelivered
email.bouncedbounced
email.unsubscribedunknown

SNDR data.email_id becomes messageId. Recipients come from data.to or data.addresses.

Troubleshooting

Learn more

Next

On this page