Create a new webhook endpoint to receive real-time email event notifications.
Signature verification: Every webhook created through this API receives an opaque signing secret in the create response. MailerLogic computes a lowercase hexadecimal HMAC-SHA256 over the exact UTF-8 request body bytes and sends it in X-Webhook-Signature. Do not parse and re-serialize the JSON before verification. Capture the raw request body, compute the HMAC with the saved secret, and compare the two values using a constant-time comparison.
Delivery requests also include:
X-Webhook-ID: webhook endpoint UUIDX-MailerLogic-Event-ID: stable event UUID for idempotent processingX-Webhook-Timestamp: event timestamp copied from the JSON payloadX-Event-Type: event name such asemail.delivered
Webhook delivery is at least once. Deduplicate retries using the JSON event_id or matching X-MailerLogic-Event-ID value.
Webhook Scopes:
- Customer-Level (domain_ids = null/empty): Receives events from ALL domains
- Single Domain (domain_ids = [uuid]): Receives events from ONE domain
- Domain Group (domain_ids = [uuid1, uuid2, ...]): Receives events from MULTIPLE domains
Use Case - Plan Limits: If your plan has 20 domains but only 5 webhook endpoints, group domains:
- Webhook 1: [marketing-domain, campaigns-domain, newsletters-domain] → marketing app
- Webhook 2: [support-domain, tickets-domain] → support app
- Webhook 3: [] (all remaining domains) → main backend
Event Types:
email.sent- Email accepted for deliveryemail.delivered- Successfully delivered to recipientemail.opened- Recipient opened the emailemail.clicked- Recipient clicked a linkemail.bounced- Email bouncedemail.complained- Spam complaint receivedemail.unsubscribed- Recipient unsubscribedemail.failed- Delivery failed
Examples:
Customer-level webhook (all domains):
{
"url": "https://api.example.com/webhook",
"events": ["email.delivered", "email.bounced"],
"domain_ids": null
}Domain group webhook (multiple domains):
{
"url": "https://marketing.example.com/webhook",
"events": ["email.opened", "email.clicked"],
"domain_ids": [
"550e8400-e29b-41d4-a716-446655440001",
"550e8400-e29b-41d4-a716-446655440002",
"550e8400-e29b-41d4-a716-446655440003"
]
}Single domain webhook (backward compatible):
{
"url": "https://support.example.com/webhook",
"events": ["email.delivered"],
"domain_ids": ["550e8400-e29b-41d4-a716-446655440000"]
}HTTPS URL for webhook delivery
Optional notes about this webhook
Optional array of domain UUIDs to scope webhook to specific domains.
- If null or empty array: webhook receives events from ALL domains (customer-level)
- If array with 1 UUID: webhook receives events from ONE domain
- If array with multiple UUIDs: webhook receives events from those specific domains (domain group)
Use Case: If your plan has 20 domains but only 5 webhook endpoints, group related domains together.
[ "550e8400-e29b-41d4-a716-446655440001", "550e8400-e29b-41d4-a716-446655440002" ]
Event types to receive
[ "email.delivered", "email.opened", "email.clicked", "email.bounced" ]
- US Data Centerhttps://api.mailerlogic.net/api/v1/customer/webhooks
- EU Data Center (coming soon)https://eu-api.mailerlogic.net/api/v1/customer/webhooks
curl -i -X POST \
https://api.mailerlogic.net/api/v1/customer/webhooks \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY_HERE' \
-d '{
"name": "Production Webhook",
"url": "https://api.example.com/webhooks/email-events",
"description": "Main production webhook for email events",
"domain_ids": [
"550e8400-e29b-41d4-a716-446655440001",
"550e8400-e29b-41d4-a716-446655440002"
],
"domain_id": "550e8400-e29b-41d4-a716-446655440000",
"events": [
"email.delivered",
"email.opened",
"email.clicked",
"email.bounced"
],
"is_active": true
}'Webhook created successfully.
⚠️ IMPORTANT: The response includes a secret field inside the webhook object. This is the ONLY time you'll see it - save it immediately!
Webhook endpoint response that includes the signing secret. IMPORTANT: The secret is only returned when creating or regenerating. Save it securely - you won't see it again!
Webhook endpoint response that includes the signing secret. IMPORTANT: The secret is only returned when creating or regenerating. Save it securely - you won't see it again!
{ "webhook": { "id": "550e8400-e29b-41d4-a716-446655440010", "customer_id": "550e8400-e29b-41d4-a716-446655440000", "name": "Production Webhook", "url": "https://api.example.com/webhooks/email-events", "description": "Main production webhook", "domain_ids": [ … ], "domains": [ … ], "events": [ … ], "is_active": true, "secret": "8f2b5d8c8f4544e4b11682a4d7e0f681ab12cd34ef56ab78cd90ef12ab34cd56", "signing_secret": "8f2b5d8c8f4544e4b11682a4d7e0f681ab12cd34ef56ab78cd90ef12ab34cd56", "last_triggered_at": null, "last_status": null, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" }, "message": "Webhook created successfully" }