API reference / Sessions
Change the settings of Sessions
Turns Sessions on or off, and changes how it looks. Send only what changes. With the source troopy, Sessions turns on only when the workspace has its site in Analytics. With posthog, it needs PostHog connected with a key that can read its session recordings: the switch reads them one time. The first look comes within a minute. Each look is one run of the Product analyst, or else the lead, on the AI plan of the workspace. Owners and admins.
/api/v1/session-settingsOther ways to call it
troopy sessions update-settingsIdempotency-Key header. A retry with the same key gets the first answer back, and the operation runs one time.Body
application/jsononbooleanWhether Troopy looks at the new sessions on a schedule
sourceenum<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
everyHoursintegerHow often Troopy looks, in hours: 3, 6, 12 or 24. Each look reads the sessions since the look before
maxSessionsintegerHow many sessions a teammate reads in one look, the busiest first
At least 1 · At most 20
countriesarray<string>Only sessions from these countries, as ISO codes like US. Empty: every country
At most 60 items
skipPathsarray<string>Leave out a session when each page that it viewed is under one of these paths, like /tools
At most 20 items
replaysbooleanWhether 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
replaySamplenumberThe share of visits that the script records, 0.01 to 1
At least 0.01 · At most 1
replayTextenum<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
replayConsentbooleanWhether 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
ticketsenum<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
repostring | nullThe GitHub repo that each bug ticket of Sessions changes, as owner/name. Null: the Engineer picks the repo
branchstring | nullThe 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
Response
200 · application/jsondata*object13 properties
on*booleanWhether 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*integerHow often Troopy looks, in hours: 3, 6, 12 or 24. Each look reads the sessions since the look before
maxSessions*integerHow 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*booleanWhether 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*numberThe 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*booleanWhether 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 | nullThe GitHub repo that each bug ticket of Sessions changes, as owner/name. Null: the Engineer picks the repo
branch*string | nullThe 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