Daily ratings
Overview
The get_daily_ratings function provides daily aggregated ratings data. This endpoint helps track customer satisfaction trends over time. Use this endpoint to:
- Track daily customer satisfaction trends
- Identify rating patterns over time
- Generate satisfaction trend reports
Quick start
query GetDailyRatings(
$deskIds: _uuid
$brainIds: _uuid
$channels: _text
$startDate: timestamp
$endDate: timestamp
$isTest: Boolean
) {
rows: get_daily_ratings(
args: {
desk_ids: $deskIds
brain_ids: $brainIds
channels: $channels
start_time: $startDate
end_time: $endDate
is_test: $isTest
}
) {
date
ratings_count
avg_rating
median_rating
ratings_count_more_than_3
}
}
Variables:
{
"deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
"startDate": "2024-01-08",
"endDate": "2024-01-17"
}
Parameters
| Parameter | Type | Description |
|---|---|---|
deskIds | _uuid | Filter by desk IDs |
brainIds | _uuid | Filter by AI agent version IDs |
channels | _text | Filter by channels |
startDate | timestamp | Start date (format: yyyy-mm-dd) |
endDate | timestamp | End date (format: yyyy-mm-dd) |
isTest | Boolean | Exclude test sessions |
Response fields
| Field | Type | Description |
|---|---|---|
date | timestamp | Date of the aggregation |
ratings_count | Int | Total ratings received |
avg_rating | Float | Average rating for the day |
median_rating | Int | Median rating for the day |
ratings_count_more_than_3 | Int | Number of ratings greater than 3 |
Common use cases
Try it
Loading GraphQL Playground...
- Daily trend
- AI agent ratings
- Production only
Get daily ratings trend:
{
"deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
"startDate": "2024-01-08",
"endDate": "2024-01-17"
}
Get daily ratings for specific AI agents:
{
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}",
"startDate": "2024-01-08",
"endDate": "2024-01-17"
}
Exclude test sessions:
{
"deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
"isTest": false,
"startDate": "2024-01-08",
"endDate": "2024-01-17"
}
Example response
{
"data": {
"rows": [
{
"date": "2024-01-08T00:00:00",
"ratings_count": 45,
"avg_rating": 4.2,
"median_rating": 4,
"ratings_count_more_than_3": 35
},
{
"date": "2024-01-09T00:00:00",
"ratings_count": 52,
"avg_rating": 4.4,
"median_rating": 5,
"ratings_count_more_than_3": 45
}
]
}
}