Webhooks
Send form data to external services when forms are submitted. Integrate with any system that can receive HTTP requests.
What Are Webhooks?โ
Webhooks send an HTTP POST request to a URL you specify when a form is submitted. This allows you to:
- Integrate with third-party services
- Trigger automated workflows
- Sync data to other systems
- Send notifications
- Process submissions externally
Configurationโ
Webhook URLโ
The endpoint that will receive form data:
https://your-service.com/webhook/form-submission
HTTP Methodโ
Choose the HTTP method:
- POST (recommended)
- PUT
- PATCH
Authenticationโ
Secure your webhook endpoint:
API Keyโ
Include API key in headers:
Authorization: Bearer your-api-key
Basic Authโ
Username and password:
Authorization: Basic base64(username:password)
Custom Headersโ
Add any custom headers:
X-Custom-Header: value
X-API-Version: 1.0
Payload Formatโ
Default Payloadโ
Standard submission data:
{
"formId": "abc123",
"formName": "Contact Form",
"responseId": "resp_xyz789",
"submittedAt": "2024-01-15T10:30:00Z",
"data": {
"name": "John Doe",
"email": "john@example.com",
"message": "Hello world"
}
}
Custom Payloadโ
Configure custom payload structure:
{
"customer_name": "{{name}}",
"customer_email": "{{email}}",
"inquiry": "{{message}}",
"source": "website_form",
"timestamp": "{{submittedAt}}"
}
Include Metadataโ
Optionally include:
- IP address
- User agent
- Referrer URL
- Form version
- Submission duration
When Webhooks Fireโ
On Submissionโ
Default trigger when form is submitted:
- After validation passes
- After data saved to MongoDB
- Before success message shown
On Specific Statusโ
Trigger on status changes:
- New submission
- Updated submission
- Deleted submission
Conditional Webhooksโ
Fire based on conditions:
Trigger when: accountType == "business"
Testing Webhooksโ
Test Modeโ
Send test payloads:
- Click Send Test
- Review payload
- Check response
- Verify endpoint received data
Webhook Logsโ
View webhook history:
- Request sent
- Response received
- Status code
- Response time
- Errors
Debug Modeโ
Enable detailed logging:
- Full request body
- Response body
- Headers sent/received
- Timing information
Error Handlingโ
Retry Policyโ
Automatic retries on failure:
- 3 retries by default
- Exponential backoff
- 1 min, 5 min, 15 min intervals
Failure Notificationsโ
Get notified on webhook failures:
- Email notification
- Dashboard alert
- Slack notification (if configured)
Manual Retryโ
Retry failed webhooks manually:
- Go to webhook logs
- Find failed request
- Click Retry
Response Handlingโ
Success Responseโ
Webhook expects 2xx status:
- 200 OK
- 201 Created
- 202 Accepted
Failure Responseโ
Non-2xx triggers retry:
- 4xx - Client error (won't retry)
- 5xx - Server error (will retry)
- Timeout - Will retry
Response Dataโ
Optionally store response:
- Log response body
- Use in subsequent actions
- Display to user
Example Integrationsโ
Slack Notificationโ
{
"text": "New form submission from {{name}}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*New Contact Form Submission*\nโข Name: {{name}}\nโข Email: {{email}}\nโข Message: {{message}}"
}
}
]
}
Zapierโ
Send to Zapier webhook:
- Create Zap with webhook trigger
- Copy webhook URL
- Paste in NetPad webhook config
- Connect to any Zapier action
Make (Integromat)โ
Connect to Make scenarios:
- Create scenario with webhook
- Copy webhook URL
- Configure in NetPad
- Build automation
CRM Integrationโ
Send leads to CRM:
{
"contact": {
"firstName": "{{firstName}}",
"lastName": "{{lastName}}",
"email": "{{email}}",
"phone": "{{phone}}",
"source": "Website Form"
}
}
Store webhook URLs securely. Never expose them in client-side code. Use environment variables for sensitive endpoints.
Best Practicesโ
- Secure endpoints - Use HTTPS and authentication
- Handle failures gracefully - Implement retry logic
- Validate payloads - Verify data on receiving end
- Monitor webhooks - Track success/failure rates
- Set timeouts - Don't wait forever for responses
Webhook Securityโ
Signature Verificationโ
Verify webhook authenticity:
const signature = req.headers['x-webhook-signature'];
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(JSON.stringify(req.body))
.digest('hex');
if (signature !== expectedSignature) {
return res.status(401).send('Invalid signature');
}
IP Whitelistingโ
Restrict to NetPad IPs if supported by your endpoint.
Next Stepsโ
- Email Notifications - Send emails on submission
- Form Publishing - Publish forms
- API Reference - Webhook API documentation