Learn · Webhooks
How to Test a Form Webhook End to End
Written by Elis Hedman, Founder, Formward. Last reviewed
A form webhook has two hops: the visitor's browser posts to the form backend, and the backend posts JSON to your receiver. A hand-made request to the receiver proves your code; only a real submission proves the whole path. This guide does both, in that order and with synthetic data: a local receiver and a signed test delivery you can run in a minute, then a submission through Formward, then what to look at when a delivery is missing.
Use made-up values throughout. A public webhook inspector is a third party that stores whatever it receives, so never point a form with real submissions at one.
A local receiver that verifies the signature
The receiver below is Node.js with no dependencies. It reads the raw body, verifies the X-Formward-Signature header (a timestamp t and v1, the hex HMAC-SHA256 of v1:<t>:<raw body>), rejects anything older than five minutes, and remembers each submissionId so that a repeated delivery is acknowledged but not processed twice.
js
import { createServer } from "node:http";
import { createHmac, timingSafeEqual } from "node:crypto";
const SECRET = process.env.WEBHOOK_SECRET; // the signing secret set on the webhook
const seen = new Set(); // a database table in production
function verify(rawBody, header, toleranceSec = 300) {
const m = /^t=(\d+),v1=([0-9a-f]+)$/.exec(header || "");
if (!m) return false;
if (Math.abs(Date.now() / 1000 - Number(m[1])) > toleranceSec) return false;
const expected = createHmac("sha256", SECRET).update("v1:" + m[1] + ":" + rawBody).digest();
const given = Buffer.from(m[2], "hex");
return given.length === expected.length && timingSafeEqual(given, expected);
}
createServer(async (req, res) => {
let rawBody = "";
for await (const chunk of req) rawBody += chunk;
if (!verify(rawBody, req.headers["x-formward-signature"])) {
console.log("401 bad signature");
return res.writeHead(401).end();
}
const delivery = JSON.parse(rawBody);
const duplicate = seen.has(delivery.submissionId);
seen.add(delivery.submissionId);
console.log(duplicate ? "200 duplicate, skipped" : "200 new", delivery.submissionId, Object.keys(delivery.fields));
res.writeHead(200).end();
}).listen(8788, "127.0.0.1");Three details carry the weight. Verify against the bytes you received, before JSON.parse: parsing and serialising again changes the bytes, and the signature stops matching. Compare with timingSafeEqual, not ===. And answer 2xx as soon as the delivery is verified and recorded, then do slow work afterwards. Start it with WEBHOOK_SECRET=local-test-secret node receiver.mjs.
Send a synthetic delivery and read the result
This script builds a delivery in the shape of Formward's generic webhook, signs it with the same secret and posts it five times: once valid, once repeated, once with the body changed after signing, once with a stale timestamp and once unsigned. Run it in a second terminal with the same WEBHOOK_SECRET.
js
import { createHmac } from "node:crypto";
const SECRET = process.env.WEBHOOK_SECRET;
const body = JSON.stringify({
event: "submission.accepted",
formId: "00000000-0000-4000-8000-000000000001",
formName: "Contact form",
submissionId: "00000000-0000-4000-8000-000000000002",
createdAt: new Date().toISOString(),
status: "processed",
fields: { email: "test@example.com", message: "Synthetic test submission" },
ai: { spamScore: null, summary: null, leadScore: null, routingCategory: null },
});
const sign = (t, payload) =>
"t=" + t + ",v1=" + createHmac("sha256", SECRET).update("v1:" + t + ":" + payload).digest("hex");
async function post(label, payload, signature) {
const res = await fetch("http://127.0.0.1:8788/", {
method: "POST",
headers: { "Content-Type": "application/json", "X-Formward-Signature": signature },
body: payload,
});
console.log(label, "->", res.status);
}
const now = Math.floor(Date.now() / 1000);
await post("valid delivery", body, sign(now, body));
await post("same delivery again", body, sign(now, body));
await post("body changed after signing", body.replace("Synthetic", "Tampered"), sign(now, body));
await post("timestamp 10 minutes old", body, sign(now - 600, body));
await post("no signature header", body, "");What we ran and saw (13 November 2026, Node.js 22, both scripts exactly as printed): the script printed 200, 200, 401, 401, 401, and the receiver logged 200 new, 200 duplicate, skipped, then 401 bad signature three times. We also built a delivery with the payload builder in Formward's own code and posted it to this receiver; it verified and was logged as 200 new.
If the first line is not 200, the two processes do not share the secret. If the third line is 200, your receiver is not verifying the raw body.
Send a real submission through Formward
This part needs a receiver Formward can reach. Webhook URLs must be https and public; localhost or a private address is rejected when you save it and again at delivery. Deploy the receiver to a staging host you control and keep the secret in its environment. The steps below describe documented behaviour. We did not run them against the live service for this guide.
In the form's settings, add a Generic JSON webhook with the staging URL and a signing secret, then click Test. The test delivery is signed like a real one. Its submissionId starts with test- and its fields are _test: true and the message "This is a test delivery from Formward." It should show up in your receiver's log and in the form's delivery log.
Then send a submission the way a visitor's browser would, with synthetic values:
sh
curl -i https://forms.formward.eu/f/<FORM_ID> \
-H "Accept: application/json" \
-d "email=test@example.com" \
-d "message=Synthetic webhook test"Expected: the endpoint answers 200 with "ok": true, the submission appears in the dashboard, and once it is processed your receiver logs 200 new with the field names email and message. Internal fields that start with _ are left out of fields. If the form has an allowed-origins list, add -H "Origin: https://www.example.com" with an origin that is on the list, or the endpoint answers 403.
Debug a missing or failed delivery
Start in the form's delivery log, which records every attempt with its response code. What you find there decides where to look next.
- No attempt in the log. Formward only delivers submissions that finish processing. A submission in the spam folder, one held because the notification address is not confirmed yet, a form that is switched off, or a plan without webhooks produces no delivery. Synthetic test data can look like spam, so check the spam folder first.
- A 401 from the receiver above. The signature did not verify: a different secret on the two sides, a body that was parsed before it was verified, or a server clock more than five minutes off.
- A 301, 302 or 308. Redirects are not followed. Use the final URL, including
httpsand any trailing slash your server insists on. - A timeout. The receiver has 10 seconds to answer. Acknowledge first and process in the background.
- The same
submissionIdtwice. Delivery is at-least-once: a failed attempt is retried with increasing delays, and a receiver that did the work but answered too late gets the delivery again. Deduplicate onsubmissionId, as the receiver above does. - It failed for good. Fix the receiver, then a workspace owner or admin can replay the delivery from the log. Formward will not replay a delivery that already succeeded.
How this works with Formward
Webhooks are on the Professional plan and above, and a form can have several, each with its own secret. The payload schema and the verification code in Node.js and Python are in the webhooks reference; adding one in the dashboard is covered on the webhooks integration page.
A real delivery also carries X-Formward-Signature-Legacy, a bare HMAC of the body kept for older verifiers, and its JSON starts with "event": "submission.accepted". Verify the v1 value in X-Formward-Signature: only that scheme is protected against replay.
Sources
Point a form at an EU endpoint
Formward receives the POST, filters spam and stores submissions in Sweden. No server to run.