Skip to main content

Stats

Retrieve churn statistics and recovery metrics for a project.

Get Project Stats

GET /projects/:slug/stats

Example Request

curl https://api.windbackai.com/api/v1/projects/my-project/stats \
  -H "X-API-Key: sk_live_abc123..."

Example Response

{
  "data": {
    "total_events": 342,
    "recovered": 89,
    "lost": 198,
    "processing": 55,
    "recovery_rate": 31.0,
    "total_mrr_cents": 1520000,
    "recovered_mrr_cents": 471200
  }
}

Response Fields

total_events
integer
Total number of churn events created for this project across all time.
recovered
integer
Number of churn events where the customer reactivated or payment succeeded.
lost
integer
Number of churn events where the recovery window expired without reactivation.
processing
integer
Number of churn events currently being processed (status: new, processing, variants_generated, or email_sent).
recovery_rate
float
Percentage of resolved events that were recovered. Calculated as recovered / (recovered + lost) * 100. Returns 0 if no events have been resolved.
total_mrr_cents
integer
Total MRR at risk across all churn events, in cents. Sum of mrr from all events.
recovered_mrr_cents
integer
Total MRR recovered, in cents. Sum of mrr from recovered events.

Understanding the Metrics

The recovery rate only considers resolved events (recovered + lost). Events still in processing are excluded to avoid skewing the metric. A healthy recovery rate for SaaS companies is typically 10-30%.
MRR values are stored in cents to avoid floating-point issues. To display in dollars, divide by 100. Events without an mrr value are excluded from MRR calculations but still count toward event totals.
Processing events include all active states: new, processing, variants_generated, and email_sent. These are events that still have a chance of being recovered.
Use the stats endpoint to build custom dashboards or feed recovery metrics into your existing analytics tools.