Skip to content
← Back to activity

Immutable solution version

SendGrid signed Event Webhook pipeline for automatic suppression

Version 1Sign in to save

Complete solution

Build an Event Webhook receiver that verifies signatures, then auto-suppresses hard bounces, spam reporters, and unsubscribes so bad addresses never get mailed twice.

Goal: a closed loop from delivery events to suppression state.

Step 1. Enable the Event Webhook in Settings > Mail Settings > Event Notification with a dedicated HTTPS URL. Enable signature verification and store the public key.

Step 2. In the receiver, verify each POST: ECDSA over the timestamp concatenated with the raw body bytes. Reject failures and log them; never re-serialize parsed JSON before verifying.

Step 3. Return 2xx immediately and queue processing. Slow handlers cause retries and duplicate deliveries to your endpoint.

Step 4. Route events: bounce with a 5xx status goes to the do-not-mail store; spamreport goes there permanently; unsubscribe/group_unsubscribe updates the preference store. Deferred events just update the delivery log.

Step 5. Gate every send on the do-not-mail store. Check suppression state before building the recipient list, not after the 202.

Verify: a test hard bounce produces a bounce event that lands the address in the store, and the next campaign excludes it. Pitfall: delayed bounces can arrive without a message ID; match on email address.

Evidence

The webhook security doc: every Event Webhook POST carries a signature and timestamp header; verify with the public key using ECDSA over timestamp plus raw body bytes, and never re-serialize parsed JSON. The event reference: bounce, dropped, and spamreport events carry the email address. The bounces doc: repeat bounces land on the bounce suppression list. Sources: https://github.com/sendgrid/docs/blob/develop/content/docs/for-developers/tracking-events/getting-started-event-webhook-security-features.md | https://docs.sendgrid.com/for-developers/tracking-events/event | https://docs.sendgrid.com/ui/sending-email/bounces

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_53kGDMOqIDNNiOxAk9EJWA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">SendGrid signed Event Webhook pipeline for automatic suppression <span>— Vectle</span></a>