Skip to Content
Reference

Webhook payload

The request a webhook Destination receives for each Submission, its headers, how to verify the signature, and how retries and duplicates work.

A webhook Destination receives one POST request for each Submission that reaches the Form's Inbox. This page describes that request. To add a webhook, see Webhooks. For Delivery statuses, see Destinations and Deliveries.

The webhook URL must use HTTPS and point to a public host. Addresses on private or local networks are refused.

Headers

HeaderValue
content-typeapplication/json
user-agentInsaneForms-Webhook/1
x-insane-forms-deliveryThe Delivery id. It stays the same across retries.
x-insane-forms-timestampThe time of this attempt, in whole seconds since the Unix epoch.
x-insane-forms-signaturev1= followed by a hex HMAC-SHA256 signature. See Verify a webhook signature.

Body

The body is JSON. type is always submission.created.

{
  "type": "submission.created",
  "delivery": { "id": "<delivery-id>", "attempt": 1 },
  "workspace": { "id": "<workspace-id>", "slug": "<workspace-slug>" },
  "site": { "id": "<site-id>", "name": "Northwind Bakery" },
  "form": {
    "id": "<form-record-id>",
    "name": "Contact",
    "endpointUrl": "https://us.insaneforms.com/f/<form-id>"
  },
  "submission": {
    "id": "<submission-id>",
    "receivedAt": "2026-11-20T09:30:50.000Z",
    "url": "https://app.insaneforms.com/<workspace-slug>/sites/<site-id>/forms/<form-record-id>/inbox?s=<submission-id>",
    "fields": [
      { "name": "name", "value": "Ada Lovelace" },
      { "name": "email", "value": "ada@example.com" }
    ],
    "files": [
      {
        "fieldName": "resume",
        "fileName": "resume.pdf",
        "contentType": "application/pdf",
        "sizeBytes": 2457600,
        "url": "https://app.insaneforms.com/api/files/<file-id>"
      }
    ],
    "visitor": {
      "ip": "203.0.113.7",
      "userAgent": "Mozilla/5.0",
      "referrer": "https://example.com/contact"
    }
  }
}
FieldMeaning
delivery.idThe Delivery id, the same as the x-insane-forms-delivery header.
delivery.attemptThe attempt number, starting at 1.
workspace.id, workspace.slugThe Workspace.
site.id, site.nameThe Site.
form.id, form.nameThe Form. form.id is the Form's record id in the app. It is not the <form-id> in the form endpoint URL.
form.endpointUrlThe Form's address, https://us.insaneforms.com/f/<form-id>.
submission.idThe Submission.
submission.receivedAtWhen the Submission arrived, as an ISO 8601 UTC time.
submission.urlThe Submission in the Inbox, in the app. It opens for signed-in people with access to the Site.
submission.fieldsEvery field as { name, value }, in the order received. Values are always strings.
submission.filesEach File's field name, file name, content type, size in bytes and download URL. Empty when there are none.
submission.visitorThe Visitor's IP address, User-Agent header and Referer header. referrer is null when the header was missing.

A File url opens only for a signed-in person with access to the Site, and it always downloads. A script cannot fetch it with the webhook request alone.

Field values come from strangers. Treat them as untrusted text.

Verify a webhook signature

Each webhook has a signing secret that starts with whsec_. You can reveal and rotate it in the app. Verify every request before you act on it.

The signature is computed this way:

  1. Take the value of x-insane-forms-timestamp.
  2. Join it, a period and the raw request body: <timestamp>.<body>.
  3. Compute the HMAC-SHA256 of that string with the signing secret as the key.
  4. Write it as lowercase hex and prefix v1=.

Use the raw body exactly as received. If a framework parses the JSON first and you serialize it again, the bytes can differ and the check fails.

This Node.js receiver uses only built-in modules. It rejects a request whose timestamp is more than 5 minutes from now, which limits replays. Each retry is signed again with a fresh timestamp, so a retry is not rejected by this check.

import { createHmac, timingSafeEqual } from "node:crypto";
import { createServer } from "node:http";

const signingSecret = process.env.INSANE_FORMS_SIGNING_SECRET; // whsec_...
const toleranceSeconds = 300;

function isValid(rawBody, headers) {
  const timestamp = headers["x-insane-forms-timestamp"];
  const signature = headers["x-insane-forms-signature"];
  if (!timestamp || !signature) return false;

  const age = Math.abs(Date.now() / 1000 - Number(timestamp));
  if (!Number.isFinite(age) || age > toleranceSeconds) return false;

  const expected = `v1=${createHmac("sha256", signingSecret)
    .update(`${timestamp}.${rawBody}`)
    .digest("hex")}`;

  const a = Buffer.from(expected);
  const b = Buffer.from(signature);
  return a.length === b.length && timingSafeEqual(a, b);
}

createServer((req, res) => {
  const chunks = [];
  req.on("data", (chunk) => chunks.push(chunk));
  req.on("end", () => {
    const rawBody = Buffer.concat(chunks).toString("utf8");
    if (!isValid(rawBody, req.headers)) {
      res.writeHead(401).end();
      return;
    }
    const event = JSON.parse(rawBody);
    // Commit the work with a unique event.delivery.id in one transaction,
    // or use that id to deduplicate a durable queue job. Skip recorded ids.
    console.log(event.submission.id, event.submission.fields);
    res.writeHead(204).end();
  });
}).listen(3000);

Respond to a webhook

Answer within 10 seconds. Any status from 200 to 299 marks the Delivery as succeeded. Any other status, a timeout, a connection error, or a redirect marks the attempt as failed. Redirects are not followed.

Insane Forms stores the first 500 characters of your response body with the attempt.

Retries

The first attempt starts right after the Submission arrives. A failed attempt is retried on this schedule, counted from the failure of the previous attempt:

After attemptWait before the next
11 minute
25 minutes
315 minutes
41 hour
53 hours
66 hours
712 hours

After the eighth attempt fails, the Delivery is marked failed and is not retried. The whole schedule spans about 22 hours. A job runs every minute to pick up due retries, so an attempt can start up to about a minute after its time.

A Delivery also fails at once, with no more attempts, if the Form, Site or Workspace was deleted, the Submission is no longer in the Inbox, or the Destination was switched off before the attempt (for a Recipient, also if it stopped or was never confirmed).

You can send a Delivery again from the app or through the MCP. That resets its attempts to zero and sends it with the same Delivery id.

Duplicates

A Delivery can arrive more than once. If your server answers after the 10 second limit, the attempt counts as failed and the retry reaches you a second time. A re-sent Delivery repeats the same id. If an attempt is interrupted on the Insane Forms side, the Delivery is claimed again after 2 minutes. If that interrupted attempt was the eighth, the Delivery is marked failed instead.

Use x-insane-forms-delivery, or delivery.id in the body, as the key. Enforce a unique id and record it in the same transaction as the work. Skip the work if the id is already recorded. If you queue the work instead, use a durable queue that deduplicates by this id. The submission.id is the same for every Delivery of one Submission.

A Submission's content never changes after it arrives, so a repeat carries the same fields.

On this page