Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Sessions

Get the settings of Sessions

Whether Troopy looks at the sessions of the workspace, and where it reads them: the events of Troopy's own script, or PostHog. Also how often, how many sessions a teammate reads in one look, which countries and paths count, and whether Troopy makes bug tickets by itself.

get/api/v1/session-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 sessions settings
MCP tooltroopy_get_session_settings
Rate limit120 calls in 60 seconds, for each key

Response

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

Whether Troopy looks at the new sessions on a schedule

source*enum<string>

Where Troopy reads the sessions. troopy: the events of Troopy's own script on the site, as Analytics has it. posthog: the session recordings of the PostHog that the workspace connected

troopyposthog

everyHours*integer

How often Troopy looks, in hours: 3, 6, 12 or 24. Each look reads the sessions since the look before

maxSessions*integer

How many sessions a teammate reads in one look, the busiest first

At least 1 · At most 20

countries*array<string>

Only sessions from these countries, as ISO codes like US. Empty: every country

At most 60 items

skipPaths*array<string>

Leave out a session when each page that it viewed is under one of these paths, like /tools

At most 20 items

replays*boolean

Whether the script records a share of the visits as session replays, with every typed field masked. It needs the site of Analytics. Put the new tag on the site after a change

replaySample*number

The share of visits that the script records, 0.01 to 1

At least 0.01 · At most 1

replayText*enum<string>

masked: the recorder hides the words of every element as stars. shown: the words show, and each typed field stays masked. Put the new tag on the site after a change

maskedshown

replayConsent*boolean

Whether the recorder waits for the consent of the visitor. The page calls troopy("consent", true) after a yes, and troopy("consent", false) stops it. Put the new tag on the site after a change

tickets*enum<string>

off: a person makes each bug ticket. high: Troopy makes a bug ticket for each new high or critical problem, 3 a day at most

offhigh

repo*string | null

The GitHub repo that each bug ticket of Sessions changes, as owner/name. Null: the Engineer picks the repo

branch*string | null

The branch that the work of each bug ticket of Sessions starts from, and that its pull request goes into, like staging. Null: the default branch of the repo. A ticket keeps the branch that was set when Troopy made it

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.