Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Customers

Change the settings of customers

Says which events mean that a customer began to use the product, what steady use is, whether Troopy reads PostHog for what customers do, and the name of the product in the surveys. Send only what changes. Owners and admins only.

patch/api/v1/customer-settings

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 set
MCP toolNone. Call it over REST or with the CLI.
Rate limit30 calls in 60 seconds, for each key

Body

application/json
activationarray<string>

At most 10 items

successobject
3 properties
eventsarray<string>

The names of the events of steady use. Empty: the activation events

At most 10 items

daysinteger

On how many days a customer must do one of them

At least 1 · At most 14

windowinteger

Within how many days in a row

At least 1 · At most 60

posthogboolean
suggestboolean
productstring

The name of the product in the questions of the surveys. Empty: the name of the business

At most 60 characters

Response

200 · application/json
data*object
13 properties
connected*boolean

Whether a payment provider is connected in the workspace

providers*array<object>

The payment providers that Troopy reads customers from, and which of them the workspace connected

3 properties
id*enum<string>

stripelemonsqueezypolarpaddledodopayments

name*string
connected*boolean
syncedAt*string | null

When Troopy last read the customers

syncing*boolean

A read waits or runs now

error*string | null

What the last read said, when it failed

customers*integer
history*enum<string>

reading: Troopy still reads the older payments, so revenue is not whole yet

readingdone

activation*array<string>

The names of the events that mean a customer began to use the product: goals of the tracking script, events of PostHog, or events of the backend

success*object

Steady use: one of the events, on some days within a window of days

3 properties
events*array<string>

The names of the events of steady use. Empty: the activation events

At most 10 items

days*integer

On how many days a customer must do one of them

At least 1 · At most 14

window*integer

Within how many days in a row

At least 1 · At most 60

posthog*boolean

Troopy also reads what customers do from the PostHog of the workspace

suggest*boolean

A teammate suggests the type and the themes of what customers said. A person accepts each one

product*string

The name of the product in the questions of the surveys

users*integer

The customers that Troopy knows as users of the product

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.