Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Customers

Read the customers again

Has Troopy read the customers of the business from its payment providers again, within a minute. Troopy reads them each hour by itself. Use it after a change at a provider that must show now.

post/api/v1/customer-sync

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

Response

202 · 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

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.