Skip to main content
GET
/
v0
/
lifecycle
Get user lifecycle stages (New / Returning / Power user / Resurrected / At Risk / Churned)
curl --request GET \
  --url https://api.formo.so/v0/lifecycle \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.formo.so/v0/lifecycle"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.formo.so/v0/lifecycle', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.formo.so/v0/lifecycle",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.formo.so/v0/lifecycle"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.formo.so/v0/lifecycle")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.formo.so/v0/lifecycle")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "meta": [
    {
      "name": "project_id",
      "type": "String"
    },
    {
      "name": "user_type",
      "type": "String"
    },
    {
      "name": "user_count",
      "type": "UInt64"
    }
  ],
  "data": [
    {
      "project_id": "proj_abc",
      "user_type": "New",
      "user_count": 184
    },
    {
      "project_id": "proj_abc",
      "user_type": "Returning",
      "user_count": 62
    },
    {
      "project_id": "proj_abc",
      "user_type": "Power user",
      "user_count": 23
    },
    {
      "project_id": "proj_abc",
      "user_type": "Resurrected",
      "user_count": 11
    },
    {
      "project_id": "proj_abc",
      "user_type": "At Risk",
      "user_count": 14
    },
    {
      "project_id": "proj_abc",
      "user_type": "Churned",
      "user_count": 142
    }
  ],
  "rows": 6,
  "rows_before_limit_at_least": 6
}
{
"error": {
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": {}
}
}
{
"error": {
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": {}
}
}

Authorizations

Authorization
string
header
required

Workspace API key (e.g. formo_xxx). Create one in the Formo dashboard under Team Settings > API Keys.

Query Parameters

date_from
string<date>

Inclusive start date (YYYY-MM-DD). Defaults to 7 days before date_to.

date_to
string<date>

Inclusive end date (YYYY-MM-DD). Defaults to today.

lifecycle_filter
enum<string>

Restrict results to a single lifecycle stage.

Available options:
New,
Returning,
Power user,
Resurrected,
At Risk,
Churned
include_previous_period
boolean

When true, returns both current and previous period metrics for week-over-week comparison. The previous period is non-overlapping and equal in length to the current range.

new_window_days
integer

Override: a wallet is New if first seen within this many days of the reference date (default 30). Caller value wins over the project's saved setting.

Required range: 1 <= x <= 90
churn_window_days
integer

Override: a wallet is Churned once last seen this many days before the reference date (default 30).

Required range: 1 <= x <= 90
power_user_min_active_days
integer

Override: distinct active days within the power-user window required to qualify as Power user (default 5).

Required range: 1 <= x <= 90
power_user_window_days
integer

Override: trailing window in which active days are counted for Power user qualification (default 30).

Required range: 1 <= x <= 90
resurrected_gap_days
integer

Override: minimum inactivity gap that marks a re-engaging wallet as Resurrected (default 30).

Required range: 1 <= x <= 90
at_risk_min_days_inactive
integer

Override: minimum days since last activity for an established, still-active wallet to be At Risk (default 14; must be < churn_window_days).

Required range: 1 <= x <= 90
at_risk_prior_active_days_threshold
integer

Override: minimum active days a wallet had in the window before the recent quiet stretch to qualify as At Risk (default 1).

Required range: 1 <= x <= 90

Response

Lifecycle counts

Analytics endpoint response. The data array contains the rows; the exact row shape depends on the endpoint. meta carries column type information for rendering, rows is the row count, and statistics holds query timing metadata.

data
object[]
meta
object[]
rows
integer
rows_before_limit_at_least
integer
statistics
object