Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Apps

Get a PostHog trend

How one event moved over time in the workspace's PostHog: its count, or the people doing it, per day, week or month, optionally broken down by a property (the five biggest values). Read only. Needs PostHog connected.

get/api/v1/apps/posthog/trend

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.
Scopesapps:read

Other ways to call it

CLItroopy posthog trend
MCP tooltroopy_posthog_trend
Rate limit30 calls in 60 seconds, for each key

Query parameters

event*string

The event's exact name, like signed_up or $pageview

At least 1 characters · At most 200 characters

measureenum<string>

total counts events; users counts people per interval

totalusersweekly_activemonthly_active

Default "total"

intervalenum<string>

dayweekmonth

Default "day"

daysinteger

Days back from today, at most 180

Default 30 · At least 1 · At most 180

breakdownstring

A property to split by, like $browser

At most 100 characters

breakdownOnenum<string>

Whether breakdown is an event property or a person property, like a plan set on the person

eventperson

Default "event"

Response

200 · application/json
data*object
5 properties
event*string
measure*string
interval*string
series*array<object>
4 properties
label*string
breakdown*string | null

The property's value, for a breakdown

total*number | null

Events in the period. Null for people measures: the same person counts in each interval they were active

points*array<object>
2 properties
date*string
value*number
moreSeries*integer

Breakdown values left out: only the five biggest are shown

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.