Skip to content

SendGrid

The SendGrid webhook receives batched email delivery events from SendGrid’s Event Webhook. These events track whether distribution emails were delivered, bounced, opened, clicked, or marked as spam.

POST /api/rpc/webhooks/sendgrid

SendGrid signs webhook requests using ECDSA with SHA256. The platform validates every request before processing.

HeaderDescription
X-Twilio-Email-Event-Webhook-SignatureECDSA signature (base64)
X-Twilio-Email-Event-Webhook-TimestampTimestamp used in signature

The signature must be valid and the timestamp must be within 5 minutes of the current time. Configure the verification key using the SENDGRID_WEBHOOK_VERIFICATION_KEY environment variable.

SendGrid EventPlatform EventDescription
deliveredemail_deliveredEmail delivered to recipient
bounceemail_bounceEmail bounced (hard or soft)
openemail_openRecipient opened the email
clickemail_clickRecipient clicked a link
spamreportemail_spam_reportRecipient reported as spam
unsubscribeemail_unsubscribeRecipient unsubscribed
droppedemail_bounceEmail dropped before sending
deferredSkipped (temporary delay)
processedSkipped (internal SendGrid event)
{
"success": true,
"processed": 5,
"duplicates": 0,
"errors": 0
}
  1. In your SendGrid dashboard, go to Settings > Mail Settings > Event Webhook.
  2. Set the HTTP POST URL to your platform’s SendGrid webhook endpoint.
  3. Select the events you want to receive.
  4. Enable Signed Event Webhook and copy the verification key.
  5. Set the SENDGRID_WEBHOOK_VERIFICATION_KEY environment variable to the verification key.