Skip to content
PreviewNot live yet. APIs and SDKs on these pages may change before launch.

Webhooks

Scope: webhooks:manage. See Webhooks for events and signatures.

{
"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.

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'],
})

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.

GET /api/v1/webhooks returns { "subscriptions": [webhook, …] }.

GET /api/v1/webhooks/{subscriptionId}

PUT /api/v1/webhooks/{subscriptionId} with any of url, eventTypes and status (active or paused).

DELETE /api/v1/webhooks/{subscriptionId} returns 204.

POST /api/v1/webhooks/{subscriptionId}/rotate-secret returns the new secret. Both secrets sign requests for 72 hours.

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).

POST /api/v1/webhooks/{subscriptionId}/deliveries/{deliveryId}/retry sends a dead_lettered delivery again. Any other status returns 409 delivery_not_dead_lettered.