The webhook system is currently in beta. Contact support@gosendwhale.com to enable webhooks for your account.
Supported events
SendWhale sends webhook notifications for the following campaign delivery events:Set up a webhook endpoint
1
Expose a public HTTPS endpoint
Your webhook receiver must be a publicly accessible HTTPS URL. Create a route in your server that accepts
POST requests, reads the raw request body, and returns a 2xx status code promptly after receipt.Process payloads asynchronously (for example, by queuing them) rather than performing heavy work before responding. If your endpoint does not return 2xx quickly, SendWhale will treat the delivery as failed and retry.2
Register your endpoint in SendWhale
- Sign in to SendWhale and open your workspace Settings.
- Navigate to Integrations (or Developer Settings).
- Click Add Endpoint and enter your public HTTPS URL.
- Select the events you want to subscribe to.
- Click Save and copy the Webhook Secret — you will use it to verify incoming signatures.
3
Verify webhook signatures
Every webhook request from SendWhale includes a signature header that you should validate before processing the payload. This confirms the request genuinely came from SendWhale and was not tampered with in transit.Compute the expected signature by creating an HMAC-SHA256 digest of the raw request body using your webhook secret, then compare it to the value in the header using a constant-time comparison to prevent timing attacks.
- Python
- Node.js
4
Guard against replay attacks
Check the
timestamp field in the payload against your server’s current time. If the timestamp is older than your acceptable tolerance (for example, five minutes), reject the request. This prevents an attacker who captured a valid signed payload from replaying it later.Example payload
The following is a representative webhook payload for acampaign.delivered event.
event, timestamp, workspace_id, and campaign_id. Additional fields may be present depending on the event type.
Retries
If your endpoint returns a non-2xx HTTP status code, SendWhale retries delivery automatically. Design your handler to be idempotent — processing the same event twice should not cause unintended side effects. You can use the combination of event, campaign_id, and timestamp to deduplicate events on your side.
Next steps
- Return to the API Reference to explore other available endpoints.
- See Authentication for details on credential types and rotation.
- Contact support@gosendwhale.com to enable webhooks for your account or report an issue with webhook delivery.