Concepts
Key concepts for integrating with Retivo — lifecycle areas, scoring, test mode, RBAC, rate limits, opt-out, and dry-run
Lifecycle Areas
Retivo covers 5 lifecycle areas, each representing a type of intervention rather than a user's current stage. A single user can be targeted by playbooks from multiple areas simultaneously.
| Area | Purpose | Typical Stages |
|---|---|---|
| Onboarding | Guide new users to first value | new, onboarding |
| Churn Prevention | Catch disengagement early | active, at_risk, onboarding |
| Retention | Deepen engagement for active users | active |
| Upsell | Identify and nurture expansion opportunities | active |
| Win-back | Re-engage churned users at optimal timing | churned |
Lifecycle Areas vs. Lifecycle Stages
Lifecycle stages (new → onboarding → active → at_risk → churned → recovered) describe where a user IS in their journey. Lifecycle areas describe what KIND of intervention to apply. These are orthogonal — an active user can be targeted by retention AND upsell playbooks simultaneously.
Scoring Dimensions
Retivo computes three scores for each user:
| Score | Range | Description |
|---|---|---|
| Activation Score | 0-1 | How many onboarding milestones the user has completed |
| Engagement Score | 0-1 | Rolling 14-day engagement intensity — event frequency, feature breadth, recency, and retention milestone completion |
| Expansion Score | 0-1 | Upsell readiness — plan limit proximity, feature gate hits, and configured expansion signals |
These scores feed into playbook entry conditions. For example, a "Plan Limit Approaching" upsell playbook might require expansion_score >= 0.7 and engagement_score >= 0.6.
Win-back Timing
Churned users receive time-sequenced outreach at configurable intervals (default: 7, 30, 60 days after churn). Each interval uses a different playbook with escalating intensity:
- Early win-back (7-14 days) — Gentle re-engagement, remind of value
- Win-back offer (30-45 days) — Incentive or new feature highlights
- Last chance (60-75 days) — Final outreach with feedback request
Test Mode
API keys starting with rt_test_ activate test mode. Test mode is designed for development, staging, and CI — the full pipeline runs, but no messages are delivered to real users.
| Behavior | Live (rt_live_) | Test (rt_test_) |
|---|---|---|
| Events ingested | Yes | Yes |
| User state updated | Yes | Yes |
| Pipeline evaluation | Yes | Yes |
| Messages generated | Yes | Yes |
| Messages delivered | Yes | No |
| Appears in dashboard | Yes | Yes (test indicator) |
When to use test keys:
- Development — Track events without sending real emails
- CI/CD — Verify pipeline behavior in automated tests
- Staging — Run realistic load without impacting users
- Demos — Show the full flow without side effects
Both live and test keys are created in Settings → API Keys.
Roles & Permissions (RBAC)
Retivo uses role-based access control with three roles:
| Action | Admin | Editor | Viewer |
|---|---|---|---|
| View dashboard, customers, analytics | Yes | Yes | Yes |
| Approve/reject interventions | Yes | Yes | No |
| Create/edit playbooks | Yes | Yes | No |
| Batch pause/unpause users | Yes | Yes | No |
| Manage team members | Yes | No | No |
| Toggle kill switch / shadow mode | Yes | No | No |
| Manage billing | Yes | No | No |
| View audit logs | Yes | No | No |
| Manage API keys | Yes | No | No |
Invite team members via the API:
curl -X POST https://retivo.ai/api/team/invite \
-H "Authorization: Bearer rt_live_..." \
-H "Content-Type: application/json" \
-d '{ "email": "alice@example.com", "role": "editor" }'Invitations expire after 7 days.
Rate Limits
API requests are rate-limited per tenant based on your plan:
| Plan | Track Events | API Requests |
|---|---|---|
| Starter | 1,000/hr | 1,000/hr |
| Growth | 10,000/hr | 10,000/hr |
| Scale | 100,000/hr | 100,000/hr |
Every API response includes rate limit headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 847
X-RateLimit-Reset: 1743926400When you receive a 429 response, wait until X-RateLimit-Reset before retrying. Use exponential backoff for resilient integrations.
If you need higher limits, upgrade your plan via Settings → Billing or the billing API.
Opt-Out
Every email sent by Retivo includes an unsubscribe link. When a user opts out:
- Their
opted_outflag is set totrue - They are excluded from all future evaluation
- No further interventions are created for them
The opt-out is permanent per-tenant unless manually reversed.
Checking Opt-Out Status
curl https://retivo.ai/api/customers/user-123 \
-H "Authorization: Bearer rt_live_..."The opted_out field in the response indicates whether the user has opted out.
Pausing vs. Opt-Out
Opt-out is user-initiated and permanent — the user chose to stop receiving messages. Pausing (via PUT /api/users/pause) is team-initiated and temporary — you can unpause at any time. Use pause for account reviews, migrations, or temporary holds.
Dry-Run
The dry-run API lets you test evaluation without side effects — no intervention is created and no message is sent.
curl -X POST https://retivo.ai/api/interventions/dry-run \
-H "Authorization: Bearer rt_live_..." \
-H "Content-Type: application/json" \
-d '{ "user_id": "user-123" }'Response:
{
"decision": {
"action": "intervene",
"playbook_id": "pb_abc",
"channel": "email",
"confidence": 0.82,
"reasoning": "User hasn't completed onboarding in 5 days..."
}
}Use dry-run to:
- Validate playbook configurations before activating them
- Debug why a specific user is or isn't receiving interventions
- Preview AI reasoning before going live
- Automated testing — assert that your playbook rules trigger correctly for test scenarios