FaxTerra posts an event to your https endpoint when a fax is delivered in full or in part, fails, will be tried again, or arrives.
An owner or admin adds an https endpoint in Settings, under Developer tools, and chooses its events; each is a POST of a WebhookEvent. It is signed: FaxTerra-Signature is t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>" with the endpoint's secret, shown once when the endpoint is added>. Compute it over the raw body, compare in constant time, and refuse a t more than 300 seconds from your clock. Roll secret on the endpoint in Settings replaces the secret; the old one stops at once. Answer any 2xx; anything else, or no answer, is tried again with a growing wait for about 3 days. 20 failures in a row turn the endpoint off and email the person who added it. The same event can arrive more than once: act on its id once. It carries ids, status and counts, never the document; read the fax with GET /faxes/{id} or GET /inbox/{id}. An account with the HIPAA add-on gets no numbers and no reference in the event.
fax.delivered
{
"id": "8d1c2f6a-4b0e-4b7f-8a3c-5d2e1f0a9b8c",
"type": "fax.delivered",
"createdAt": "2026-11-21T15:06:42.000Z",
"data": {
"fax": {
"id": "6fa459ea-ee8a-4ca4-894e-db77e160355e",
"direction": "outbound",
"status": "delivered",
"pageCount": 2,
"pagesDelivered": 2,
"errorCode": null,
"deliveredAt": "2026-11-21T15:06:40.000Z",
"from": "+12025550142",
"to": "+12015550101",
"reference": "invoice-1042"
}
}
}fax.delivered_partial
{
"id": "8d1c2f6a-4b0e-4b7f-8a3c-5d2e1f0a9b8c",
"type": "fax.delivered_partial",
"createdAt": "2026-11-21T15:06:42.000Z",
"data": {
"fax": {
"id": "6fa459ea-ee8a-4ca4-894e-db77e160355e",
"direction": "outbound",
"status": "failed",
"pageCount": 30,
"pagesDelivered": 22,
"errorCode": "receiver_call_dropped",
"from": "+12025550142",
"to": "+12015550101",
"reference": "invoice-1042"
}
}
}fax.failed
{
"id": "8d1c2f6a-4b0e-4b7f-8a3c-5d2e1f0a9b8c",
"type": "fax.failed",
"createdAt": "2026-11-21T15:06:42.000Z",
"data": {
"fax": {
"id": "6fa459ea-ee8a-4ca4-894e-db77e160355e",
"direction": "outbound",
"status": "failed",
"pageCount": 2,
"pagesDelivered": 0,
"errorCode": "receiver_no_answer",
"from": "+12025550142",
"to": "+12015550103",
"reference": "invoice-1042"
}
}
}fax.retry_scheduled
{
"id": "8d1c2f6a-4b0e-4b7f-8a3c-5d2e1f0a9b8c",
"type": "fax.retry_scheduled",
"createdAt": "2026-11-21T15:06:42.000Z",
"data": {
"fax": {
"id": "6fa459ea-ee8a-4ca4-894e-db77e160355e",
"direction": "outbound",
"status": "retry_scheduled",
"pageCount": 2,
"pagesDelivered": 0,
"errorCode": "user_busy",
"nextAttemptAt": "2026-11-21T15:08:42.000Z",
"from": "+12025550142",
"to": "+12015550102",
"reference": "invoice-1042"
}
}
}fax.received
{
"id": "8d1c2f6a-4b0e-4b7f-8a3c-5d2e1f0a9b8c",
"type": "fax.received",
"createdAt": "2026-11-21T15:06:42.000Z",
"data": {
"fax": {
"id": "9b2e7c1d-3f4a-4e5b-8c6d-7e8f9a0b1c2d",
"direction": "inbound",
"status": "received",
"pageCount": 3,
"receivedAt": "2026-11-21T15:06:40.000Z",
"from": "+12015550100",
"to": "+12025550142"
}
}
}POST /api/v1/webhooks/{id}/test with { "type": "fax.delivered" }, or any event above. A signed event, sent the way every event is sent. With a fax event as type, the body is that event's example with "test": true at the top and a fax id that matches no fax. webhook.test, the default, has no fax. It is tried once, never retried, and doesn't count toward turning the endpoint off. A turned-off endpoint can be tested too. GET /api/v1/webhooks lists the account's endpoints and their ids, and Settings sends the same test from Developer tools.
Check every delivery before acting on it, over the raw body, comparing in constant time.
import { createHmac, timingSafeEqual } from "node:crypto";
// rawBody: the request body exactly as received, before any JSON parsing
// signatureHeader: the FaxTerra-Signature header
export function verifyFaxTerraWebhook(rawBody, signatureHeader, secret) {
if (!signatureHeader) return false;
const parts = Object.fromEntries(signatureHeader.split(",").map((p) => p.split("=")));
const t = Number(parts.t);
if (!Number.isFinite(t) || Math.abs(Date.now() / 1000 - t) > 300) return false;
const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
const given = Buffer.from(parts.v1 ?? "", "hex");
const want = Buffer.from(expected, "hex");
return given.length === want.length && timingSafeEqual(given, want);
}