How Webhooks Work
When an event occurs in your funnel, FunnelFox sends an HTTP POST request to your configured endpoint with a JSON payload containing event details.Quick Start
1
Configure Endpoint
Add your webhook URL in Project Settings:
- Production URL: For live events
- Sandbox URL: For test events (optional)
2
Verify Requests
Validate the
Fox-Secret
header matches your project’s secret key3
Handle Events
Process the JSON payload and respond with 2xx status within 10 seconds
4
Implement Retries
Handle potential duplicate events and implement idempotency
Event Types
FunnelFox sends webhooks for these events:Funnel Events
onboarding.started
- User begins funnelonboarding.completed
- User reaches finish screenprofile.updated
- Email captured or updated
Payment Events
purchase.completed
- One-time payment successsubscription.created
- New subscriptionsubscription.active
- Subscription activatedsubscription.cycle
- Renewal processed
Security & Verification
Every webhook request includes aFox-Secret
header containing your project’s
secret key. Always verify this header to ensure requests are from FunnelFox.
Security: Never expose your Fox-Secret key in client-side code or public
repositories. Store it securely in environment variables.
Payload Structure
All webhook events follow this base structure:Key Fields
Field | Type | Description |
---|---|---|
id | string | Unique event identifier |
type | string | Event type (e.g., “purchase.completed”) |
created_at | integer | Unix timestamp in seconds |
is_sandbox | boolean | Whether this is a test event |
location | object | Funnel and experiment context |
profile | object | User information and geo data |
data | object | Event-specific payload |
Handling Webhooks
Response Requirements
Your endpoint must:- Return a 2xx status code (200-299)
- Respond within 10 seconds
- Accept
application/json
content type
Idempotency
Events may be delivered multiple times. Use the eventid
to ensure
idempotent processing:
Retry Logic
FunnelFox implements exponential backoff with up to 30 retry attempts for failed webhook deliveries.Retry Schedule
The delay between retries follows this formula:- Attempt 1: ~15-45 seconds
- Attempt 2: ~30-90 seconds
- Attempt 3: ~1-3 minutes
- Attempt 10: ~3-5 hours
- Attempt 30: ~10-12 days
Failed webhooks are retried for up to 2 weeks. Ensure your endpoint can
handle events that arrive significantly after they occurred.
Testing Webhooks
Local Development
Use tools like ngrok to expose your local server:Webhook Testing Tools
Popular webhook testing services:- Webhook.site - Instant test endpoints
- RequestBin - Inspect webhook payloads
- Hookdeck - Development webhook infrastructure
Debugging Tips
- Log everything initially: Record full payloads to understand data
- Use sandbox mode: Test with sandbox funnels to avoid real charges
- Implement graceful failures: Queue events for retry if processing fails
- Monitor endpoint health: Track response times and error rates
Common Use Cases
CRM Integration
Sync funnel completions to your CRM:Email Automation
Trigger email sequences based on user actions:Analytics Tracking
Send events to your analytics platform:Subscription Management
Keep subscription states synchronized:Best Practices
Process Asynchronously
Queue events for processing instead of handling synchronously. This ensures
fast responses and prevents timeouts.
Implement Monitoring
Track webhook processing metrics: success rates, processing time, and
queue depth to catch issues early.
Handle Failures Gracefully
Implement circuit breakers and fallback mechanisms. Don’t let webhook
failures break critical flows.
Store Raw Events
Archive raw webhook payloads for debugging, replay capabilities, and
audit trails.
Troubleshooting
Webhooks not being received
Webhooks not being received
- Verify your endpoint URL is publicly accessible (not localhost)
- Check the Fox-Secret header is being validated correctly
- Ensure your server responds within 10 seconds
- Confirm webhooks are configured in Project Settings
Receiving duplicate events
Receiving duplicate events
This is expected behavior due to retry logic. Implement idempotency using
the event
id
field to handle duplicates gracefully.Events arriving out of order
Events arriving out of order
Network delays and retries can cause events to arrive out of sequence.
Use the
created_at
timestamp to determine actual event order.Missing data in payload
Missing data in payload
Some fields are only present for specific event types. Check the
Events Reference for complete schemas. The
data
field varies per event.Sandbox vs Production events
Sandbox vs Production events
Check the
is_sandbox
field to differentiate test events. Configure
separate webhook URLs for sandbox and production in Project Settings.Rate Limits
FunnelFox doesn’t impose rate limits on webhook deliveries. However:- Events are sent as they occur (no batching)
- High-volume funnels may generate many simultaneous requests
- Ensure your endpoint can handle your expected traffic
Next Steps
- Events Reference - Detailed event schemas
- Project Settings - Configure webhook endpoints
- API Reference - REST API documentation