Skip to the page
Docs articles

Receive webhooks

How a delivery reaches your endpoint, how to check its signature, and how to answer so nothing is lost or taken twice.

Last updated

View as Markdown
On this page

A webhook posts each change you chose to an address of your own, such as api.acme.com/webhooks/notert, as it happens. Adding one is covered in send events to your own systems with webhooks. This page is for whoever builds the endpoint behind it. Webhooks come with the paid plans: see the plans.

Deliveries follow the Standard Webhooks specification, so its libraries can check them as well as the code below.

Add a webhook from your code

An integration can subscribe itself through the API, with a token that holds webhooks:manage, reaches every board and holds the read permission of each event's area, and webhooks:emails for a vote's, comment's, conversation's or contact's events, which carry customers' email addresses:

curl https://app.notert.io/api/v1/webhooks \
  -H "Authorization: Bearer $NOTERT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://api.acme.com/webhooks/notert", "events": ["request.created"]}'

The answer is the only time the signing secret is shown, so store it. Send an id of your own, a UUID, so a call sent again after a lost answer returns the same webhook, with a new secret, rather than adding a second. Every owner of the workspace is emailed about it.

The same token keeps it running: PATCH /webhooks/{id} changes its address, events or description, each field left out staying as it is, PUT /webhooks/{id}/enabled turns it back on once you fixed what made it turn itself off, POST /webhooks/{id}/test posts a sample event and answers how your endpoint took it, GET /webhooks/{id}/deliveries lists what was sent and how each went, and POST /webhook-deliveries/{id}/redeliver sends a delivery again under the same webhook-id. A new address is never sent what was made before it, and every owner is emailed about it too.

What Notert sends

Each delivery is one POST with a JSON body and these headers:

HeaderValue
content-typeapplication/json
user-agentContains Notert-Webhooks/1.0. If a firewall stands in front of the endpoint, allow it.
webhook-idThe delivery's id, the same on every retry
webhook-timestampWhen this attempt was sent, in seconds since 1970
webhook-signaturev1, and the signature, described below

A delivery looks like this on the wire:

POST /webhooks/notert HTTP/1.1
Host: api.brightline.example
content-type: application/json
user-agent: Notert-Webhooks/1.0 (+https://app.notert.io)
webhook-id: 0b8e5c2a-7f3d-4e19-a6b4-9c1d2e3f4a5b
webhook-timestamp: 1763806931
webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4=

{"type":"request.status_changed","timestamp":"2026-11-22T10:22:11.482Z","data":{"request":{"id":"3f2a9c1e-6b7d-4e58-9a0f-1c2d3e4f5a6b","title":"Dark mode for the public board","details":"Our team works late, and the board is **very** bright.","status":"in_progress","boardId":"b7e1d2c3-4a5b-4c6d-8e9f-0a1b2c3d4e5f","parentId":null,"votes":42,"createdAt":"2026-10-12T09:31:40.118Z"},"previous":{"status":"planned"},"via":null}}

The body is the same three keys for every event: type, the event's name; timestamp, when it happened; and data, the things it is about as they stood at that moment. Each event, what it holds and when it's sent, is in webhook events.

To see any event's body before building against it, open the webhook in Notert's settings and press Send test event: it shows the body for each event the webhook listens to and sends it to your endpoint, signed like every delivery. A test carries made-up examples like the ones in webhook events, with its own webhook-id, and is never retried.

Check the signature

Check every delivery before acting on it, so a request that didn't come from Notert, or was changed on the way, is refused. The signature is an HMAC-SHA256 of the delivery's id, its timestamp and the body, joined by dots, keyed with the endpoint's signing secret without its whsec_ prefix, and sent in base64.

Sign the body exactly as it arrived. A body parsed into JSON and written out again won't match, so read the raw bytes on this route:

// Express
import { createHmac, timingSafeEqual } from "node:crypto";

app.post("/webhooks/notert", express.raw({ type: "application/json" }), (req, res) => {
  if (!verifyWebhook(req.body.toString("utf8"), req.headers, process.env.NOTERT_WEBHOOK_SECRET)) {
    return res.sendStatus(400);
  }
  const event = JSON.parse(req.body);
  // Act on event.type and event.data.
  res.sendStatus(204);
});

function verifyWebhook(rawBody, headers, secret) {
  const id = headers["webhook-id"];
  const timestamp = headers["webhook-timestamp"];
  const signatures = headers["webhook-signature"];
  if (!id || !timestamp || !signatures) return false;

  // Refuse a delivery sent more than five minutes from now, so an old one can't be replayed.
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 5 * 60) return false;

  const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
  const expected = createHmac("sha256", key).update(`${id}.${timestamp}.${rawBody}`).digest();

  return signatures.split(" ").some((signature) => {
    const [version, value] = signature.split(",");
    if (version !== "v1" || !value) return false;
    const received = Buffer.from(value, "base64");
    return received.length === expected.length && timingSafeEqual(received, expected);
  });
}
# Python
import base64, hashlib, hmac, time

def verify_webhook(raw_body: bytes, headers, secret: str) -> bool:
    msg_id = headers.get("webhook-id")
    timestamp = headers.get("webhook-timestamp")
    signatures = headers.get("webhook-signature")
    if not msg_id or not timestamp or not signatures:
        return False

    # Refuse a delivery sent more than five minutes from now, so an old one can't be replayed.
    if abs(time.time() - int(timestamp)) > 5 * 60:
        return False

    key = base64.b64decode(secret.removeprefix("whsec_"))
    signed = f"{msg_id}.{timestamp}.".encode() + raw_body
    expected = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()

    return any(
        hmac.compare_digest(value, expected)
        for version, _, value in (s.partition(",") for s in signatures.split(" "))
        if version == "v1"
    )

