Webhooks
Real-time HTTP notifications for every email and SMS event in E-NVOY. Delivered with retries, attempt history, and HMAC-SHA256 signatures — verify before trusting the payload.
Quick start
- 1Create a webhookDashboard → Webhooks → Create. Give it a target URL and the events you want.
- 2Save the signing secretShown once after creation. Store it server-side — you need it to verify signatures.
- 3Verify the signatureFor every request, HMAC-SHA256 the raw body with your secret and compare with X-Webhook-Signature. Reject mismatches.
- 4Handle retries idempotentlyDeliveries may arrive more than once (up to 4 attempts). Use payload.id ("<id>:<event>:<ts>") or your own idempotency store.
Verify the signature (Node.js)
import crypto from 'crypto';
function verifyWebhookSignature(secret, rawBody, header) {
const expected =
'sha256=' +
crypto.createHmac('sha256', secret).update(rawBody, 'utf8').digest('hex');
return crypto.timingSafeEqual(
Buffer.from(expected),
Buffer.from(header || '')
);
}HMAC-SHA256 over the exact request body with your signing secret; compared against theX-Webhook-Signature header.
Events
| Event | Fires when |
|---|---|
| queued | Email accepted by provider and placed in queue |
| sent | Provider reported the message as sent |
| delivered | Delivery confirmed |
| bounced | Permanent or temporary bounce |
| failed | Delivery failed before leaving |
| opened | Tracked open (tracking pixel) |
| clicked | Click on a tracked link |
| complained | Recipient reported spam |
| unsubscribed | Recipient unsubscribed |
| sms.queued | SMS placed in queue |
| sms.sent | SMS dispatched via gateway |
| sms.failed | SMS failed to send |
| sms.delivered | SMS delivery confirmed by gateway |
Payload shape
POST <your-url>
Content-Type: application/json
X-Webhook-Signature: sha256=<hmac_sha256_hex>
X-Webhook-Event: delivered
X-Webhook-Id: <webhook-id>
{
"id": "<email-id>:delivered:1762506600000",
"event": "delivered",
"created_at": "2026-11-07T09:30:00.000Z",
"data": {
"email_id": "…", "api_key_id": "…",
"from": "hello@yourdomain.com",
"to": "user@example.com",
"subject": "…", "status": "delivered",
"details": "250 OK",
"timestamp": "2026-11-07T09:30:00.000Z"
}
}For SMS events the data shape is sms_id, api_key_id, to, from, body, parts, status, details, timestamp.
Delivery semantics & history
- Response
2xx→ recorded as delivered. - Any other status / timeout / network error → retried with backoff: 30s → 5m → 30m (4 attempts total), then logged as
deadand never retried. - Every attempt is logged — see Dashboard → Webhooks → View history for success rate, per-attempt outcomes, HTTP status codes and timestamps.
- Fire-and-forget from your perspective: webhooks never block or fail email/SMS sending.
- Unsubscribed hooks and deleted/paused hooks are skipped quietly — retries stop.
Dashboard → Webhooks → manage subscriptions & history.