Skip to content
Get started
Esc
Webhooks

Building

Updated 4 December 2026

Setting the address

The webhook address is set on your account's Webhook page. There is one for all your workspaces, https only.

What arrives

Each event comes as a POST request with JSON of four fields: type, timestamp, workspace and data. workspace is its workspace: id, the Workspace ID from the workspace's Settings page, which never changes, and name, its current name. Tell the events of your workspaces apart by workspace.id when you have several.

Event When it comes
message.received A customer wrote to you.
message.status A message changed status.
message.refused A message will not go.
channel.updated A channel was connected or cut off, or an alert came or went.
webhook.test You sent a test from the workspace's Webhook deliveries page. Answer 2xx and ignore it.

Verifying the signature

Every event is signed the Standard Webhooks way, in three headers:

  • webhook-id: the event's id, the same on every retry.
  • webhook-timestamp: when it was sent, in Unix seconds.
  • webhook-signature: one or more signatures, each v1, followed by a base64 HMAC, separated by spaces.

The signing secret starts with whsec_. Keep it in an environment variable, for example WEBHOOK_SECRET.

With a library

Use the Standard Webhooks library for your language. It checks all of it in one call:

  • Node.js: standardwebhooks
  • PHP: standard-webhooks/standard-webhooks
  • Python: standardwebhooks
  • Go: github.com/standard-webhooks/standard-webhooks/libraries/go
  • .NET: StandardWebhooks.StandardWebhooks
  • Rust: standardwebhooks
Code language
// npm install express standardwebhooks
import express from "express";
import { Webhook } from "standardwebhooks";

const webhook = new Webhook(process.env.WEBHOOK_SECRET);
const app = express();

app.post("/webhooks", express.raw({ type: "application/json" }), (req, res) => {
  let event;

  try {
    event = webhook.verify(req.body, req.headers);
  } catch {
    return res.sendStatus(400);
  }

  res.sendStatus(200);
  console.log(event.type, event.workspace.id, event.data);
});

app.listen(3000);

By hand

  1. Take the body exactly as it arrived, before parsing the JSON.
  2. Base64-decode the part of the secret after whsec_.
  3. With that key, compute the HMAC-SHA256 of webhook-id.webhook-timestamp.body and base64-encode it.
  4. Compare it with each signature after v1, in webhook-signature, in constant time.
  5. Reject the event if webhook-timestamp is more than 5 minutes off your clock.

Answering and retries

If the address does not answer 2xx, we try again: 8 tries in all over about 21 h. If the address fails for longer than 24 h while events keep coming, sending pauses, and new events wait until it is resumed on the workspace's Webhook deliveries page or a new address is saved. That page shows every try, and sends the test event webhook.test: answer it 2xx, its data holds only message.

Try Wait before it
1 At once
2 10 seconds
3 1 minute
4 5 minutes
5 30 minutes
6 2 hours
7 6 hours
8 12 hours

Answer 2xx within 5 seconds and do long work in the background. After any other response or a timeout the event comes again with the same webhook-id, so use it to drop repeats. Any other response, 3xx and 4xx included, counts as a failure.

In your account

  • The account's Webhook page sets the address, the events it hears and the signing secret. A new secret signs every event at once, so update your server first.
  • Each workspace's Webhook deliveries page lists its events with every try and the payload. They are kept 30 days.
  • Resend sends one event again and Resend undelivered every event that ran out of tries, on a fresh schedule and with the same webhook-id. Neither works while deliveries are paused: Resume sends what waited.
  • Send test event sends webhook.test once, even while deliveries are paused or the address skips other events.