Webhooks

Developer docs · Updated November 22, 2026

Webhooks tell your systems the moment a request changes, so you don't have to poll. Usual sends a signed POST with a small JSON body to an https address you choose, for the events you pick.

Events

EventWhen it's sent
request.sentA request goes out to the client.
request.submittedThe client submits an item on the request link: a file, an answer, a signature, or "doesn't apply". Sent every time.
request.all_receivedEvery required item on a request is in. Sent once per request.
request.completedThe request is completed, usually by your team. The client's link stops working and reminders end.

Add a webhook

  1. In Usual, open Settings › Developers. Owners and admins can manage webhooks.
  2. Under Webhooks, enter your address. It must start with https:// and be reachable from the internet.
  3. Tick the events you want and press Add webhook.
  4. Copy the signing secret. It starts with whsec_ and is shown only once.

Each webhook in the list shows when it last delivered, or that the last one failed and the status code your server answered. Remove stops all deliveries to that address.

Tools that manage their own subscriptions, like Zapier, can subscribe with the API instead. POST /v1/hooks takes a url and one event, and answers with the subscription's id and its signing secret. The secret is in that answer only, so store it then:

curl https://api.usual.so/v1/hooks \
  -H "Authorization: Bearer $USUAL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/webhooks/usual", "event": "request.all_received" }'
{ "id": "6f1d2c3b-8a4e-4b7f-9c2d-1e5a7b9c0d3f", "secret": "whsec_YOUR_SIGNING_SECRET" }

DELETE /v1/hooks/{id} removes the subscription.

Payload

Every delivery is a POST with these headers:

Content-Type: application/json
User-Agent: Usual-Webhooks/1
Usual-Event: request.all_received
Usual-Signature: t=1795458000,v1=5f2b0c...

The body names the event and describes the request. It never includes the client's answers or files.

{
  "id": "0d7c5a8e-3f1b-4c55-9a8e-2b1f4d6c7e90",
  "event": "request.all_received",
  "created": "2026-11-12T15:04:05.000Z",
  "data": {
    "requestId": "b3d95551-e677-4f92-9db9-848decd23dc4",
    "clientId": "556ae219-5743-46e1-ab1e-801bdf4e3394",
    "clientName": "Cedar & Pine Coffee",
    "name": "Monthly bookkeeping close – October 2026",
    "status": "waiting",
    "dueAt": "2026-11-13T17:00:00.000Z",
    "received": 4,
    "required": 4,
    "percent": 100
  }
}
  • id identifies the delivery and stays the same on every retry. Use it to skip events you've already handled.
  • created is when the event happened, not when this attempt was sent.
  • data.status is the request's status at that moment, and received, required and percent count required items. For full detail, call GET /v1/requests/{requestId}.

Verify the signature

Usual-Signature holds a Unix timestamp t and v1, the hex HMAC-SHA256 of the timestamp, a period and the raw body, keyed with your signing secret: the whsec_ value from Settings or from the POST /v1/hooks answer. Compute the same value and compare. Check the raw bytes you received: parsing the JSON and serializing it again changes the body.

import crypto from "node:crypto";
import express from "express";

const secret = process.env.USUAL_WEBHOOK_SECRET; // whsec_…

/** True when the body came from Usual, signed in the last five minutes. */
function verifyUsualSignature(rawBody, header, toleranceSeconds = 300) {
  const parts = Object.fromEntries(header.split(",").map((part) => part.split("=")));
  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${parts.t}.${rawBody}`)
    .digest("hex");
  const given = Buffer.from(parts.v1 ?? "", "utf8");
  const wanted = Buffer.from(expected, "utf8");
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) <= toleranceSeconds;
  return fresh && given.length === wanted.length && crypto.timingSafeEqual(given, wanted);
}

const app = express();

app.post("/webhooks/usual", express.raw({ type: "application/json" }), (req, res) => {
  const rawBody = req.body.toString("utf8");
  if (!verifyUsualSignature(rawBody, req.get("Usual-Signature") ?? "")) {
    return res.sendStatus(400);
  }
  const event = JSON.parse(rawBody);
  // Answer quickly, then do the work: Usual waits 10 seconds at most.
  res.sendStatus(200);
  console.log(event.event, event.data.clientName, `${event.data.percent}% in`);
});

app.listen(3000);

The timestamp check stops someone from replaying an old delivery they captured. Each retry is signed again with a new t, so a five-minute window is enough.

Retries

Answer with any 2xx status within 10 seconds. Anything else, a timeout, or a connection error counts as a failure, and Usual tries again after 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours. Retries run on a 15-minute schedule, so each can land a little later than that. After the sixth failed attempt, about 15 hours after the first, the delivery is marked failed and Settings shows it.

Because of retries, deliveries can arrive more than once and out of order. Use id to drop duplicates and created to tell which is newer.

Test locally

Your server needs a public https address. While developing, expose a local port with a tunnel of your choice, add that address as a webhook, then send yourself a request from Usual and watch the deliveries arrive.

Something missing or wrong here? Write to support@usual.so. A person answers, usually within a business day.

NextZapier →