Webhooks¶
Subscribe Flow supports bidirectional webhooks: incoming (from Resend and Stripe) and outgoing (to your systems). All outgoing webhooks are scoped to the organization associated with your API key.
Webhook Limits by Tier¶
| Tier | Webhook Limit |
|---|---|
| Free | 0 (not available) |
| Starter | 3 |
| Professional | Unlimited |
Free-tier organizations cannot create webhooks. Attempting to do so returns a 403 Forbidden with error code limit_exceeded.
Outgoing Webhooks¶
Receive notifications when events occur in Subscribe Flow.
Creating a Webhook¶
| Bash | |
|---|---|
The webhook is automatically associated with your organization.
Events¶
| Event | Description |
|---|---|
subscriber.created | New subscriber created |
subscriber.updated | Subscriber data changed |
subscriber.deleted | Subscriber deleted |
tag.subscribed | Subscriber subscribed to a tag |
tag.unsubscribed | Subscriber unsubscribed from a tag |
subscriber.note_added | Note added to subscriber |
Payload Format¶
| JSON | |
|---|---|
Signature Verification¶
Webhooks are signed with HMAC-SHA256:
Retry Policy¶
| Attempt | Wait Time |
|---|---|
| 1 | Immediately |
| 2 | 5 minutes |
| 3 | 30 minutes |
| 4 | 2 hours |
| 5 | 24 hours |
After 5 failed attempts, the webhook is deactivated.
Incoming Webhooks (Resend)¶
Subscribe Flow receives webhooks from Resend for email events.
Setup¶
-
Configure the webhook URL in Resend:
Text Only -
Enable events:
email.bouncedemail.complainedemail.delivered
Event Processing¶
sequenceDiagram
participant R as Resend
participant SF as Subscribe Flow
participant DB as Database
R->>SF: Webhook: email.bounced
SF->>SF: Verify signature
SF->>DB: Subscriber status -> bounced
SF->>SF: Trigger outgoing webhook
SF->>R: 200 OK Supported Resend Events¶
| Resend Event | Subscribe Flow Action |
|---|---|
email.bounced | Status -> bounced |
email.complained | Status -> complained |
email.delivered | Update statistics |
Incoming Webhooks (Stripe)¶
Subscribe Flow receives webhooks from Stripe for billing events. These are separate from the subscriber webhook system and are handled by the BillingService.
Setup¶
-
Configure the webhook URL in Stripe Dashboard:
Text Only -
Required events:
checkout.session.completedcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_failed
Supported Stripe Events¶
| Stripe Event | Subscribe Flow Action |
|---|---|
checkout.session.completed | Activate subscription, update org tier |
customer.subscription.updated | Sync tier and limits |
customer.subscription.deleted | Downgrade to free tier |
invoice.payment_failed | Notify admin, grace period |
Stripe vs. Subscriber Webhooks
Stripe webhooks are a system-level integration for billing and are not configurable per organization. Outgoing subscriber webhooks are organization-scoped and configurable via the API.
Webhook Management¶
Listing Webhooks¶
Returns only webhooks belonging to your organization.
Testing a Webhook¶
Webhook Logs¶
Response:
Deleting a Webhook¶
Best Practices¶
Idempotency¶
Process webhooks idempotently:
| Python | |
|---|---|
Asynchronous Processing¶
| Python | |
|---|---|
Error Handling¶
| Python | |
|---|---|
Troubleshooting¶
Webhook is not received
- Is the URL reachable from the internet?
- Is HTTPS configured?
- Check firewall rules
- Is the webhook active?
- Does your plan support webhooks? (Free tier cannot use webhooks)
Signature error
- Is the secret correct?
- Use the raw body for signature verification
- Check encoding (UTF-8)
High latency
- Process asynchronously
- Respond quickly (< 5s)
- Use a queue for long operations