API reference · v1
Bulk job webhooks
Pass webhook_url when creating a job and we POST the job object to it on completion. Every delivery is signed with your webhook secret in the X-VeriDock-Signature header (HMAC-SHA256 of the raw body). We retry failed deliveries with exponential backoff for 24 hours.
Verify a signature (Node.js)
import crypto from "node:crypto";
export function verifySignature(rawBody: string, header: string, secret: string) {
const expected = crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
// timingSafeEqual throws when the lengths differ, which any malformed header would trigger.
return header.length === expected.length && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(header));
}