Webhooks
Get an HTTPS request the moment a migration finishes, fails, falls behind or sees a new field — no polling.
Adding an endpoint
Go to Settings → Developers → Webhooks, enter an HTTPS URL and choose the events to receive. The signing secret (whsec_…) is shown once — store it with your receiver's configuration. Use Send test to fire a test event. Owners and admins can manage webhooks.
Events
| Event | Sent when | data |
|---|---|---|
migration.started | A worker starts running a migration. | { migrationId } |
migration.completed | A one-time copy finishes. | { migrationId } |
migration.failed | A migration fails after its retries are exhausted. | { migrationId, error } |
cdc.error | A live sync disconnects, or skips a change event that kept failing. | { migrationId, reason, error, event? } |
cdc.lag_exceeded | Replication lag rises above the migration's threshold. | { migrationId, lagMs, thresholdMs } |
cdc.lag_recovered | Lag drops back below the threshold. | { migrationId, lagMs, thresholdMs } |
schema.drift | A live sync sees a field the mapping doesn't cover. | { migrationId, sourceField, targetColumn, type, action } |
For cdc.error, reason is disconnected or dead_letter (a change event was skipped after three failed attempts).
Payload
POST /hooks/nosqlsync HTTP/1.1
Content-Type: application/json
User-Agent: NoSQLSync-Webhooks/1
X-NoSQLSync-Event: migration.failed
X-NoSQLSync-Delivery: 5b0f6c1e-…
X-NoSQLSync-Signature: t=1793438400,v1=6f1c2a…
{
"event": "migration.failed",
"timestamp": "2026-10-31T09:20:00.000Z",
"data": {
"migrationId": "c41e…",
"error": "connect ETIMEDOUT 10.0.4.12:5432"
}
}X-NoSQLSync-Delivery is unique per delivery — use it to ignore duplicates if a retry arrives after you already processed the event.
Verifying signatures
Every delivery is signed with your endpoint's secret. To verify:
- Split the
X-NoSQLSync-Signatureheader intot(Unix seconds) andv1. - Compute HMAC-SHA256 over
`${t}.${rawBody}`using the secret, hex-encoded. - Compare it to
v1in constant time, and reject timestamps more than 5 minutes old to block replays.
Use the raw request body. Parsing and re-serialising JSON changes whitespace and breaks the signature.
Node.js
import { createHmac, timingSafeEqual } from "node:crypto";
export function verifyNoSQLSync(rawBody: string, header: string, secret: string, toleranceSec = 300) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=", 2)));
const t = Number(parts.t);
if (!Number.isFinite(t) || !parts.v1) return false;
if (Math.abs(Date.now() / 1000 - t) > toleranceSec) return false;
const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest();
const received = Buffer.from(parts.v1, "hex");
return received.length === expected.length && timingSafeEqual(received, expected);
}
// Next.js route handler
export async function POST(req: Request) {
const raw = await req.text();
if (!verifyNoSQLSync(raw, req.headers.get("x-nosqlsync-signature") ?? "", process.env.NOSQLSYNC_WEBHOOK_SECRET!)) {
return new Response("invalid signature", { status: 401 });
}
const { event, data } = JSON.parse(raw);
// …handle event
return new Response("ok");
}Python
import hmac, hashlib, time
def verify_nosqlsync(raw_body: bytes, header: str, secret: str, tolerance: int = 300) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
t = int(parts.get("t", "0"))
if abs(time.time() - t) > tolerance or "v1" not in parts:
return False
expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts["v1"])Delivery and retries
- Respond with any
2xxstatus within 10 seconds. Do slow work asynchronously. - Failed deliveries (non-2xx, timeout, connection error) are retried up to 5 times with exponential back-off starting at 2 seconds.
- Redirects are not followed — use the final URL.
- URLs must be HTTPS and publicly reachable; private and internal addresses are rejected.
Rotating the secret
Click Rotate secret (or POST /webhooks/:id/secret). The new secret takes effect immediately and is shown once, so deploy it to your receiver straight away.