Sendexa LogoDocs

Email Webhooks

Receive real-time HTTP callbacks for email delivery and engagement events.

Real-time Updates

Get notified instantly when an email is delivered, opened, or bounced.

Secure Verification

Verify payload authenticity using HMAC signatures.

Webhook Payload Structure

When an event occurs, Sendexa will make a POST request to your configured Webhook URL with a JSON payload.

Example Payload

JSON
{
"event": "email.delivered",
"timestamp": "2024-01-15T10:30:02Z",
"data": {
"messageId": "eml_xyz123abc",
"status": "delivered",
"deliveryTime": "2.1s"
}
}

Available Events

  • email.delivered: The email was successfully delivered.
  • email.bounced: The email hard-bounced.
  • email.deferred: The email delivery is delayed.
  • email.opened: The recipient opened the email.
  • email.clicked: The recipient clicked a link in the email.
  • email.spam: The recipient marked the email as spam.

Verifying Webhooks

To verify that a webhook was actually sent by Sendexa, check the X-Sendexa-Signature header. This signature is generated using your Webhook Secret (found in your dashboard).

JavaScript
const crypto = require('crypto');
function verifyWebhook(payload, signature, secret) {
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(JSON.stringify(payload))
.digest('hex');
return signature === expectedSignature;
}