Webhooks and alerts
Send sign-ups, first payments, finished tests, enquiries, approved affiliates and form answers to Zapier, Make or your own server as signed webhooks, retried for about a day, and post the moments that need an admin to Slack.
Updated · 5 min read
Your app can tell other tools when something happens. Admin → Integrations sends events, like a sign-up or a first payment, to Zapier, Make or your own server as signed JSON, retried for about a day and logged attempt by attempt. Admin → Alerts posts the moments that need an admin, like a failed payment, to a Slack channel. Only admins can change either; viewers can look.
Add a webhook
- Get an address to send to. In Zapier, start a Zap with Webhooks by Zapier → Catch Hook; in Make, add a Webhooks → Custom webhook. Or use your own server's.
- In Admin → Integrations, choose Add webhook.
- Paste it into Endpoint address. Give it a Name if you like, such as "Zapier: new customers to HubSpot", to tell your webhooks apart.
- Tick the Events it should get, and choose Add webhook.
- Copy the signing secret and choose I've copied it. It's only shown once.
| Event | Sent when |
|---|---|
| Someone signed up | An account is created |
| A customer paid for the first time | An organisation's first paid invoice above zero, once per organisation |
| A test finished | A test is completed, with the winner if one was picked. A test that pauses at its end date doesn't count |
| An enquiry came in | The contact form is sent |
| An affiliate was approved | You approve an affiliate application |
| A form was sent | Someone sends one of your forms. Spam never goes out |
When you tick A form was sent, Which forms appears: choose Every form or pick the ones it should hear. A webhook added from a form's Connect tab hears that form only; see Connect forms.
You can add up to 20 webhooks. Each one needs a public https:// address, on port 443 or 8443, checked when you save and again before every send. A local or private address is refused.
To try them against a receiver on your own machine, set WEBHOOKS_ALLOW_LOCAL=on on the server (it's off until you do). Webhooks, and a form's or an automation's posts, can then also go to localhost or a loopback address such as 127.0.0.1, over http:// or https://, on any port. Addresses on a private network are still refused. It only takes effect on a development server whose own addresses, BETTER_AUTH_URL and APP_ORIGIN, are on localhost too, and it's ignored in production.
Test it and watch the deliveries
Each webhook has a switch to turn it off and on, Send a test and Deliveries. A test is tried once, so you see straight away whether it arrived.
Deliveries lists the latest 50, newest first, as Delivered, Retrying or Failed. Each one shows every attempt, with the status code, how long it took, any error and the start of the answer, plus the payload that was sent. Deliveries are kept for 30 days. Redeliver sends any delivery again now.
Send an event again to the webhooks that got it
The Delivery log in Admin → Developers lists the events your app raised, each with what it was sent to: your webhooks, your own code's hooks and the automations that reacted to it. Replay sends an event again to the webhooks that got it the first time and still get that event (turned on and ticked for it, and for a form answer, hearing that form), for example after your receiver was down for longer than a day. A webhook you added later never got the event, so it doesn't get it now, and nor does one whose first delivery is still being retried. Before it sends, it names each webhook that will get it again, by its description or address host, and it sends only to those: if the list has changed by the time you confirm, it asks you to look again. The audit log records which webhooks got it. An event from before this update, or a form answer you've since deleted, isn't sent to your webhooks again.
A replay is a new delivery, marked Replay under Deliveries, and is retried like any other. It's the same event, with the same id and payload, so if your receiver drops events it has already handled, it drops this one too. An event's replays go one at a time, and each webhook can get the same event 20 times by replay. See Hooks for what a replay does to your code.
What your server gets
Every event is POSTed as JSON with the same shape:
{
"id": "evt_…",
"type": "payment.first",
"created": 1795946400,
"data": {
"organization": { "id": "…", "name": "Acme" },
"invoice": { "id": "in_…", "amount": 4900, "tax": 0, "currency": "usd", "plan": "pro", "paidAt": "2026-11-29T10:00:00.000Z" }
}
}
type is the event: user.signed_up, payment.first, experiment.finished, enquiry.received, affiliate.approved or form.submitted. created is in Unix seconds, and amounts are in the currency's smallest unit (cents), as Stripe sends them. A retry, a redelivery or a replay has the same id, so drop any you've already handled.
With it come these headers:
X-Webhook-Signature: t=<unix seconds>,v1=<hex>, an HMAC-SHA256 of<t>.<raw body>with the webhook's secret.X-Webhook-Id, the event's id, andX-Webhook-Event, its type.X-Form-Submission-Id, on form answers only.
Check the signature
Zapier and Make can skip this. Your own server should check the raw body, before parsing it, and refuse old timestamps. In Node:
import { createHmac, timingSafeEqual } from "node:crypto";
export function verifyWebhook(rawBody, header, secret, toleranceSeconds = 300) {
const parts = Object.fromEntries(
header.split(",").map((part) => part.split("=", 2)),
);
const timestamp = Number(parts.t);
if (!timestamp || !parts.v1) return false;
if (Math.abs(Date.now() / 1000 - timestamp) > toleranceSeconds) return false;
const expected = createHmac("sha256", secret)
.update(`${timestamp}.${rawBody}`)
.digest("hex");
const given = Buffer.from(parts.v1, "hex");
const wanted = Buffer.from(expected, "hex");
return given.length === wanted.length && timingSafeEqual(given, wanted);
}
To change the secret, choose Roll secret from the webhook's menu. Deliveries are signed with the new one straight away, so update your server at the same time.
When a send fails
Answer with any 2xx within 10 seconds. Anything else counts as a failure: another status, no answer in time, or a redirect, which isn't followed. A failed delivery is tried 8 times in all, waiting 1 minute, 5 minutes, 30 minutes, 2 hours, 5 hours, 8 hours and 10 hours, about a day, before it's marked Failed.
After five deliveries in a row fail, the webhook turns itself off and says why. Fix the endpoint, send a test, then turn it back on.
Post alerts to Slack
Admin → Alerts sends the moments that need an admin to one place:
- In Slack, add the Incoming Webhooks app and pick a channel. Copy the webhook address it gives you.
- Under Where alerts go, paste it into Webhook address and choose Save.
- Choose Send a test to check it arrives.
Any other https:// address works too, and gets JSON with the alert's event, title, body, link and text. Under What to send, switch off any you don't want:
- A test is ready to call
- A test reached its scheduled stop
- Someone applied to be an affiliate
- An agent is waiting for approval
- A customer's payment failed
- A page got slow for visitors: its loading time or layout shift was Poor for a day; see Analytics and the audience
Each moment is sent once. A failed post is tried again after 1 minute, 5 minutes, 30 minutes and 2 hours, then marked Didn't send. Recent alerts lists the last 20, and you can retry one from there. Change swaps the address and Stop forgets it, so nothing more is sent.
The same channel gets the reports from Automations, and a form's Post to Slack unless the form has a channel of its own.
Good to know
- Webhooks never slow the app down or make it fail: events are queued and sent in the background.
- Viewers see a webhook's address cut down to its host and the end of its path, and everyone sees the alert address masked. The audit log never records either in full.
- Delete removes a webhook and its delivery log, and can't be undone.
- Automations can also post to a webhook here. Those posts are tried once and logged in Automations, not under Deliveries.
Something unclear or missing? Ask us and we'll answer, then fix the page.



