Skip to main content

Sessions count

Deprecated

get_sessions_count is deprecated and will be removed in a future release. Use list_sessions_count — the dedicated count function designed to pair with list_sessions for pagination.

Overview​

The get_sessions_count function provides a simple session count summary with additional metadata. Use this endpoint to:

  • Get quick session totals for overview dashboards
  • Retrieve session counts with an AI agent and human agent reply breakdown
  • Build high-level analytics summaries

Quick start​

query GetSessionsCount(
$accountId: uuid!
$deskIds: _uuid
$brainIds: _uuid
$startDate: timestamp
$endDate: timestamp
$isTest: Boolean
) {
rows: get_sessions_count(
args: {
account_id: $accountId
desk_ids: $deskIds
brain_parent_ids: $brainIds
start_time: $startDate
end_time: $endDate
is_test: $isTest
}
) {
num_sessions
num_sessions_brain_send
num_sessions_send
}
}

Variables:

{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2024-01-08",
"endDate": "2024-01-17"
}

Parameters​

ParameterTypeDescription
accountIduuid!Account identifier (required)
deskIds_uuidFilter by desk IDs
brainIds_uuidFilter by AI agent IDs
startDatetimestampStart date (format: yyyy-mm-dd)
endDatetimestampEnd date (format: yyyy-mm-dd)
isTestBooleanExclude test sessions

Response fields​

FieldTypeDescription
num_sessionsIntTotal number of sessions
num_sessions_brain_sendIntSessions with at least one AI agent reply
num_sessions_sendIntSessions with at least one human agent reply

Common use cases​

Try it​

Loading GraphQL Playground...

Get session count for an account:

{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2024-01-08",
"endDate": "2024-01-17"
}

Example response​

{
"data": {
"rows": [
{
"num_sessions": 12500,
"num_sessions_brain_send": 11980,
"num_sessions_send": 2625
}
]
}
}