Webhooks
Receive real-time notifications when events occur in Retake. Use webhooks to trigger your own logic, update analytics, or sync with other systems.
Delivery: All webhooks are delivered with automatic retry (3 attempts, exponential backoff) for reliability.
Setup
- 1
Go to Dashboard → Settings → API Keys
Find the webhook configuration section
- 2
Enter your webhook URL
e.g., https://yoursite.com/api/retake/webhook
- 3
Copy the webhook secret (optional but recommended)
Use this to verify incoming webhooks are from Retake
Webhook Events
| Event | Description | Data Fields |
|---|---|---|
intent.tracked | Recovery sequence started for an intent (confirms intent was queued) | intentId, userId, type, value, items |
intent.converted | User converted after receiving recovery sequence | intentId, transactionId, value, recoveredAt |
intent.expired | Intent expired without conversion (7 days default) | intentId, userId, value, expiredAt |
payment.recovered | Failed payment was successfully recovered | intentId, userId, value, recoveredAt |
trial.expired | Trial period ended without conversion | userId, email, expiredAt |
email.sent | Recovery email successfully sent | intentId, email, sentAt, templateId, step |
email.opened | User opened the recovery email | intentId, openedAt |
email.clicked | User clicked the recovery link in the email | intentId, clickedAt, userAgent |
email.unsubscribed | User unsubscribed from marketing emails | projectId, email, userId, reason, unsubscribedAt |
Example Payload
Handler Example
Here's a complete example of how to handle webhooks in Next.js:
Best Practices
Always verify signatures
Use the webhook secret to verify requests are from Retake.
Return 200 quickly
Process webhooks async. Return 200 immediately to avoid timeouts.
Handle duplicates
Webhooks may be retried. Use intentId as idempotency key.
Log everything
Log webhook payloads for debugging and audit trails.