Windback.
API Reference

API Reference

Complete Windback API reference.

API Reference

Base URL: https://api.windback.dev/api/v1

Authentication

Most endpoints require authentication. The API supports two methods:

  • JWT Bearer token: Authorization: Bearer <token> — obtained via login/register
  • API Secret Key: X-API-Key: sk_... — obtained from dashboard settings

Dashboard endpoints accept either method (Dual Auth). Widget and webhook endpoints use public API keys or no auth.

Endpoints

MethodPathAuthDescription
POST/auth/registerNoneCreate a new account (email + password)
POST/auth/loginNoneLog in with email + password
GET/auth/meJWT / SecretGet current user info
PUT/auth/allowed-originsJWT / SecretUpdate allowed origins
GET/statsJWT / SecretGet churn statistics
POST/churn-eventsJWT / SecretCreate a churn event
GET/churn-eventsJWT / SecretList churn events
GET/churn-events/:idJWT / SecretGet a specific event
POST/churn-events/:id/generateJWT / SecretGenerate recovery variants
POST/churn-events/:id/variants/:vid/sendJWT / SecretSend a recovery email
POST/churn-events/:id/recoveredJWT / SecretMark event as recovered
POST/cancel-flow/submitPublicSubmit cancellation reason
POST/webhooks/:provider/:keyNoneReceive payment webhooks

Response Format

Successful responses return JSON. Errors return:

{
  "error": "Human-readable error message"
}

Pagination

List endpoints support pagination via query parameters:

  • limit — Number of items (default: 20, max: 100)
  • offset — Number of items to skip (default: 0)
  • status — Filter by status (optional)

Response includes total count:

{
  "data": [...],
  "total": 42,
  "limit": 20,
  "offset": 0
}