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
| Parameter | Type | Description |
|---|---|---|
accountId | uuid! | Account identifier (required) |
deskIds | _uuid | Filter by desk IDs |
brainIds | _uuid | Filter by AI agent IDs |
startDate | timestamp | Start date (format: yyyy-mm-dd) |
endDate | timestamp | End date (format: yyyy-mm-dd) |
hourStart | Int | Start hour (0-23) |
hourEnd | Int | End hour (0-23) |
Response fields
| Field | Type | Description |
|---|---|---|
session_count | Int | Number of meaningful sessions |
hour_range_start | Int | Start hour of the range |
hour_range_end | Int | End hour of the range |
Common use cases
Try it
Loading GraphQL Playground...
- Business hours
- Off-hours
- Morning hours
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
}
Get sessions during off-hours (6 PM - 8 AM):
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2024-01-08",
"endDate": "2024-01-17",
"hourStart": 18,
"hourEnd": 8
}
Get sessions during morning hours (6 AM - 12 PM):
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
"startDate": "2024-01-08",
"endDate": "2024-01-17",
"hourStart": 6,
"hourEnd": 12
}
Example response
{
"data": {
"rows": [
{
"session_count": 1245,
"hour_range_start": 9,
"hour_range_end": 17
}
]
}
}