---
title: "Ratings and feedback"
description: "Get the ratings and feedback comments that end users leave, per agent or AI agent, with the rating_feedback GraphQL function."
---

# Ratings and feedback

> Get the ratings and feedback comments that end users leave, per agent or AI agent, with the rating_feedback GraphQL function.

## Overview

The `rating_feedback` function provides access to ratings and feedback left by end users. Use this endpoint to:

- Retrieve customer satisfaction ratings
- Access feedback comments from users
- Analyze ratings by agent or AI agent

## Quick start

```graphql
query RatingsFeedbacks(
  $deskIds: _uuid
  $brainIds: _uuid
  $integrationIds: _uuid
  $brainVersions: _int4
  $startDate: timestamp
  $endDate: timestamp
  $agentIds: _text
  $ratings: _int4
  $isTest: Boolean
) {
  rows: rating_feedback(
    args: {
      start_time: $startDate
      end_time: $endDate
      brain_parent_ids: $brainIds
      desk_ids: $deskIds
      integration_ids: $integrationIds
      brain_versions: $brainVersions
      is_test: $isTest
      agent_ids: $agentIds
      ratings: $ratings
    }
  ) {
    agent_id
    agent_name
    brain_id
    brain_parent_id
    version
    rating
    feedback
    is_test
  }
}
```

**Variables:**

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

## Try it

<GraphiQLPlayground
  query={`query RatingsFeedbacks(
  \$deskIds: _uuid
  \$brainIds: _uuid
  \$integrationIds: _uuid
  \$brainVersions: _int4
  \$startDate: timestamp
  \$endDate: timestamp
  \$agentIds: _text
  \$ratings: _int4
  \$isTest: Boolean
) {
  rows: rating_feedback(
    args: {
      start_time: \$startDate
      end_time: \$endDate
      brain_parent_ids: \$brainIds
      desk_ids: \$deskIds
      integration_ids: \$integrationIds
      brain_versions: \$brainVersions
      is_test: \$isTest
      agent_ids: \$agentIds
      ratings: \$ratings
    }
  ) {
    agent_id
    agent_name
    brain_id
    brain_parent_id
    version
    rating
    feedback
    is_test
  }
}`}
  variables={`{
  "deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}`}
  endpoint="https://logs.moveo.ai/v1/graphql"
/>

## Parameters

| Parameter        | Type        | Description                       |
| ---------------- | ----------- | --------------------------------- |
| `deskIds`        | `_uuid`     | Filter by desk IDs                |
| `brainIds`       | `_uuid`     | Filter by AI agent IDs            |
| `integrationIds` | `_uuid`     | Filter by integration IDs         |
| `brainVersions`  | `_int4`     | Filter by AI agent versions       |
| `startDate`      | `timestamp` | Start date (format: `yyyy-mm-dd`) |
| `endDate`        | `timestamp` | End date (format: `yyyy-mm-dd`)   |
| `agentIds`       | `_text`     | Filter by human agent IDs         |
| `ratings`        | `_int4`     | Filter by specific rating values  |
| `isTest`         | `Boolean`   | Exclude test sessions             |

## Response fields

| Field            | Type      | Description                     |
| ---------------- | --------- | ------------------------------- |
| `agent_id`       | `String`  | Human agent identifier          |
| `agent_name`     | `String`  | Agent display name              |
| `brain_id`       | `uuid`    | AI agent version identifier     |
| `brain_parent_id`| `uuid`    | AI agent parent identifier      |
| `version`        | `Int`     | AI agent version number         |
| `rating`         | `Int`     | Rating value (1-5)              |
| `feedback`       | `String`  | User feedback text              |
| `is_test`        | `Boolean` | Whether session was a test      |

## Common use cases

**Single desk**

Get ratings for a single desk:

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

**Multiple desks**

Get ratings across multiple desks:

```json
{
  "deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c, 51ff88a7-dfab-44e5-9303-9b2bf13f1c94}",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

**Specific agents**

Get ratings for specific agents:

```json
{
  "deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
  "agentIds": "{1b28b8ba-c9de-42ac-94ad-564e0c6858c9, 1e47963e-ae46-4821-ae61-10773d1141a2}",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

**Low ratings only**

Filter for low ratings (1-3):

```json
{
  "deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
  "ratings": "{1,2,3}",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

**Production only**

Exclude test sessions:

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

## Example response

```json
{
  "data": {
    "rows": [
      {
        "agent_id": "1b28b8ba-c9de-42ac-94ad-564e0c6858c9",
        "agent_name": "John Doe",
        "brain_id": "a2wv9283-9b53-4d7b-b77d-2650f3a1a99c",
        "brain_parent_id": "99xx33p9-dfab-44e5-9303-9b2bf13f1c94",
        "version": 42,
        "rating": 5,
        "feedback": "Very helpful support!",
        "is_test": false
      },
      {
        "agent_id": null,
        "agent_name": null,
        "brain_id": "a2wv9283-9b53-4d7b-b77d-2650f3a1a99c",
        "brain_parent_id": "99xx33p9-dfab-44e5-9303-9b2bf13f1c94",
        "version": 42,
        "rating": 3,
        "feedback": "Could be faster",
        "is_test": false
      }
    ]
  }
}
```
