Webhooks
Scope: webhooks:manage. See Webhooks for events and signatures.
The webhook object
Section titled “The webhook object”{ "subscriptionId": "dwh_5n2p", "url": "https://pidgefit.com/webhooks/mailpidge", "eventTypes": ["email.bounced", "email.complained"], "status": "active", "secretHint": "9fQx", "lastDeliveryAt": "2026-11-25T09:14:04.020Z", "failedDeliveryCount": 0, "createdAt": "2026-11-25T09:00:00.000Z", "updatedAt": "2026-11-25T09:00:00.000Z"}status is active, paused or disabled. secretHint is the secret’s last 4 characters, to tell endpoints apart.
Create a webhook
Section titled “Create a webhook”POST /api/v1/webhooks
| Field | Type | Notes |
|---|---|---|
url |
string | Required. HTTPS, public address |
eventTypes |
string[] | Required. At least one event |
const webhook = await mailpidge.webhooks.create({ url: 'https://pidgefit.com/webhooks/mailpidge', eventTypes: ['email.bounced', 'email.complained'],})webhook = mailpidge.webhooks.create( url="https://pidgefit.com/webhooks/mailpidge", event_types=["email.bounced", "email.complained"],)curl https://api.mailpidge.com/api/v1/webhooks \ -H "Authorization: Bearer $MAILPIDGE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://pidgefit.com/webhooks/mailpidge", "eventTypes": ["email.bounced", "email.complained"] }'Response 201: { "subscription": {…}, "secret": "whsec_…" }. The secret is returned only here; store it.
A workspace can have 10 webhooks; the 11th returns subscription_limit_reached.
List webhooks
Section titled “List webhooks”GET /api/v1/webhooks returns { "subscriptions": [webhook, …] }.
Get a webhook
Section titled “Get a webhook”GET /api/v1/webhooks/{subscriptionId}
Update a webhook
Section titled “Update a webhook”PUT /api/v1/webhooks/{subscriptionId} with any of url, eventTypes and status (active or paused).
Delete a webhook
Section titled “Delete a webhook”DELETE /api/v1/webhooks/{subscriptionId} returns 204.
Rotate a secret
Section titled “Rotate a secret”POST /api/v1/webhooks/{subscriptionId}/rotate-secret returns the new secret. Both secrets sign requests for 72 hours.
List deliveries
Section titled “List deliveries”GET /api/v1/webhooks/{subscriptionId}/deliveries?limit=50&cursor={nextCursor}
limit is 1 to 100 (default 50).
{ "deliveries": [ { "deliveryId": "dwd_9r1x", "subscriptionId": "dwh_5n2p", "eventType": "email.bounced", "eventId": "evt_6f1c2b0e9a7d4c3b", "attemptCount": 10, "lastStatusCode": 500, "lastError": "HTTP 500", "lastAttemptAt": "2026-11-26T02:20:41.000Z", "status": "dead_lettered", "deliveredAt": null, "createdAt": "2026-11-25T09:14:04.020Z" } ], "nextCursor": null}status is pending, delivered or dead_lettered (gave up after the last retry).
Retry a delivery
Section titled “Retry a delivery”POST /api/v1/webhooks/{subscriptionId}/deliveries/{deliveryId}/retry sends a dead_lettered delivery again. Any other status returns 409 delivery_not_dead_lettered.