Get profile sessions
get_profile_sessionsGetProfileSessions returns a paginated list of one user profile's sessions, newest first unless sort says otherwise. Requires that user's distinct_id (the pug profile id a profile lookup gives you). Sessions are aggregated server-side — one row per session with its start, end, event count and device context — so a profile with more events than any one page can hold still lists every session, with exact durations and counts. Resolves profile aliases so merged anonymous events are included. To page, send the previous response's next_page_token back as page_token; an empty next_page_token means there are no more pages. A token is only valid for the sort it was issued under — to change sort, start again with no page_token. sort defaults to PROFILE_SESSION_SORT_STARTED_AT and every sort is descending, so DURATION lists the longest sessions first and EVENT_COUNT the busiest. Traffic tagged as a bot at ingest is excluded unless include_bots is true, and the judgement is per session: a session with any tagged event is omitted whole rather than returned with only its untagged events.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_profile_sessions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | ||
| page_size | No | ||
| page_token | No | ||
| project_id | No | The id of the project, from list_projects. | |
| time_range | No | ||
| distinct_id | No | ||
| include_bots | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessions | No | ||
| next_page_token | No |