Skip to main content

Meaningful sessions by hour range

Overview

The get_meaningful_sessions_count_by_hour_range function provides meaningful session counts within specified hour ranges. This allows for more granular analysis of specific time windows. Use this endpoint to:

  • Analyze sessions during business hours vs off-hours
  • Compare morning vs afternoon engagement
  • Track sessions during specific operational windows

Quick start

query GetMeaningfulSessionsCountByHourRange(
$accountId: uuid!
$deskIds: _uuid
$brainIds: _uuid
$startDate: timestamp
$endDate: timestamp
$hourStart: Int
$hourEnd: Int
) {
rows: get_meaningful_sessions_count_by_hour_range(
args: {
account_id: $accountId
desk_ids: $deskIds
brain_parent_ids: $brainIds
start_time: $startDate
end_time: $endDate
hour_start: $hourStart
hour_end: $hourEnd
}
) {
session_count
hour_range_start
hour_range_end
}
}

Variables:

{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2024-01-08",
"endDate": "2024-01-17",
"hourStart": 9,
"hourEnd": 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)
hourStartIntStart hour (0-23)
hourEndIntEnd hour (0-23)

Response fields

FieldTypeDescription
session_countIntNumber of meaningful sessions
hour_range_startIntStart hour of the range
hour_range_endIntEnd hour of the range

Common use cases

Try it

Loading GraphQL Playground...

Get sessions during business hours (9 AM - 5 PM):

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

Example response

{
"data": {
"rows": [
{
"session_count": 1245,
"hour_range_start": 9,
"hour_range_end": 17
}
]
}
}