API reference
Webhooks
Signed HTTPS events for your own scripts and agent frameworks. Payloads carry ids only, never message bodies.
Add an endpoint in Settings → Webhooks: an HTTPS URL (no IP addresses or localhost) and the events you want. You get a signing secret once. Fetch any content you need through the agent API with your own scoped token.
Events#
| Event | When | data |
|---|---|---|
message.received | New inbound mail (or a held thread was released) | message_id, thread_id, brand_id |
message.held | Inbound mail held by the prompt-injection guard | message_id, thread_id, brand_id |
message.sent · off by default | The provider accepted an outbound message | message_id, thread_id, provider ids |
message.delivered · off by default | Delivered to the recipient's server | message_id, thread_id |
message.delivery_delayed · off by default | Delivery is delayed, the provider keeps trying | message_id, thread_id |
message.bounced | Bounced; the address goes on the suppression list | message_id, thread_id |
message.complained | The recipient marked it as spam | message_id, thread_id |
message.failed | Rejected, failed, or outcome unknown | message_id, thread_id |
draft.created | An agent created a draft | draft_id, thread_id |
draft.approved · off by default | A person (or agent send) approved a draft | draft_id, … |
draft.rejected | A person rejected a draft | draft_id, … |
thread.follow_up_due | A follow-up date passed with no answer | thread_id |
thread.sla_breached | A thread waited longer than the brand's reply-time target | thread_id, brand_id |
temp_mail.received | Mail reached one of your temp inboxes | inbox_id, message_id, address |
temp_mail.sent | Mail from a temp inbox went out | inbox_id, sent_id |
temp_mail.send_failed | Mail from a temp inbox failed | inbox_id, sent_id |
Payload#
content-type: application/json
user-agent: BoostMails-Webhooks/1.0
boostmails-event: message.received
boostmails-delivery: evt_3f9c0a1d2b7e4c5f8a6d9e0b1c2a3f4e
boostmails-signature: t=1764493920,v1=5d41402abc4b2a76b9719d911017c592…Verify the signature#
boostmails-signature is t=<unix seconds>,v1=<hex>, where v1 is HMAC-SHA256 of <t>.<raw body> with your signing secret. Compute it over the raw bytes before parsing JSON, compare in constant time, and reject timestamps older than a few minutes.
import { createHmac, timingSafeEqual } from "node:crypto";
export function verify(rawBody, header, secret, toleranceSec = 300) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const t = Number(parts.t);
if (!t || Math.abs(Date.now() / 1000 - t) > toleranceSec) return false;
const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
const a = Buffer.from(expected);
const b = Buffer.from(parts.v1 ?? "");
return a.length === b.length && timingSafeEqual(a, b);
}Retries#
Answer with any 2xx within 10 seconds. Anything else, a timeout or a redirect counts as a failure and is retried from the queue. After 20 failures in a row the endpoint is turned off; turn it back on in Settings → Webhooks. Use boostmails-delivery (the event id) to ignore duplicates.