Skip to content

Webhooks

A webhook tells your server that a session changed. The event carries no personal data, only the session id, so you verify the signature and then fetch the session with your API key, as you would when polling. Polling keeps working; webhooks only tell you when to look.

In the dashboard, open Webhooks, choose the app, and add an endpoint:

  • URL: https://, reachable from the internet. Addresses on private networks are refused, and redirects are not followed.
  • Mode: a test endpoint receives events from test sessions only, a live endpoint from live sessions only.
  • Events: one or more of the list below.

The signing secret (whsec_…) is shown once. Store it with your other secrets. New secret replaces it; the old one keeps signing alongside the new one for 24 hours, so you can roll it without dropping events.

Send a test queues a webhook.test event, which shows up under Deliveries with the result.

Event When
session.completed A result is in: approved, declined or review.
session.reviewed A reviewer decided a session that was in review.
session.expired The link ran out before the person finished.
session.cancelled You cancelled it, or the person left without a result.
session.erased The session was erased.
webhook.test Sent from the dashboard.
POST /your/path HTTP/1.1
Content-Type: application/json
User-Agent: rightful-webhooks/1
Rightful-Event: session.completed
Rightful-Event-Id: evt_3kTq…
Rightful-Signature: t=1767225600,v1=5f2b…
{"id":"evt_3kTq…","type":"session.completed","created_at":"2026-01-01T00:00:00Z",
"data":{"session_id":"ses_…","app_id":"app_…","mode":"live"}}

Answer with any 2xx within 15 seconds. Anything else, a timeout or a refused connection is a failure. Do the work after answering (queue it), not before.

v1 is the hex HMAC-SHA256 of `${t}.${rawBody}` under your signing secret. t is when that attempt was sent. During a secret rotation the header has one v1 per secret; any match is enough. Always verify against the raw body, before parsing it.

TypeScript (@rightful/client):

import { constructWebhookEvent, RightfulClient } from '@rightful/client';
app.post('/webhooks/rightful', express.raw({ type: 'application/json' }), async (req, res) => {
let event;
try {
event = await constructWebhookEvent({
secret: process.env.RIGHTFUL_WEBHOOK_SECRET!,
header: req.header('Rightful-Signature'),
body: req.body, // the raw bytes
});
} catch {
return res.sendStatus(400);
}
res.sendStatus(204);
if (event.type.startsWith('session.') && event.type !== 'session.erased') {
const session = await client.getSession(event.data.session_id);
// …
}
});

Java (id.rightful.client):

byte[] raw = request.getInputStream().readAllBytes();
if (!Webhooks.verify(secret, request.getHeader("Rightful-Signature"), raw)) {
response.setStatus(400);
return;
}
JsonNode event = mapper.readTree(raw);
String sessionId = event.path("data").path("session_id").asText();

Both refuse signatures more than 5 minutes from your clock by default.

By hand, in any language: split the header on ,, take t and every v1; refuse if |now − t| is more than a few minutes; compute HMAC_SHA256(secret, t + "." + rawBody) as lower-case hex and compare it with each v1 in constant time.

A failed delivery is retried after 1 minute, 5 minutes, 15 minutes, 1 hour, 3 hours, 6 hours and 12 hours (about 22 hours in all), then marked failed. Each retry is signed afresh with its own t.

The event id stays the same across retries, resends and endpoints: keep the ids you have handled and ignore repeats. Events can arrive out of order; the session you fetch is always the current state.

An endpoint with no successful delivery for 24 hours, or for one delivery’s whole retry schedule, is turned off and marked kept failing in the dashboard. You can also turn an endpoint off yourself. While an endpoint is off:

  • deliveries still waiting (not yet out of retries) are held, and resume when you turn it back on;
  • deliveries that are failed (out of retries) stay failed: use Resend on each one you need;
  • new events are not queued for it at all.

So after an endpoint has been off, catch up from the API: re-fetch with GET /v1/sessions/{id} every session you were still waiting on (not yet final, or in review), however old. created_after filters by creation time, not by change, so it only finds sessions created while the endpoint was off, not older ones that finished or were reviewed meanwhile. Resend on any delivery sends the same event, with the same id, again.

  • Up to 10 endpoints per app.
  • Delivery history is kept for 30 days.
  • The request body is never larger than a few hundred bytes and your response body is not read.