A webhook sends an HTTP POST to your server when something happens to mail you sent, such as a bounce or a complaint. Use it to keep your own database in step: mark bad addresses, record unsubscribes, or log engagement. The full endpoint reference is in the API reference.
Event types
| Event | Sent when |
|---|---|
email.delivered |
The receiving mail server accepted the message. That is delivery to the server, not to the inbox; its own spam filtering happens afterwards |
email.bounced |
The message was refused, permanently or for now. bounce.type says which |
email.complained |
The recipient reported the message as spam, through their provider's feedback loop |
email.opened |
The first open of a campaign or automation message, or of API mail sent with track_opens |
email.clicked |
A tracked link was followed. Every click is sent |
email.unsubscribed |
The recipient unsubscribed. method says how |
Opens and clicks exist for campaign and automation mail, and for API mail sent with track_opens or track_clicks. Other API mail and SMTP relay mail produce the remaining four events only. See Analytics and tracking.
Open and click events carry machine and proxy: whether a person did it, and if not, which scanner or image proxy did. Click events are sent about 15 seconds late, so that a scanner following every link can be recognised before we tell you who clicked.
Add an endpoint
Only the account owner or an admin can manage webhooks.
- In the sidebar, click Webhooks, then Add endpoint.
- Enter the Endpoint URL, for example
https://example.com/webhooks/pigeonify. - Optionally add a Description (optional), such as "Production".
- Under Send these events, tick the events you want. Delivered, bounced, complained and unsubscribed are ticked for you. Opens and clicks are left off because they are the noisiest.
- Click Add endpoint.
- Copy the signing secret from the dialog and store it on your server. It is not shown again.
An account can have up to 10 endpoints.
URL rules
- It must use
https. - It must be reachable from the internet.
localhost, names ending in.local,.localhostor.internal, and private or reserved IP addresses are refused. - It must not contain a username, password or
#fragment, and must be under 2,048 characters.
The address a name resolves to is checked again every time we connect, so a name that later points at a private address is refused at delivery.
What we send
Each request is a POST with a JSON body and these headers:
| Header | Contains |
|---|---|
Pigeonify-Signature |
t=<unix seconds>,v1=<signature> |
Pigeonify-Event-Id |
The event id, the same as id in the body |
Pigeonify-Event-Type |
The event type, such as email.bounced |
The body looks like this:
{
"id": "evt_3c9a…",
"type": "email.clicked",
"created_at": "2026-11-10T09:00:15.000Z",
"data": {
"email_id": "a41d…",
"to": "ada@example.com",
"subject": "Your trial ends Friday",
"url": "https://yourdomain.com/upgrade",
"machine": false,
"proxy": null
}
}
The example is shortened. Every email event's data also carries message_id, from, contact_id, campaign_id and automation_id. email_id is the id /v1/send returns, so you can match an event to the send.
Verify the signature
Every request is signed with your endpoint's secret. Check it before trusting the body. The signature is an HMAC-SHA256, in hex, of the timestamp, a full stop, and the raw request body.
import crypto from "node:crypto"
// rawBody must be the body exactly as received, not a re-serialised object.
function verifySignature(secret, header, rawBody, now = Math.floor(Date.now() / 1000)) {
const parts = Object.fromEntries(
header.split(",").map((part) => {
const at = part.indexOf("=")
return [part.slice(0, at).trim(), part.slice(at + 1).trim()]
}),
)
const timestamp = Number(parts.t)
if (!Number.isFinite(timestamp) || !parts.v1) return false
// Reject anything signed more than five minutes ago, so a captured request cannot be replayed.
if (Math.abs(now - timestamp) > 300) return false
const expected = crypto.createHmac("sha256", secret).update(`${timestamp}.${rawBody}`).digest()
const given = Buffer.from(parts.v1, "hex")
return expected.length === given.length && crypto.timingSafeEqual(expected, given)
}
With Express, read the raw body for this route:
app.post("/webhooks/pigeonify", express.raw({ type: "application/json" }), (req, res) => {
const body = req.body.toString("utf8")
if (!verifySignature(process.env.PIGEONIFY_WEBHOOK_SECRET, req.get("Pigeonify-Signature") ?? "", body)) {
return res.status(400).end()
}
const event = JSON.parse(body)
// Deduplicate on event.id, then handle the event.
res.status(200).end()
})
Respond quickly
Answer with any 2xx status within 10 seconds. Anything else counts as a failure, including a redirect: we do not follow redirects, so use the final URL. If you have slow work to do, store the event and process it after you respond.
Delivery is at least once. A request that succeeded but whose response never reached us is sent again, so deduplicate on the event id.
Retries
We look for due deliveries every 15 seconds. A failed delivery is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours. That is eight attempts over about two days. After the eighth failure the delivery is marked failed and not tried again.
Automatic switching off
An endpoint is switched off when it has failed 50 times in a row and has not had a successful delivery for three days. Both must be true, so a short outage on a busy account does not switch it off. The endpoint shows Off and the reason, including the last error.
To switch it back on, click the switch button on the endpoint. This resets its failure count, and deliveries that were still waiting are tried again.
Manage an endpoint
Each endpoint shows its events, the start of its secret, when it last succeeded, and how many deliveries have failed in a row.
- Send test sends a signed
webhook.testevent straight away and tells you what your server answered. Use it to check your signature code. - Switch off / Switch on pauses or resumes deliveries.
- Replace signing secret issues a new secret, shown once. Every delivery from then on, retries included, is signed with the new one, so update your server straight away.
- Delete removes the endpoint. Events not yet delivered to it are dropped.
- Recent deliveries shows the last 10 deliveries: the event, the result and status code, any error, the number of attempts, and when it was created.
To change an endpoint's URL or events, use the webhooks API, or delete it and add it again.