---
title: "Response times"
description: "Get response time and first response time statistics for AI agents and human agents over a date range with response_times."
---

# Response times

> Get response time and first response time statistics for AI agents and human agents over a date range with response_times.

## Overview

The `response_times` function provides overall response time statistics for a date range. Use this endpoint to:

- Get aggregate response time metrics across all sessions
- Compare AI agent vs human agent performance
- Analyze first response time metrics

## Quick start

```graphql
query ResponseTimes(
  $accountId: uuid
  $deskIds: _uuid
  $brainIds: _uuid
  $integrationIds: _uuid
  $brainVersions: _int4
  $channels: _text
  $startDate: timestamp
  $endDate: timestamp
  $events: _text
  $firstMessage: Boolean
  $isTest: Boolean
  $onlyBrain: Boolean
  $onlyHuman: Boolean
  $agentIds: _text
  $tags: _text
  $minNumUserMessages: Int
) {
  rows: response_times(
    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
      events: $events
      first_message: $firstMessage
      is_test: $isTest
      only_brain: $onlyBrain
      only_human: $onlyHuman
      agent_ids: $agentIds
      tags: $tags
      min_num_user_messages: $minNumUserMessages
    }
  ) {
    average_time
    median_time
    max_time
    min_time
    num_responses
  }
}
```

**Variables:**

```json
{
  "accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

## Try it

<GraphiQLPlayground
  query={`query ResponseTimes(
  \$accountId: uuid
  \$deskIds: _uuid
  \$brainIds: _uuid
  \$integrationIds: _uuid
  \$brainVersions: _int4
  \$channels: _text
  \$startDate: timestamp
  \$endDate: timestamp
  \$events: _text
  \$firstMessage: Boolean
  \$isTest: Boolean
  \$onlyBrain: Boolean
  \$onlyHuman: Boolean
  \$agentIds: _text
  \$tags: _text
  \$minNumUserMessages: Int
) {
  rows: response_times(
    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
      events: \$events
      first_message: \$firstMessage
      is_test: \$isTest
      only_brain: \$onlyBrain
      only_human: \$onlyHuman
      agent_ids: \$agentIds
      tags: \$tags
      min_num_user_messages: \$minNumUserMessages
    }
  ) {
    average_time
    median_time
    max_time
    min_time
    num_responses
  }
}`}
  variables={`{
  "accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}`}
  endpoint="https://logs.moveo.ai/v1/graphql"
/>

## Parameters

| Parameter            | Type        | Description                                    |
| -------------------- | ----------- | ---------------------------------------------- |
| `accountId`          | `uuid`      | Account identifier                             |
| `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                    |
| `channels`           | `_text`     | Filter by channels                             |
| `startDate`          | `timestamp` | Start date (format: `yyyy-mm-dd`)              |
| `endDate`            | `timestamp` | End date (format: `yyyy-mm-dd`)                |
| `events`             | `_text`     | Filter by event types                          |
| `firstMessage`       | `Boolean`   | Only include first response times              |
| `isTest`             | `Boolean`   | Exclude test sessions                          |
| `onlyBrain`          | `Boolean`   | Only include AI agent responses                |
| `onlyHuman`          | `Boolean`   | Only include human agent responses             |
| `agentIds`           | `_text`     | Filter by human agent IDs                      |
| `tags`               | `_text`     | Filter by tags                                 |
| `minNumUserMessages` | `Int`       | Minimum number of user messages in the session |

## Response fields

Response time values are returned in **minutes**.

| Field           | Type    | Description                        |
| --------------- | ------- | ---------------------------------- |
| `average_time`  | `Float` | Average response time (in minutes) |
| `median_time`   | `Float` | Median response time (in minutes)  |
| `max_time`      | `Float` | Maximum response time (in minutes) |
| `min_time`      | `Float` | Minimum response time (in minutes) |
| `num_responses` | `Int`   | Total number of responses          |

## Common use cases

**Account level**

Get overall response time statistics for an account:

```json
{
  "accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

**Multiple desks**

Get response times across multiple desks:

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

**Multiple AI agents**

Filter by multiple AI agents:

```json
{
  "brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c, 99xx33p9-dfab-44e5-9303-9b2bf13f1c94}",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

**Specific channels**

Filter by specific channels:

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

**First response only**

Only include first response times:

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

**Human agents only**

Only include human agent response times:

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

**AI agents only**

Only include AI agent response times:

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

**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": [
      {
        "average_time": 0.026548766,
        "median_time": 0.0218,
        "max_time": 0.084366664,
        "min_time": 0.019616667,
        "num_responses": 54
      }
    ]
  }
}
```
