Back to documentation

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

  1. 1Create a webhookDashboard → Webhooks → Create. Give it a target URL and the events you want.
  2. 2Save the signing secretShown once after creation. Store it server-side — you need it to verify signatures.
  3. 3Verify the signatureFor every request, HMAC-SHA256 the raw body with your secret and compare with X-Webhook-Signature. Reject mismatches.
  4. 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

EventFires when
queuedEmail accepted by provider and placed in queue
sentProvider reported the message as sent
deliveredDelivery confirmed
bouncedPermanent or temporary bounce
failedDelivery failed before leaving
openedTracked open (tracking pixel)
clickedClick on a tracked link
complainedRecipient reported spam
unsubscribedRecipient unsubscribed
sms.queuedSMS placed in queue
sms.sentSMS dispatched via gateway
sms.failedSMS failed to send
sms.deliveredSMS 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 dead and 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.