Webhooks
Real-time event notifications
Get instant notifications when events happen. Webhooks push data to your app in real-time.
// Webhook payload example
{
"event": "email.opened",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"email_id": "msg_abc123",
"subscriber_id": "sub_xyz789",
"campaign_id": "camp_456",
"user_agent": "Mozilla/5.0...",
"ip_address": "192.168.1.1"
}
}How Webhooks Work
1
Configure Endpoint
Add your webhook URL in the dashboard
2
Select Events
Choose which events to subscribe to
3
Receive Data
Get real-time POST requests when events occur
Available Events
Subscribe to the events that matter to your application
email.sentEmail was successfully sent
email.deliveredEmail was delivered to recipient
email.openedRecipient opened the email
email.clickedRecipient clicked a link
email.bouncedEmail bounced (hard or soft)
subscriber.createdNew subscriber was added
subscriber.updatedSubscriber data was updated
subscriber.unsubscribedSubscriber unsubscribed
Webhook Security
Every webhook is signed so you can verify it came from sendifai.
- HMAC-SHA256 request signatures
- Timestamp validation to prevent replay attacks
- TLS 1.3 encryption in transit
- IP allowlist support
# Verify webhook signature
const crypto = require('crypto');
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}