Blog

How to send HTML form submissions to a webhook

Forward HTML form submissions as JSON with SiteBackend webhooks. Configure an HTTPS receiver, inspect the payload, verify signatures and handle retries.

Yash··3 min readTutorialsContact FormsWebhooks

To send HTML form submissions to a webhook, post your form to SiteBackend and configure a Webhook notification channel with your receiver's HTTPS URL. SiteBackend stores the submission, then forwards an event as JSON. Your receiver can use that event to start a workflow or update another system.

There are two requests: the visitor's browser submits to SiteBackend, and SiteBackend sends the notification to your receiver. The receiver must accept SiteBackend's payload format; a third-party URL expecting a different JSON structure needs an adapter.

1. Connect your HTML form

Create an account, add a site, and create a New form. Copy its endpoint and replace the example URL below.

contact.html
<form action="https://api.sitebackend.com/forms/YOUR_FORM_ID" method="POST">
  <label>
    Name
    <input type="text" name="name" autocomplete="name" required />
  </label>
  <label>
    Email
    <input type="email" name="email" autocomplete="email" required />
  </label>
  <label>
    Message
    <textarea name="message" rows="6" required></textarea>
  </label>
  <input type="text" name="_gotcha" tabindex="-1" autocomplete="off" style="display:none" />
  <button type="submit">Send message</button>
</form>

Keep every field's name and leave the hidden honeypot empty. The form works without JavaScript. See the static contact form walkthrough for publishing and domain settings.

2. Configure the outgoing webhook

Open Form → Notifications → Add channel and choose Webhook. Enter a publicly reachable HTTPS URL, select POST or PUT, and optionally enter a Signing secret. Save the channel and inspect the test request at your receiver.

The receiver should accept the selected method and JSON content. Localhost and private network addresses aren't production destinations, and redirects aren't followed. Use the final HTTPS URL directly.

Configure your receiver to acknowledge a test before saving the channel: saving triggers a sample submission event. Keep sample events separate from real work so testing doesn't create real customer records.

What does the JSON payload look like?

Here is an example with illustrative IDs:

submission-event.json
{
  "id": "delivery_example",
  "event": "SUBMISSION_CREATED",
  "createdAt": "2026-10-15T10:00:00.000Z",
  "data": {
    "event": "SUBMISSION_CREATED",
    "form": {
      "id": "form_example",
      "publicId": "YOUR_FORM_ID",
      "name": "Website contact"
    },
    "submission": {
      "id": "submission_example",
      "data": {
        "name": "Jane",
        "email": "[email protected]",
        "message": "I'd like to discuss a project."
      },
      "createdAt": "2026-10-15T10:00:00.000Z"
    }
  }
}

The outer id identifies the delivery. The visitor's fields are inside data.submission.data. Read them by field name rather than treating the whole event as a flat object.

Requests use Content-Type: application/json and include these headers:

HeaderPurpose
x-sitebackend-eventEvent type, such as SUBMISSION_CREATED.
x-sitebackend-deliveryDelivery ID, stable across retries of that delivery.
x-sitebackend-timestampUnix timestamp in seconds for the request.
x-sitebackend-signaturePresent when you configure a signing secret.

See the webhook reference for more detail.

How do I verify a signed request?

Set the same signing secret in the notification channel and your receiver's server configuration. Keep it out of your public HTML.

Before accepting an event:

  1. Read the raw request body before JSON parsing changes it.
  2. Parse the signature header, which has the format t=<timestamp>,v1=<hex>.
  3. Reject missing or malformed signatures and timestamps outside your permitted window, for example five minutes.
  4. Compute HMAC-SHA256 using your signing secret over the timestamp, a period, and the raw body: <timestamp>.<rawBody>.
  5. Compare the computed digest to v1 using a constant-time comparison, checking equal byte lengths first.

Only parse and process the event after verification. See signature verification for a Node.js example.

How should my receiver handle retries?

Return a 2xx response after the event has been processed or safely recorded for processing. SiteBackend treats non-2xx responses as delivery failures; retryable failures are retried automatically. Requests time out after ten seconds, so queue slow work durably before acknowledging it.

Use x-sitebackend-delivery or the outer payload id to prevent a retry from doing the same work twice. Store that ID with the work it triggers, using an atomic operation or a unique constraint so simultaneous requests can't both perform it. Acknowledge an already processed delivery without repeating its side effects.

Don't assume the timestamp or signature stays the same on a retry. The delivery ID is the value to use for deduplication.

3. Test the whole flow

Publish the form and submit a distinctive message. Confirm that it appears in the SiteBackend inbox, that your receiver accepts the JSON, and that the intended workflow completes once.

The Notifications delivery log shows status and the last error. A successful delivery confirms the receiver accepted the request; check your own system to confirm any later processing completed.

Spam submissions don't trigger webhook notifications. Free-plan submissions beyond the monthly limit are saved but hidden and don't notify. See plans and limits.

For chat destinations, use the dedicated Telegram or Discord channel instead of expecting the generic webhook payload to match those APIs.