Webhooks

WildDuck includes a webhook system for real-time event notifications. When events occur (new messages, authentication attempts, account changes, etc.), WildDuck sends HTTP POST requests to registered webhook URLs.
How It Works
The webhook system is built on BullMQ (Redis-based job queue):
- An event occurs in WildDuck (e.g., a new message arrives)
- The event is published to the webhook queue in Redis
- The webhook worker picks up the event and delivers it to all matching webhook subscriptions
- Failed deliveries are retried with exponential backoff
At least one WildDuck instance must have webhooks.enabled = true in its configuration, otherwise events will pile up in the Redis queue.
Webhook Events
Events use a hierarchical naming system. You can subscribe to specific events or use wildcards to match event categories.
Common event types include user-related events, message events, mailbox events, authentication events, and more. Events are prefixed by their category (e.g., events related to a specific resource type).
Managing Webhooks
Webhooks are managed via the HTTP API:
GET /webhooks— List all webhook subscriptionsPOST /webhooks— Register a new webhookGET /webhooks/:webhook— Get webhook detailsPUT /webhooks/:webhook— Update a webhookDELETE /webhooks/:webhook— Delete a webhook
Creating a Webhook
When creating a webhook, specify:
- url — The HTTP endpoint that will receive POST requests
- type — Event type filter (supports prefix matching with wildcards)
- user (optional) — Limit the webhook to events for a specific user
Webhook Payload
Events are delivered as JSON POST requests. The payload includes:
- Event type identifier
- Timestamp
- Related resource IDs (user, mailbox, message, etc.)
- Event-specific data
Global vs User Webhooks
- Global webhooks — Receive events for all users (created without a
userparameter) - User-specific webhooks — Only receive events for a specific user
Delivery and Retry
Webhook deliveries use HTTP POST. If the endpoint returns a non-2xx status code or the request times out, the delivery is retried with exponential backoff.