Windback.
API Reference

Recovery

API reference for recovery email generation and sending.

Recovery API

Generate and send AI-powered recovery emails.

Generate Recovery Variants

POST /api/v1/churn-events/:id/generate

Auth: JWT Bearer or Secret API Key

Generates 9 recovery email variants using different strategies. The AI analyzes the customer's context (plan, tenure, cancel reason) to personalize each email.

Variants can only be generated for events in new or processing status. If the event has already progressed past this stage, you'll receive a 400 Bad Request.

Response:

{
  "variants": [
    {
      "id": "uuid",
      "churn_event_id": "uuid",
      "strategy": "discount",
      "subject": "We'd love to have you back — here's 30% off",
      "body": "Hi John, ...",
      "coupon_code": "COMEBACK30",
      "coupon_percent": 30,
      "created_at": "2025-01-15T10:35:00Z"
    }
  ]
}

Recovery Strategies

Each variant uses a different persuasion strategy. When a cancellation reason is provided, the AI auto-maps it to the best matching strategy:

StrategyCancel Reason MatchDescription
discounttoo_expensiveOffers a percentage discount
unused_featuremissing_featuresHighlights features they haven't tried
value_recapnot_using_enoughReminds the customer of value they've received
social_proofswitching_competitorShows how similar customers benefit
pain_point_fixtechnical_issuesAddresses their specific issue
founder_emailpoor_supportPersonal message from the founder
pause_optiondont_need_anymoreOffers to pause instead of cancel
feedback_requestother / fallbackAsks for feedback with incentive
downgrade_offerSuggests a lower-tier plan

If the cancel reason doesn't match any strategy, the system falls back to feedback_request.

Send a Variant

POST /api/v1/churn-events/:id/variants/:variant_id/send

Auth: JWT Bearer or Secret API Key

Sends the specified recovery email to the customer. Updates the event status to email_sent.

Error Cases

ScenarioStatusError
Event not in variants_generated or email_sent status400"variants must be generated before sending emails"
Customer email missing on the event400"customer email is missing on this churn event"
Variant already sent400"this variant has already been sent"
Email service not configured500"email service is not configured"
Variant ID not found404"variant not found"

Each variant can only be sent once. The sent_at timestamp is set on send and prevents re-sending the same variant. To send another email, choose a different variant.