Skip to main content
Webhooks allow your application to receive real-time notifications when specific events occur in FunnelFox. Instead of polling for changes, webhooks push data to your endpoint as events happen, enabling instant reactions to user actions, purchases, and subscription changes.

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-Key header matches your project’s secret key
3

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 funnel
  • onboarding.completed - User reaches finish screen
  • profile.updated - Email captured or updated

Payment Events

  • purchase.completed - User has completed a purchase or when recurrent/upsell purchase happen

Subscription Events

  • subscription.created - New subscription
  • subscription.trialing - Trial period started
  • subscription.active - Subscription activated
  • subscription.cycle - Renewal processed
  • subscription.paused - Billing paused
  • subscription.resumed - Billing resumed
  • subscription.cancelled - Subscription cancelled
  • subscription.auto_renew_off - Auto-renewal turned off
  • subscription.unpaid - Payment failed
Use subscription. webhooks to grant new customers subscription access.
Go to the Events Reference for complete payload schemas.

Security & Verification

Every webhook request includes a Fox-Secret-Key header containing your project’s secret key. Always verify this header to ensure requests are from FunnelFox.
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

Matching User Profiles

Webhook events carry the same profile and session identifiers that your funnel exposes as funnel variables. Match them to tie an event back to a specific visitor or visit you saw in the funnel.
Webhook fields and funnel variables return the same identifier in different forms. Webhook payloads prefix the value (profile.id is pro_..., session_id is ses_...), while funnel variables return the bare value with no prefix. A direct string comparison fails silently — no error is raised, the IDs simply never match.
To match reliably, normalize one side before you compare. Strip the prefix from the webhook value, or add it to the value you stored from the funnel:
When you look a profile or session up with the FunnelFox API, you can pass the ID with or without the prefix (the API accepts both forms).

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 event id 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:
This results in approximately:
  • 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:

Subscription Access via Webhooks

You can grant new customers subscription access using subscription. webhooks such as subscription.trialing or subscription.active. These webhooks are optimized for reliability and have the lowest delivery delay, making them ideal for managing subscription access in real time.
Avoid using purchase.completed for this purpose. It’s optimized for tracking purchases rather than managing subscription states.

Troubleshooting

  • Verify your endpoint URL is publicly accessible (not localhost)
  • Check the Fox-Secret-Key header is being validated correctly
  • Ensure your server responds within 10 seconds
  • Confirm webhooks are configured in Project Settings
This is expected behavior due to retry logic. Implement idempotency using the event id field to handle duplicates gracefully.
Network delays and retries can cause events to arrive out of sequence. Use the created_at timestamp to determine actual event order.
Some fields are only present for specific event types. Check the Events Reference for complete schemas. The data field varies per event.
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