Docs

Authentication

How to authenticate with the RetainQ REST API.

API Keys

All REST API requests require a Bearer token. Generate API keys from Settings → API Keys in your dashboard.

Authorization: Bearer rq_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Key Format

API keys use the format rq_live_ followed by 32 random characters. Example:

rq_live_a7k2m9x4p8q1w6e3r5t0y7u2i9o4p1a

Security

  • Keys are hashed (SHA-256) before storage — we never store the raw key
  • The raw key is shown only once at creation time
  • Each key is scoped to a single workspace
  • Revoked keys are immediately invalid
  • Keys grant full read/write access to your workspace

Managing Keys

ActionHow
CreateDashboard → Settings → API Keys → Create
ListGET /api/v1/keys (authenticated session)
RevokeDashboard or DELETE /api/v1/keys?id=xxx

Example Request

curl https://app.retainq.com/api/v1/public/analytics \
  -H "Authorization: Bearer rq_live_your_key_here"

# Response:
{
  "total_sessions": 40,
  "retention_opportunities": 18,
  "retention_rate_percent": 45.0,
  "revenue_saved": 588,
  "active_flows": 2,
  "total_customers": 20
}

Errors

If the key is invalid or missing:

HTTP 401
{
  "error": "Invalid or missing API key. Use: Authorization: Bearer rq_live_..."
}