Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Customers

Compare groups of customers

How a group of customers does against all customers, over some days: who pays, who began and got value, who came back after the first key action, how they answered the survey, and what their feedback is about. With segment, the group is a saved segment. With by, it also splits the customers into groups by a plan, a status, where they came from, or a trait, and ranks the groups by the survey. A share shows only with 5 customers or more behind it.

get/api/v1/customer-analysis

Authorization

HeaderAuthorization: Bearer <API key>
Or the headerX-API-Key: <API key>
API keyMake one in Troopy under Settings > API keys. It acts as you, in its workspace.

Other ways to call it

CLItroopy customers analysis
MCP tooltroopy_get_customer_analysis
Rate limit60 calls in 60 seconds, for each key

Query parameters

daysinteger

The days back from now: 30, 90, 180, 365

Default 90

segmentstring

A saved segment, to compare with all customers

bystring

What to split the customers by: plan, status, channel, source, country, or trait:<name> for a trait of identify

Response

200 · application/json
data*object
7 properties
days*integer
currency*string | null

The currency of the money here: the one that most customers pay in

segment*object | null
2 properties
id*string

A 24-character id

name*string
of*object | null

The customers of the segment. Null without a segment

12 properties
customers*integer

The customers in the group now

paying*integer

How many of them pay now

mrr*number

What they pay for a month now, in the units of the currency

atRisk*integer

How many of them are at risk now

newPaying*integer

Became a paying customer in the days

churned*integer

Left in the days

signups*integer

Began to use the product in the days

activated*integer

How many of those did a first key action

steady*integer

How many of those reached steady use

retention*object

Who used the product on days 1 to 7, 22 to 28 and 50 to 56 after the first key action. Each week reads the customers whose first key action was in the days before that week ended

3 properties
w1*object
4 properties
of*integer

The customers whose days are over

kept*integer

How many of them used the product in those days

rate*number | null

kept of of, in percent. Null under 5 customers

level*enum<string>

hidden: under 5 customers. directional: 5 to 9. ranked: 10 or more

hiddendirectionalranked

w4*object
4 properties
of*integer

The customers whose days are over

kept*integer

How many of them used the product in those days

rate*number | null

kept of of, in percent. Null under 5 customers

level*enum<string>

hidden: under 5 customers. directional: 5 to 9. ranked: 10 or more

hiddendirectionalranked

w8*object
4 properties
of*integer

The customers whose days are over

kept*integer

How many of them used the product in those days

rate*number | null

kept of of, in percent. Null under 5 customers

level*enum<string>

hidden: under 5 customers. directional: 5 to 9. ranked: 10 or more

hiddendirectionalranked

pmf*object

How they answered the survey in the days

8 properties
answers*integer

The answers that count: each answer but no_longer_use

very*integer

Would be very disappointed without the product

somewhat*integer

Would be somewhat disappointed

not*integer

Would not be disappointed

gone*integer

No longer use the product. These are not in the score

love*number | null

The share that would be very disappointed, in percent. Null under 5 answers

low*number | null

The low end of the 95% range of that share, in percent. Null under 10 answers

level*enum<string>

hidden: under 5 answers, so no share. directional: 5 to 9 answers. ranked: 10 or more

hiddendirectionalranked

themes*array<object>

What their accepted feedback of the days is about, 5 themes at most

2 properties
theme*string
count*integer
all*object

Every customer of the workspace

12 properties
customers*integer

The customers in the group now

paying*integer

How many of them pay now

mrr*number

What they pay for a month now, in the units of the currency

atRisk*integer

How many of them are at risk now

newPaying*integer

Became a paying customer in the days

churned*integer

Left in the days

signups*integer

Began to use the product in the days

activated*integer

How many of those did a first key action

steady*integer

How many of those reached steady use

retention*object

Who used the product on days 1 to 7, 22 to 28 and 50 to 56 after the first key action. Each week reads the customers whose first key action was in the days before that week ended

3 properties
w1*object
4 properties
of*integer

The customers whose days are over

kept*integer

How many of them used the product in those days

rate*number | null

kept of of, in percent. Null under 5 customers

level*enum<string>

hidden: under 5 customers. directional: 5 to 9. ranked: 10 or more

hiddendirectionalranked

w4*object
4 properties
of*integer

The customers whose days are over

kept*integer

How many of them used the product in those days

rate*number | null

kept of of, in percent. Null under 5 customers

level*enum<string>

hidden: under 5 customers. directional: 5 to 9. ranked: 10 or more

hiddendirectionalranked

w8*object
4 properties
of*integer

The customers whose days are over

kept*integer

How many of them used the product in those days

rate*number | null

kept of of, in percent. Null under 5 customers

level*enum<string>

hidden: under 5 customers. directional: 5 to 9. ranked: 10 or more

hiddendirectionalranked

pmf*object

How they answered the survey in the days

8 properties
answers*integer

The answers that count: each answer but no_longer_use

very*integer

Would be very disappointed without the product

somewhat*integer

Would be somewhat disappointed

not*integer

Would not be disappointed

gone*integer

No longer use the product. These are not in the score

love*number | null

The share that would be very disappointed, in percent. Null under 5 answers

low*number | null

The low end of the 95% range of that share, in percent. Null under 10 answers

level*enum<string>

hidden: under 5 answers, so no share. directional: 5 to 9 answers. ranked: 10 or more

hiddendirectionalranked

themes*array<object>

What their accepted feedback of the days is about, 5 themes at most

2 properties
theme*string
count*integer
by*string | null

What the groups split the customers by

groups*array<object>

With by: each group of the customers, the one that the survey ranks highest first

7 properties
value*string | null

The value that the group shares. Null: Troopy does not know it for these customers

customers*integer
paying*integer
mrr*number
signups*integer
activated*integer
pmf*object
8 properties
answers*integer

The answers that count: each answer but no_longer_use

very*integer

Would be very disappointed without the product

somewhat*integer

Would be somewhat disappointed

not*integer

Would not be disappointed

gone*integer

No longer use the product. These are not in the score

love*number | null

The share that would be very disappointed, in percent. Null under 5 answers

low*number | null

The low end of the 95% range of that share, in percent. Null under 10 answers

level*enum<string>

hidden: under 5 answers, so no share. directional: 5 to 9 answers. ranked: 10 or more

hiddendirectionalranked

Errors

400 invalid_inputFix the field named in detail. Each operation's schema is in /api/v1/openapi.json.
401 unauthorizedSend an API key as `Authorization: Bearer tr_live_...`. Create one in Troopy under Settings.
403 forbiddenThe key lacks a scope this operation needs, or its owner lacks the role. detail says which; create a key with the scope, or ask an organization owner or admin.
429 rate_limitedWait the number of seconds in Retry-After, then retry.