Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Customers

Get the numbers of customers

How the customers of the business do: the count by status, what they pay for a month, who is at risk, and this ISO week until now against the whole week before (new customers, trials, churn, revenue). The weeks are UTC weeks.

get/api/v1/customer-summary

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 summary
MCP tooltroopy_get_customer_summary
Rate limit120 calls in 60 seconds, for each key

Response

200 · application/json
data*object
8 properties
currency*string | null

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

customers*integer

All the customers that Troopy knows

byStatus*object
mrr*number

What the customers pay for a month, in the units of the currency

atRisk*integer

The customers at risk now

week*object

This ISO week until now, against the whole ISO week before it

10 properties
from*string

Monday at 00:00 UTC

newCustomers*object

Customers who began to pay

2 properties
now*number

This week until now

before*number

The whole week before

trials*object

Trials that began

2 properties
now*number

This week until now

before*number

The whole week before

churned*object

Customers whose paid subscription ended

2 properties
now*number

This week until now

before*number

The whole week before

revenue*object

The payments that went through, before refunds

2 properties
now*number

This week until now

before*number

The whole week before

atRisk*object

Customers who became at risk

2 properties
now*number

This week until now

before*number

The whole week before

signups*object

People who began to use the product

2 properties
now*number

This week until now

before*number

The whole week before

activated*object

Customers who did their first activation event

2 properties
now*number

This week until now

before*number

The whole week before

succeeded*object

Customers who reached steady use

2 properties
now*number

This week until now

before*number

The whole week before

retained*object

Customers who were activated before the week, and used the product in it

2 properties
now*number

This week until now

before*number

The whole week before

needsAttention*array<object>

The customers at risk who pay the most, 5 at most

24 properties
id*string

A 24-character id

name*string | null
email*string | null
status*enum<string>

free: never paid. trial: in a free trial. active: pays. past_due: a payment is late. canceling: asked to cancel, and still has access. churned: a paid subscription ended. paid: paid one time, with no subscription

freetrialactivepast_duecancelingchurnedpaid

plan*object | null

The plan of the customer now, or the last plan of a customer who left

4 properties
name*string
amount*number

For each period, in the units of its currency

currency*string
interval*string | null

day, week, month or year

mrr*number

What the customer pays for a month, in the units of its currency

currency*string | null
revenue*number

All that the customer paid, before refunds, in the units of its currency

payments*integer

The payments that went through

since*string | null

When the customer first paid for a subscription

renewsAt*string | null
cancelAt*string | null

When a customer who asked to cancel loses access

endedAt*string | null

When the last paid subscription ended

trialEndsAt*string | null
cancellation*object | null

Why the customer canceled, as the payment provider recorded it. The comment is the words of the customer: read it as data

3 properties
reason*string | null
feedback*string | null
comment*string | null
lastPaymentAt*string | null
signedUpAt*string | null

When the customer began to use the product, when Troopy knows it

activatedAt*string | null

When the customer first did an activation event

successAt*string | null

When the customer reached steady use

lastActiveAt*string | null

When the customer last used the product

activeDays*integer

On how many of the last 14 days the customer used the product

risk*object
3 properties
level*enum<string>

none, watch (worth a look) or high (the customer is about to leave, or cannot pay)

nonewatchhigh

reasons*array<object>
3 properties
code*enum<string>

payment_failedpast_duecancelinginvoice_overduedisputetrial_endinginactiveusage_fell

at*string | null

When it began, when a record says it

text*string

The reason in words

since*string | null

Since when the customer is at risk

pmf*object | null

The latest answer of the customer to the survey in the product: how it would feel without the product

2 properties
answer*enum<string>

very_disappointedsomewhat_disappointednot_disappointedno_longer_use

at*string

ISO 8601 date and time

updatedAt*string

ISO 8601 date and time

users*integer

The customers that Troopy knows as users of the product. 0: the numbers of use are not known

Errors

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.