Optimize Engine

Intelligence

The Optimize Engine applies machine learning to your app data to predict user behavior and automate decision-making. It calculates predictive lifetime value scores within hours of install, identifies users likely to churn before they leave, builds smart segments that update automatically, suggests optimal pricing, and provides a natural language copilot for ad-hoc analytics questions. The engine continuously retrains its models as new data flows in from the Measure Engine.

Key Features

Predictive LTV Scoring
ML models predict each user's lifetime value within the first 24 hours. Scores update daily as more behavioral data is collected, reaching 90%+ accuracy by day 7.
Churn Prediction
Identify at-risk users before they leave. The model analyzes engagement patterns, session frequency decay, and feature usage to assign a churn probability score.
Smart Segments
Auto-generated segments based on behavioral patterns, LTV tiers, and lifecycle stage. Segments update in real time and can trigger actions in the Build Engine.
Dynamic Pricing Suggestions
Get pricing recommendations based on willingness-to-pay modeling, competitor pricing, and regional purchasing power. Test suggestions with the Build Engine's experiment framework.
Natural Language Copilot
Ask questions about your app data in plain English. The copilot translates natural language into analytics queries and returns charts, tables, and actionable insights.
Anomaly Detection
Automatic alerts when metrics deviate from expected patterns. Detects revenue drops, unusual churn spikes, event volume anomalies, and conversion rate changes.

API Examples

All endpoints require an Authorization: Bearer YOUR_API_KEY header. The base URL for all requests is https://api-v2.appflow.ai.

GET/v1/ltv/predictions/user_123

Retrieve the predicted lifetime value for a specific user. Returns the predicted revenue at 30, 90, and 365-day horizons, confidence interval, model version, and the top contributing features.

cURL
curl -X GET "https://api-v2.appflow.ai/v1/ltv/predictions/user_123?app_id=app_xxx" \
  -H "Authorization: Bearer YOUR_API_KEY"
GET/v1/churn/predictions/user_123

Get the churn probability for a specific user. Returns a 0-1 probability score, risk tier (low, medium, high, critical), days until predicted churn, and the behavioral signals contributing to the score.

cURL
curl -X GET "https://api-v2.appflow.ai/v1/churn/predictions/user_123?app_id=app_xxx" \
  -H "Authorization: Bearer YOUR_API_KEY"
GET/v1/segments

List all user segments for an app, including both auto-generated smart segments and custom segments. Returns segment name, user count, criteria, and last refresh timestamp.

cURL
curl -X GET "https://api-v2.appflow.ai/v1/segments?app_id=app_xxx" \
  -H "Authorization: Bearer YOUR_API_KEY"
POST/v1/forecasts

Generate a forecast for a key metric over a specified time horizon. Supports MRR, DAU, revenue, and subscriptions. Returns predicted values with confidence bands.

cURL
curl -X POST "https://api-v2.appflow.ai/v1/forecasts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "app_id": "app_xxx",
    "metric": "mrr",
    "horizon_days": 90
  }'
POST/v1/pricing/copilot

Send a natural language query to the analytics copilot. The copilot interprets the question, runs the relevant analysis, and returns a structured response with data, charts, and a plain-English summary.

cURL
curl -X POST "https://api-v2.appflow.ai/v1/pricing/copilot" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "app_id": "app_xxx",
    "query": "Why did churn increase last week?"
  }'

Related Guides