Sign inGet Started

TownHall Webhooks API

Send form submissions to any URL. Build custom integrations, trigger serverless functions, or connect to your own backend.

Get Started FreeIntegration Docs

Free tier available · No credit card required · View docs

Features

Send to any HTTP endpoint
Cryptographic signature verification
Retry on failure (3 attempts)
Custom headers support
JSON payload format
Metadata included

How to Set Up

1

Set Up Your Endpoint

Create an HTTP endpoint on your server to receive webhook payloads.

2

Add Webhook URL

In TownHall form settings, add your endpoint URL to the webhooks section.

3

Verify Signatures

Implement signature verification to ensure webhooks are from TownHall.

4

Handle the Payload

Process the JSON payload and perform your custom logic.

Code Example

JavaScript
// Webhook signature verification (Node.js)
const crypto = require('crypto');

function verifyWebhook(payload, signature, secret) {
  const expectedSignature = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');
  
  return signature === `sha256=${expectedSignature}`;
}

// Express webhook handler
app.post('/webhook', (req, res) => {
  const signature = req.headers['x-townhall-signature'];
  const payload = JSON.stringify(req.body);
  
  if (!verifyWebhook(payload, signature, process.env.WEBHOOK_SECRET)) {
    return res.status(401).send('Invalid signature');
  }
  
  // Process the submission
  const { form, submission } = req.body;
  console.log('New submission:', submission.data);
  
  res.status(200).send('OK');
});

Use Cases

Custom backend processing
Serverless function triggers
Database updates
Third-party API calls
Custom notification systems

Frequently asked questions

Common questions about integrating TownHall with Custom Webhooks.

Connecting TownHall to Custom Webhooks is straightforward. Create an HTTP endpoint on your server to receive webhook payloads. The integration typically takes less than 10 minutes to set up.

Yes! TownHall webhooks and integrations work on all plans, including the free tier. You can connect Custom Webhooks to your forms without upgrading to a paid plan.

TownHall sends all form submission data to Custom Webhooks, including all form fields, submission metadata (timestamp, IP address), and form information. You can customize the payload format if needed.

Absolutely! You can connect multiple integrations to a single form. For example, you can send submissions to both Custom Webhooks and Slack simultaneously. There's no limit on the number of integrations per form.

TownHall automatically retries failed webhook deliveries up to 3 times with exponential backoff. If all retries fail, you'll receive an error notification, and the submission will still be stored in your TownHall dashboard.

Most integrations require minimal technical knowledge. Custom Webhooks integration typically involves copying a webhook URL and pasting it into your TownHall form settings. Our documentation provides step-by-step instructions.

Start collecting data in minutes

No backend code required. Just paste a URL and you're live.

No credit card required • Free tier forever