Features
How to Set Up
Set Up Your Endpoint
Create an HTTP endpoint on your server to receive webhook payloads.
Add Webhook URL
In TownHall form settings, add your endpoint URL to the webhooks section.
Verify Signatures
Implement signature verification to ensure webhooks are from TownHall.
Handle the Payload
Process the JSON payload and perform your custom logic.
Code Example
// 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
Related Integrations
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