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

EventTrigger
lead.createdA new lead submits a Superfunnel form
lead.updatedA lead's data is updated
conversion.firedA conversion event is reported
funnel.completedA 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

  1. Go to Settings → Integrations → Webhooks in your Superfunnel account
  2. Click Add Endpoint
  3. Enter your HTTPS endpoint URL
  4. Select the events you want to receive
  5. Copy your webhook secret for signature verification

Superfunnel retries failed deliveries up to 5 times with exponential backoff.