From decision to delivery.
Receive signed review notifications on your backend. Your platform decides what to publish.
Connect your endpoint
- Open Webhooks in your signed-in workspace. Owners and admins can manage one endpoint per workspace.
- Save a public HTTPS URL on port 443. Query parameters, URL credentials, IP literals, private network destinations, and redirects are unsupported.
- Store the one-time signing secret on your backend. Install signature verification, then enable delivery and send a test event.
Verify before processing
Headers are Jmod-Event-Id, Jmod-Timestamp (Unix seconds), and Jmod-Signature. The signature is v1= followed by a lowercase HMAC-SHA256 hex digest. Its key is the full UTF-8 signing secret, including the whsec_ prefix. The signed message is eventId.timestamp.rawBody.
import { verifyReviewWebhook } from "@repo/moderation-client";
const event = await verifyReviewWebhook({
body: await request.text(), // preserve the original bytes; do not reserialize
headers: request.headers,
secret: process.env.JMOD_WEBHOOK_SECRET!,
workspaceId: process.env.JMOD_WORKSPACE_ID!,
});
// In your own durable transaction:
// 1. Skip an event.id you have already processed.
// 2. Apply review events only if data.revision is newer than your saved revision.
// 3. Save the event ID and any work to perform atomically.
// Then return a 2xx response. webhook.test has data: null.The helper verifies the signature, rejects timestamps more than five minutes in either direction, checks the workspace and event shape, and returns the verified event. It does not store processed IDs or enforce your publishing policy. Keep your server clock synchronized. Other languages should compare HMAC values in constant time.
Event contract
New human decisions emit review.approved, review.rejected, or review.reopened. A test emits webhook.test. Initial retention, automatic policy advice, deletion, and expiry do not emit events. Events created before enabling delivery are not backfilled.
{
"id": "evt_00000000-0000-4000-8000-000000000001",
"type": "review.approved",
"created_at": "2026-10-09T17:00:00.000Z",
"workspace_id": "your-workspace-id",
"data": {
"review_id": "mod_00000000-0000-4000-8000-000000000002",
"revision": 2,
"status": "approved",
"expires_at": "2026-10-16T17:00:00.000Z"
}
}Payloads exclude content, image URLs, original scores, reviewer identities, and notes. Fetch the current review and original assessment through GET /v1/reviews/{id} with a workspace API key when needed. Original scores remain unchanged by human decisions.
Retries and reconciliation
Events are queued in the same database transaction as the decision, then delivered asynchronously by the account service. Return a 2xx response within eight seconds. Failures retry after 30 seconds, 2 minutes, 10 minutes, 1 hour, and 6 hours, for six total attempts. Worker downtime can delay attempts. Redirects count as failures. Response bodies are never retained.
Retries preserve the event ID and exact body, with a new signing timestamp. A lost acknowledgment or worker crash can cause duplicates. Delivery order is not guaranteed: use review revisions, not arrival order, and reconcile failed or missed events through the review API. A notification reports a historical decision; it does not establish that the review remains available.
History is visible for seven days. Expired or deleted reviews cancel waiting deliveries. Endpoint changes cancel waiting attempts; rotation also pauses delivery. An attempt already in progress may still reach the previous destination or use the previous secret. A 1,000-item waiting queue returns 429 and rolls back a new decision rather than silently losing its notification. Test events are limited to one per minute.
Installation requirements
The account service needs the webhook migration and a persistent WEBHOOK_ENCRYPTION_KEY containing 64 hexadecimal characters. Store it in the server’s secret manager and use the same key on every account-service replica. It encrypts signing secrets at rest; replacing it without migrating ciphertext makes existing secrets unreadable. The account service runs the delivery worker. Rust scoring requests never wait on webhook delivery.