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.
Endpoint
Section titled “Endpoint”POST /api/rpc/webhooks/sendgrid
Signature validation
Section titled “Signature validation”SendGrid signs webhook requests using ECDSA with SHA256. The platform validates every request before processing.
| Header | Description |
|---|---|
X-Twilio-Email-Event-Webhook-Signature | ECDSA signature (base64) |
X-Twilio-Email-Event-Webhook-Timestamp | Timestamp 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.
Supported events
Section titled “Supported events”| SendGrid Event | Platform Event | Description |
|---|---|---|
delivered | email_delivered | Email delivered to recipient |
bounce | email_bounce | Email bounced (hard or soft) |
open | email_open | Recipient opened the email |
click | email_click | Recipient clicked a link |
spamreport | email_spam_report | Recipient reported as spam |
unsubscribe | email_unsubscribe | Recipient unsubscribed |
dropped | email_bounce | Email dropped before sending |
deferred | — | Skipped (temporary delay) |
processed | — | Skipped (internal SendGrid event) |
Response
Section titled “Response”{ "success": true, "processed": 5, "duplicates": 0, "errors": 0}- In your SendGrid dashboard, go to Settings > Mail Settings > Event Webhook.
- Set the HTTP POST URL to your platform’s SendGrid webhook endpoint.
- Select the events you want to receive.
- Enable Signed Event Webhook and copy the verification key.
- Set the
SENDGRID_WEBHOOK_VERIFICATION_KEYenvironment variable to the verification key.
Related pages
Section titled “Related pages”- Webhooks overview — how webhooks work
- AWS SES — alternative email provider integration