Counts Per Brain
Access the number of sessions, messages and users per Brain
query CountsPerBrain(
$accountId: uuid
$deskIds: _uuid
$brainIds: _uuid
$integrationIds: _uuid
$brainVersions: _int4
$channels: _text
$tags: _text
$startDate: timestamp
$endDate: timestamp
$isTest: Boolean
$minNumUserMessages: Int
) {
rows: counts_per_brain(
args: {
account_id: $accountId
start_time: $startDate
end_time: $endDate
brain_parent_ids: $brainIds
desk_ids: $deskIds
integration_ids: $integrationIds
brain_versions: $brainVersions
channels: $channels
tags: $tags
is_test: $isTest
min_num_user_messages: $minNumUserMessages
}
) {
brain_parent_id: id
num_requests
num_sessions
num_users
last_used
}
}
Below are some examples of how CountsPerBrain
can be called.
- Account
- Multiple Brains
- Multiple Tags
- Multiple Brains & Tags
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2023-04-08",
"endDate": "2023-04-17"
}
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c, 99xx33p9-dfab-44e5-9303-9b2bf13f1c94}",
"startDate": "2023-04-08",
"endDate": "2023-04-17"
}
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2023-04-08",
"endDate": "2023-04-17",
"tags": "{vip-user, return-order}"
}
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2023-04-08",
"endDate": "2023-04-17",
"tags": "{vip-user, return-order}",
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}"
}
Example Result:
{
"data": {
"rows": [
{
"brain_parent_id": "a2wv9283-9b53-4d7b-b77d-2650f3a1a99c",
"num_requests": 309,
"num_sessions": 309,
"num_users": 309,
"last_used": "2023-04-12T15:09:18.58"
},
{
"brain_parent_id": "99xx33p9-dfab-44e5-9303-9b2bf13f1c94",
"num_requests": 1564,
"num_sessions": 448,
"num_users": 448,
"last_used": "2023-04-12T16:00:33.701"
}
]
}
}