Webhooks
A webhook calls your address as soon as a verdict is ready, a file arrives, a delivery is exported, your credits run low or a rule changes, so that your workflow moves on without asking again.
Add an address
In Your agency › API, Webhooks section, choose Add an address: https, on port 443, reachable from the Internet. ValidFile then shows you its signing secret, once. Send a test sends you a signed webhook.test. Up to 2 addresses on Agency, 10 on Volume.
Events
| Event | When |
|---|---|
file.judged | A file has its verdict, or cannot have one for now (unreadable). |
delivery.judged | The delivery is closed, by your script or by your client on its drop link, and no received file in it is waiting for its verdict any more. Goes out again if a file is added then judged. |
file.received | A file arrived in a delivery: dropped by your client on its link, sent by an API key or by a person of the agency (origin). Before its verdict, which follows with file.judged. |
file.replaced | Your client dropped the fixed version of a file on its line: the new one (fileId) takes the place of the old one (replaces), withdrawn from the delivery. Instead of file.received, never with it. Nothing if they are the same bytes. |
delivery.exported | An export is done: a zip, or a send to Google Drive, OneDrive or SharePoint, once its last file is written or failed. Nothing for an export that wrote nothing. |
credits.low | The files you have left, plan and credits together, fall under 10 % of your plan’s files (10 without a plan). Once per fall: it goes out again after the balance has gone back over. |
spec.changed | A rule of a format your files of the last 90 days were judged on changes in ValidFile. At every such change, whether the spec alert e-mail goes or not: it does not go for a change of ValidFile’s own that moves none of your files. |
webhook.test | You pressed Send a test. |
An address receives the events ticked for it in Your agency › API, and no others: an address added before the last five receives the verdicts, as before, until you tick more. Other types may be added: ignore a type your code does not know.
{
"id": "evt_3JwQk7rT0bX9mPq2LcVn4a",
"type": "file.judged",
"createdAt": "2026-10-28T18:42:11.204Z",
"data": {
"deliveryId": "0b6c2f4e-8d1a-4c7b-9f3e-5a2d1c8b7e60",
"fileId": "9e2d4c1a-3b7f-4e0d-8a6c-2f1b5d9e7c43",
"campaignRef": "bynder:4471",
"verdict": "fail"
}
}
{
"id": "evt_9TfLm2Qx4cR8vWk1ZpHs0b",
"type": "delivery.judged",
"createdAt": "2026-10-28T18:47:52.918Z",
"data": {
"deliveryId": "0b6c2f4e-8d1a-4c7b-9f3e-5a2d1c8b7e60",
"campaignRef": "bynder:4471",
"files": 12,
"ready": 11
}
}
{
"id": "evt_Qm7Vb1Xk9LsT4nWc2RzP8e",
"type": "file.received",
"createdAt": "2026-10-28T18:41:58.633Z",
"data": {
"deliveryId": "0b6c2f4e-8d1a-4c7b-9f3e-5a2d1c8b7e60",
"fileId": "9e2d4c1a-3b7f-4e0d-8a6c-2f1b5d9e7c43",
"campaignRef": "bynder:4471",
"origin": "client"
}
}
{
"id": "evt_Hc4Np8Wq1ZtR6kYm3LvB0s",
"type": "file.replaced",
"createdAt": "2026-10-29T09:12:40.105Z",
"data": {
"deliveryId": "0b6c2f4e-8d1a-4c7b-9f3e-5a2d1c8b7e60",
"fileId": "4a8e1c7d-2f6b-4d3e-9b1a-7c5e3f2d8a61",
"replaces": "9e2d4c1a-3b7f-4e0d-8a6c-2f1b5d9e7c43",
"campaignRef": "bynder:4471"
}
}
{
"id": "evt_Zr2Kd6Tg9MwX1bQn5HpL7c",
"type": "delivery.exported",
"createdAt": "2026-10-29T10:03:17.480Z",
"data": {
"deliveryId": "0b6c2f4e-8d1a-4c7b-9f3e-5a2d1c8b7e60",
"exportId": "c3f1a9e2-5d7b-4a8c-b6e0-1d9f2a7c4e85",
"campaignRef": "bynder:4471",
"destination": "drive",
"files": 11,
"failed": 0
}
}
{
"id": "evt_Lp9Fs3Vc7NqY2wTk6RbH1m",
"type": "credits.low",
"createdAt": "2026-11-24T15:27:02.911Z",
"data": {
"left": 297,
"threshold": 300,
"planLeft": 297,
"credits": 0,
"periodEnd": "2026-12-01T05:00:00.000Z"
}
}
{
"id": "evt_Ws5Gh1Jx8CkP3mRv9TdN2q",
"type": "spec.changed",
"createdAt": "2026-11-11T04:05:12.000Z",
"data": {
"specVersion": "2026.11.10.1",
"formats": [
{
"id": "meta.storyreels.video.9x16",
"platform": "Meta",
"placement": "Stories / Reels",
"removed": false,
"rules": ["duration"],
"files": 14,
"moved": 3
}
],
"deliveries": ["0b6c2f4e-8d1a-4c7b-9f3e-5a2d1c8b7e60"],
"deliveriesTotal": 1
}
}
The body carries no file name, no client or campaign name, no detail of the checks: read them with your key, with Read a file. campaignRef is in it as the API keeps it, folded to lower case: put nothing in it that a mistyped address must not receive. spec.changed names the rules by their key, those of Read a verdict; the verdicts you read afterwards carry the new version in catalogue.version.
Check the signature
Check the signature before believing a webhook. The ValidFile-Signature header is t=<seconds>,v1=<hex>, where v1 is the hex HMAC-SHA256 of <t>.<body> under your secret. Refuse a t more than 5 minutes old. For the 24 h after a New secret, the header carries two v1, the old one and the new: accept if either is good.
import { createHmac, timingSafeEqual } from 'node:crypto';
// `secrets`: your active secrets, two during a rotation. `rawBody`: the bytes received.
export function isFromValidFile(rawBody, header, secrets, now = Date.now()) {
let t = null;
const v1 = [];
for (const part of String(header ?? '').split(',')) {
const [k, v = ''] = part.split('=').map((s) => s.trim());
if (k === 't') t = v;
else if (k === 'v1') v1.push(v);
}
if (!/^\d+$/.test(t ?? '') || !v1.length) return false;
if (Math.abs(now / 1000 - Number(t)) > 300) return false;
return secrets.some((secret) => {
const expected = createHmac('sha256', secret).update(`${t}.`).update(rawBody).digest();
return v1.some((sig) => /^[0-9a-f]{64}$/.test(sig) && timingSafeEqual(Buffer.from(sig, 'hex'), expected));
});
}
Give it the body as received, in bytes, never JSON parsed and written again, whose signature would no longer hold: express.raw({ type: 'application/json' }) with Express, request.get_data() with Flask, file_get_contents('php://input') in PHP.
Answering, and what follows a failure
- Answer
2xxwithin 10 seconds, then do the work. Any other answer is a failure; a redirect is not followed. - At least once. After a failure, ValidFile tries again for 24 h, at fixed times after the first try: 1 min, 5 min, 30 min, 2 h, 6 h, 12 h and 24 h. The same
idcan therefore arrive twice: ignore one you have already handled. - No order guaranteed between two events: read again rather than rely on the order of arrival.
- After 24 h, the send is abandoned and listed for 30 days in Your agency › API, with Send again. After 3 days of failures, the address is paused until Resume, and what happens during the pause is not sent to it: your script reads it with its key.
- Zapier, Make and n8n take these webhooks, and call the API with their HTTP module.