API & webhooks
Subscribe webhook
Get notified the instant a new subscriber lands.
Webhooks are configured per page from /dashboard/[pageId]/settings. Add an HTTPS endpoint URL and pick which events to subscribe to — subscriber.created, subscriber.confirmed, subscriber.referred, or all of them. Up to 5 endpoints per page.
Every event is delivered as a POST with a JSON body matching this shape: { id, type, created_at, data: { subscriber, page } }. The data.subscriber payload includes email, position, referral code, and metadata; data.page is the parent page resource.
Delivery is at-least-once. We retry failed deliveries (any non-2xx status) with exponential backoff for 24 hours: at 30s, 5m, 30m, 2h, 6h, then every 6h until success or timeout. Use the id field for idempotency — same event, same id, every time.
For a working consumer, look at the Stripe webhook handler at src/app/api/webhooks/stripe/route.ts — same shape, same parsing pattern, same STRIPE_WEBHOOK_SECRET env var pattern (substitute QUBED_WEBHOOK_SECRET).