Docs

API Reference

The RetainQ API lets you programmatically interact with your retention flows, sessions, and data.

Base URL

https://app.retainq.com/api/v1

Authentication

The runtime API endpoints (session init, step, complete) are public — they're designed to be called from your website's frontend via the widget. No authentication is required for these endpoints.

Dashboard API endpoints (intelligence, flows management) require an authenticated session via Supabase Auth cookies. These are used internally by the dashboard and are not intended for external consumption in V1.

Endpoints

Runtime (Public — called by widget)

MethodEndpointDescription
POST/api/v1/runtime/session/initStart a new flow session
POST/api/v1/runtime/session/stepSubmit answer, get next node
POST/api/v1/runtime/session/completeEnd session with outcome

Intelligence (Authenticated)

MethodEndpointDescription
POST/api/v1/intelligence/analyzeRun AI churn analysis
POST/api/v1/intelligence/askAsk AI a question

Rate Limits

  • Runtime endpoints: 100 sessions per workspace (free tier)
  • Intelligence endpoints: 10 requests per minute per workspace

Error Format

All errors return JSON with an error field:

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

Webhook Events

RetainQ can send HTTP POST webhooks to your server when events occur. See the Webhooks documentation for details.