Outbound Webhooks Guide
Synapse can send real-time event notifications to your application via outbound webhooks. When an email is delivered, opened, clicked, or bounces, Synapse sends an HTTP POST to your configured endpoint with event details.
This guide covers outbound webhooks -- events Synapse sends to your server. For inbound webhooks that Synapse receives from external services (Resend, Lemon Squeezy), see Webhook Events.
How It Works
- You register a webhook endpoint URL with the event types you want to receive
- When a matching event occurs, Synapse sends an HTTPS POST with a JSON payload
- Your server verifies the HMAC-SHA256 signature and processes the event
- If delivery fails, Synapse retries with exponential backoff (10s, 30s, 120s)
Supported Event Types
| Event Type | Description |
|---|---|
email_sent | Email was submitted to the delivery provider |
email_delivered | Email was accepted by the recipient's mail server |
email_delivery_delayed | Delivery was temporarily delayed |
email_opened | Recipient opened the email (pixel tracking) |
email_clicked | Recipient clicked a link in the email |
email_bounced | Email bounced (hard or soft) |
email_spam_reported | Recipient marked the email as spam |
email_failed | Email delivery permanently failed |
email_suppressed | Email was suppressed (unsubscribed, NLT required modifier) |
Creating a Webhook Endpoint
curl
Response (201 Created)
The signing_secret is only shown once at creation time. Save it immediately in your application's environment variables. You will need it to verify webhook signatures.
URL Requirements
- Must use HTTPS (HTTP is rejected)
- Must not target private or internal networks (localhost, 10.x, 172.16.x, 192.168.x, metadata endpoints)
- Must respond within 10 seconds
Webhook Payload
Every webhook delivery is an HTTPS POST with a JSON body:
Signature Headers
Every delivery includes these headers for verification:
| Header | Description |
|---|---|
X-Synapse-Signature | HMAC-SHA256 signature of the request body |
X-Synapse-Timestamp | Unix timestamp when the webhook was sent |
X-Synapse-Event-Type | The event type (e.g., email_delivered) |
Verifying Signatures
Always verify the HMAC-SHA256 signature before processing a webhook. This prevents forgery attacks.
Python
JavaScript (Node.js)
Retry Policy
If your endpoint returns a non-2xx status code or times out, Synapse retries with exponential backoff:
| Attempt | Delay | Total elapsed |
|---|---|---|
| 1st retry | 10 seconds | 10s |
| 2nd retry | 30 seconds | 40s |
| 3rd retry | 120 seconds | 160s |
After 3 failed attempts, the delivery is marked as failed. If an endpoint accumulates 10 consecutive failures, it is automatically suspended and stops receiving deliveries.
Resuming a Suspended Endpoint
If an endpoint is suspended, fix the underlying issue (server error, DNS, firewall) and then re-activate it via the API or dashboard. Past failed deliveries are not replayed -- only new events are sent after reactivation.
Managing Endpoints
List Endpoints
Update an Endpoint
Delete an Endpoint
Rotate Signing Secret
The response includes the new signing_secret. Update your server immediately -- the old secret becomes invalid.
Test an Endpoint
Send a synthetic test event to verify your endpoint is working:
View Delivery History
Best Practices
- Always verify signatures -- never process unverified webhook payloads
- Respond quickly -- return 200 within 10 seconds, then process asynchronously
- Handle duplicates -- use
event_idfor idempotent processing - Monitor delivery history -- check for consecutive failures before they trigger suspension
- Use test mode -- create endpoints in the
testenvironment first to validate your handler - Store the signing secret securely -- treat it like an API key (environment variable, secret manager)