Skip to main content

Requests counts per hour

Overview

The requests_hourly_counts_v2 function provides user message counts grouped by day of week and hour. Use this endpoint to:

  • Identify peak traffic hours and days
  • Analyze user activity patterns across the week
  • Optimize staffing and resource allocation

Quick start

query MessagesPerHourV2(
$deskIds: _uuid
$brainIds: _uuid
$integrationIds: _uuid
$brainVersions: _int4
$channels: _text
$startDate: timestamp
$endDate: timestamp
$isTest: Boolean
) {
rows: requests_hourly_counts_v2(
args: {
desk_ids: $deskIds
brain_parent_ids: $brainIds
integration_ids: $integrationIds
brain_versions: $brainVersions
channels: $channels
start_time: $startDate
end_time: $endDate
is_test: $isTest
}
) {
counts
weekday
hour
}
}

Variables:

{
"deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
"startDate": "2024-01-08",
"endDate": "2024-01-17"
}

Try it

Loading GraphQL Playground...

Parameters

ParameterTypeDescription
deskIds_uuidFilter by desk IDs
brainIds_uuidFilter by AI agent IDs
integrationIds_uuidFilter by integration IDs
brainVersions_int4Filter by AI agent versions
channels_textFilter by channels
startDatetimestampStart date (format: yyyy-mm-dd)
endDatetimestampEnd date (format: yyyy-mm-dd)
isTestBooleanExclude test sessions

Response fields

FieldTypeDescription
countsIntNumber of requests for this day/hour
weekdayIntDay of week (1=Monday, 2=Tuesday, ..., 7=Sunday)
hourIntHour of day (0-23)

Common use cases

Get hourly request distribution for a single desk:

{
"deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
"startDate": "2024-01-08",
"endDate": "2024-01-17"
}

Example response

{
"data": {
"rows": [
{
"counts": 18,
"weekday": 2,
"hour": 16
},
{
"counts": 10,
"weekday": 5,
"hour": 10
},
{
"counts": 10,
"weekday": 2,
"hour": 15
},
{
"counts": 7,
"weekday": 5,
"hour": 13
},
{
"counts": 6,
"weekday": 1,
"hour": 9
}
]
}
}