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
$integrationIds: _uuid
$startDate: timestamp
$endDate: timestamp
$isTest: Boolean
) {
rows: get_daily_ratings(
args: {
desk_ids: $deskIds
brain_parent_ids: $brainIds
integration_ids: $integrationIds
start_time: $startDate
end_time: $endDate
is_test: $isTest
}
) {
date
total_ratings
avg_rating
rating_1
rating_2
rating_3
rating_4
rating_5
}
}
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 IDs |
integrationIds | _uuid | Filter by integration IDs |
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 |
total_ratings | Int | Total ratings received |
avg_rating | Float | Average rating for the day |
rating_1 | Int | Count of 1-star ratings |
rating_2 | Int | Count of 2-star ratings |
rating_3 | Int | Count of 3-star ratings |
rating_4 | Int | Count of 4-star ratings |
rating_5 | Int | Count of 5-star ratings |
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",
"total_ratings": 45,
"avg_rating": 4.2,
"rating_1": 2,
"rating_2": 3,
"rating_3": 5,
"rating_4": 15,
"rating_5": 20
},
{
"date": "2024-01-09T00:00:00",
"total_ratings": 52,
"avg_rating": 4.4,
"rating_1": 1,
"rating_2": 2,
"rating_3": 4,
"rating_4": 18,
"rating_5": 27
}
]
}
}