API Reference
Webhooks
Receive real-time notifications when leads submit, conversions fire, or funnel events occur in Superfunnel.
Overview
Superfunnel can push events to your server in real time using webhooks. Configure a webhook endpoint in your account and Superfunnel will POST a JSON payload to your URL whenever a subscribed event occurs.
Supported events
| Event | Trigger |
|---|---|
lead.created | A new lead submits a Superfunnel form |
lead.updated | A lead's data is updated |
conversion.fired | A conversion event is reported |
funnel.completed | A user completes all steps in a funnel |
Payload format
{
"id": "evt_01HXQ...",
"type": "lead.created",
"created_at": "2024-01-15T14:30:00Z",
"data": {
"lead_id": "lead_abc123",
"funnel_id": "funnel_xyz",
"email": "user@example.com",
"name": "Jane Doe",
"custom_fields": {
"phone": "+1555555555"
}
}
}Security
All webhook requests include an X-Superfunnel-Signature header containing an HMAC-SHA256 signature of the raw request body using your webhook secret.
Verify the signature in your endpoint:
import crypto from 'crypto'
function verifyWebhook(payload: string, signature: string, secret: string): boolean {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex')
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
)
}Setup
- Go to Settings → Integrations → Webhooks in your Superfunnel account
- Click Add Endpoint
- Enter your HTTPS endpoint URL
- Select the events you want to receive
- Copy your webhook secret for signature verification
Superfunnel retries failed deliveries up to 5 times with exponential backoff.