Review callbacks

Receive signed notifications when a reviewer approves or rejects content.

Review callbacks send a signed HTTPS request to your server each time a reviewer approves or rejects content. They replace polling for manual review decisions.

Review callbacks are available on plans that include manual review and callbacks.

Set up a receiver

  1. Expose a public HTTPS endpoint on port 443, such as https://api.example.com/webhooks/clusterbot.
  2. Open Portal → Review callbacks, enable callbacks, and save the URL.
  3. Copy the signing secret. It is shown once. Store it in your receiver's secret configuration.
  4. Enable manual review in Portal → Usage & activity if you haven't already.

The signing secret is a 64-character lowercase hexadecimal string. Use the string itself, encoded as UTF-8, as the HMAC key — don't hex-decode it.

Allowed destinations

Only https:// URLs on port 443 are accepted. URLs with credentials or fragments, localhost, and private or internal IP addresses are rejected, including hostnames that resolve to them. Redirects aren't followed. To test locally, use a public HTTPS tunnel you control.

The notification

Clusterbot sends POST with Content-Type: application/json; charset=utf-8:

{
  "id": "93ec516f-4512-42ad-bec7-2c3867c19026",
  "type": "moderation.review.completed",
  "occurredAt": "2026-10-18T10:30:00+00:00",
  "data": {
    "reviewId": "ab43b6e9-d212-4350-8ca7-c01bd21ad6b3",
    "status": "Approved",
    "outcome": "Pass",
    "reviewedAt": "2026-10-18T10:30:00+00:00"
  }
}

A rejection has "status": "Rejected" and "outcome": "Rejected". Look up the message by data.reviewId and apply the outcome. The payload never contains message text, reviewer identity, or keys.

Headers:

Clusterbot-Event-Id: 93ec516f-4512-42ad-bec7-2c3867c19026
Clusterbot-Signature: t=1792319400,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd
User-Agent: Clusterbot-Webhooks/1.0

Each reviewed message produces its own event, including bulk decisions. Events aren't sent for pending reviews or for immediate automated decisions. Delivery order isn't guaranteed.

Verify the signature

Clusterbot-Signature contains a Unix timestamp t and a signature v1:

v1 = hex( HMAC-SHA256( key: signing_secret, message: t + "." + raw_body ) )

Before acting on a notification:

  1. Read the raw request body. Parsing and re-serializing the JSON changes the bytes and breaks the signature.
  2. Reject timestamps more than five minutes from your clock.
  3. Compute the expected signature and compare it with a constant-time comparison.
  4. Check that Clusterbot-Event-Id matches the body's id.
using System.Globalization;
using System.Security.Cryptography;
using System.Text;

static bool Verify(string header, string rawBody, string secret)
{
    var parts = header.Split(',');
    if (parts.Length != 2 || !parts[0].StartsWith("t=") || !parts[1].StartsWith("v1=")) return false;
    var timestamp = parts[0][2..];
    if (!long.TryParse(timestamp, NumberStyles.None, CultureInfo.InvariantCulture, out var seconds)) return false;
    if (Math.Abs(DateTimeOffset.UtcNow.ToUnixTimeSeconds() - seconds) > 300) return false;

    byte[] supplied;
    try { supplied = Convert.FromHexString(parts[1][3..]); }
    catch (FormatException) { return false; }

    var expected = HMACSHA256.HashData(Encoding.UTF8.GetBytes(secret),
        Encoding.UTF8.GetBytes(timestamp + "." + rawBody));
    return CryptographicOperations.FixedTimeEquals(supplied, expected);
}
import crypto from "node:crypto";

export function verify(header, rawBody, secret) {
  const match = /^t=(\d+),v1=([0-9a-f]{64})$/.exec(header ?? "");
  if (!match) return false;
  const [, timestamp, signature] = match;
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;

  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${timestamp}.${rawBody}`, "utf8")
    .digest();
  return crypto.timingSafeEqual(Buffer.from(signature, "hex"), expected);
}
import hashlib
import hmac
import re
import time

def verify(header: str, raw_body: bytes, secret: str) -> bool:
    match = re.fullmatch(r"t=(\d+),v1=([0-9a-f]{64})", header or "")
    if not match:
        return False
    timestamp, signature = match.groups()
    if abs(time.time() - int(timestamp)) > 300:
        return False
    expected = hmac.new(
        secret.encode("utf-8"),
        timestamp.encode("utf-8") + b"." + raw_body,
        hashlib.sha256,
    ).hexdigest()
    return hmac.compare_digest(expected, signature)

Secure your receiver

  • Trust the signature, not the network. Clusterbot doesn't publish fixed source IP addresses, so verify every request's signature instead of allowlisting IPs. A secret URL path is not a substitute.
  • Verify before doing anything else. Reject unsigned, stale, or mismatched requests with 401 before parsing JSON or touching your database.
  • Limit the request size. Notifications are small; reject bodies over 64 KiB.
  • Protect the secret. Store it in your secret manager, never log it, and rotate it if it might have leaked.
  • Treat the payload as data. Use data.reviewId only to look up a message you already hold, and only accept the outcome values documented here.

Acknowledge and deduplicate

Return any 2xx status once you have durably accepted the event. Respond within ten seconds; slow processing should happen after you acknowledge.

Delivery is at least once: you can receive the same event more than once. Store the event id and ignore repeats, ideally in the same transaction that applies the decision. Return 2xx for duplicates too.

Retries

Network errors, timeouts, redirects, and non-2xx responses are retried with the same event ID and body, and a fresh timestamp and signature. There are up to eight attempts, after delays of 30 seconds, 2 minutes, 10 minutes, 30 minutes, 2 hours, 6 hours, and 12 hours.

Portal → Review callbacks lists the most recent deliveries with their status (Pending, Delivered, Failed, or Cancelled), attempt count, and last HTTP status. After the final attempt, a delivery is Failed: reconcile it with GET /v1/moderations/{reviewId}.

Change or rotate the secret

Changing the URL, rotating the secret, or disabling callbacks cancels deliveries queued for the previous configuration. A new secret is shown once. To rotate without missing events, accept both the old and new secret in your receiver for a short time.

Enabling callbacks doesn't send events for decisions made earlier, but decisions on reviews that are already pending are delivered.

Questions about this guide? Contact us or try requests in the playground.