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#

EventWhendata
message.receivedNew inbound mail (or a held thread was released)message_id, thread_id, brand_id
message.heldInbound mail held by the prompt-injection guardmessage_id, thread_id, brand_id
message.sent · off by defaultThe provider accepted an outbound messagemessage_id, thread_id, provider ids
message.delivered · off by defaultDelivered to the recipient's servermessage_id, thread_id
message.delivery_delayed · off by defaultDelivery is delayed, the provider keeps tryingmessage_id, thread_id
message.bouncedBounced; the address goes on the suppression listmessage_id, thread_id
message.complainedThe recipient marked it as spammessage_id, thread_id
message.failedRejected, failed, or outcome unknownmessage_id, thread_id
draft.createdAn agent created a draftdraft_id, thread_id
draft.approved · off by defaultA person (or agent send) approved a draftdraft_id, …
draft.rejectedA person rejected a draftdraft_id, …
thread.follow_up_dueA follow-up date passed with no answerthread_id
thread.sla_breachedA thread waited longer than the brand's reply-time targetthread_id, brand_id
temp_mail.receivedMail reached one of your temp inboxesinbox_id, message_id, address
temp_mail.sentMail from a temp inbox went outinbox_id, sent_id
temp_mail.send_failedMail from a temp inbox failedinbox_id, sent_id

Payload#

POST to your URL
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.