In a framework that hands you a Web Request, such as a Next.js route handler, read the body with request.text() before anything parses it:

// app/api/webhooks/notert/route.ts
export async function POST(request: Request) {
  const rawBody = await request.text();
  const headers = Object.fromEntries(request.headers);
  if (!verifyWebhook(rawBody, headers, process.env.NOTERT_WEBHOOK_SECRET!)) {
    return new Response(null, { status: 400 });
  }
  const event = JSON.parse(rawBody);
  await queue.add(event); // Act on it after answering.
  return new Response(null, { status: 204 });
}

Or let a Standard Webhooks library do the checking, with the secret exactly as Notert shows it, whsec_ included:

import { Webhook } from "standardwebhooks";

const webhook = new Webhook(process.env.NOTERT_WEBHOOK_SECRET);

app.post("/webhooks/notert", express.raw({ type: "application/json" }), (req, res) => {
  let event;
  try {
    event = webhook.verify(req.body.toString("utf8"), req.headers);
  } catch {
    return res.sendStatus(400);
  }
  // Act on event.type and event.data.
  res.sendStatus(204);
});

Keep the signing secret on your server, like a password. After someone rolls it, every delivery is signed with the new one at once, retries of earlier ones included, and with the old one too for 24 hours, two signatures in webhook-signature, so your endpoint keeps taking them while you update its secret. The code above takes a delivery whose signature matches either.

Test your check

Before Notert sends anything, sign a body of your own the same way and post it to your endpoint running on your machine. With the same secret, your check should take it; change one character of the body and it should refuse it:

// sign-test.mjs: node sign-test.mjs | sh
import { createHmac, randomUUID } from "node:crypto";

const secret = process.env.NOTERT_WEBHOOK_SECRET;
const id = randomUUID();
const timestamp = Math.floor(Date.now() / 1000);
const body = JSON.stringify({
  type: "request.created",
  timestamp: new Date().toISOString(),
  data: {},
});
const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
const signature = createHmac("sha256", key).update(`${id}.${timestamp}.${body}`).digest("base64");

console.log(`curl -i http://localhost:3000/webhooks/notert \\
  -H 'content-type: application/json' \\
  -H 'webhook-id: ${id}' \\
  -H 'webhook-timestamp: ${timestamp}' \\
  -H 'webhook-signature: v1,${signature}' \\
  -d '${body}'`);

Then press Send test event in Notert to see a real delivery reach the endpoint once it's deployed.

If the signature doesn't match

  • The body was parsed first. A framework's JSON parser, or a proxy that rewrites JSON, changes the bytes. Read the raw body on the webhook's route alone.
  • The secret was decoded wrong. Take off whsec_, then decode the rest from base64 to bytes, and key the HMAC with those bytes, not with the text.
  • The clock is off. A server whose clock drifts more than five minutes refuses every delivery by its timestamp. Keep it in sync.
  • The secret was rolled. Copy the new one from Notert. For a day the header carries two signatures, so check each.

Answer quickly

  • Answer with a 2xx within 10 seconds. Anything else is a failure: an error, no answer in time, and a redirect too, since a signed delivery is meant for the address it was sent to and redirects aren't followed. What your endpoint answers with is never read. While your endpoint's deliveries are failing, Notert waits 3 seconds for most retries and the whole 10 for each delivery's first attempt and its last, so answer quickly.
  • Do the work after answering. Store the delivery or put it on a queue, answer, then act on it, so a slow step never runs past the time limit.
  • Use a public address, on the standard ports. An address on a port such as :8080, or with a username and password in it, can't be added, and one on a private network fails without being tried again.

A failed delivery is tried again with growing waits for about a day. Answer 429 or 503 with a Retry-After of up to 15 minutes and the next try waits that long instead. After 3 days of failing deliveries, with none delivered in between, the webhook is turned off and the workspace's owners and admins are told. Answer 410 Gone to have it turned off at once, as when the integration it fed was removed. The team can see each delivery, the body and webhook-id it was sent with, and what your endpoint answered in Recent deliveries, and resend one there, or every failed and not-sent one from a moment on, each under its own webhook-id. An event while the webhook is turned off isn't sent until the team resends it. A retry or a resend sends nothing for an event the webhook no longer listens to, or about something no longer public.

Take each change once

A retry sends the same webhook-id with the same body, so a delivery your endpoint took but answered too slowly can arrive twice. Record the ids you've handled and skip one you've already seen.

// recordDelivery inserts the id into a table with a unique index, doing nothing on a conflict, and
// answers whether it inserted. Run it in the same transaction as the work it guards, so work that
// fails lets the retry through.
const firstTime = await recordDelivery(tx, req.headers["webhook-id"]);
if (!firstTime) return res.sendStatus(204); // Already handled.

Deliveries can also arrive out of order, such as a retry of an older status change after a newer one. Each carries things as they were when the change happened, so when only the latest state matters, compare the body's timestamp with the last one you applied for that request or conversation, or fetch the request as it is now from the API.

Start here

Up and down arrowsto moveEnterto openEscto close