---
title: "Sessions count"
description: "Reference for get_sessions_count, the deprecated GraphQL function that returns a session count summary. Use list_sessions_count instead."
---

# Sessions count

> Reference for get_sessions_count, the deprecated GraphQL function that returns a session count summary. Use list_sessions_count instead.

:::warning Deprecated
`get_sessions_count` is deprecated and will be removed in a future release. Use [`list_sessions_count`](https://docs.moveo.ai/api/analytics/list-sessions.md#pagination), the dedicated count function that pairs with `list_sessions` for pagination.
:::

## Overview

The `get_sessions_count` function provides a simple session count summary with additional metadata. Use this endpoint to:

- Get quick session totals for overview dashboards
- Retrieve session counts with an AI agent and human agent reply breakdown
- Build high-level analytics summaries

## Quick start

```graphql
query GetSessionsCount(
  $accountId: uuid!
  $deskIds: _uuid
  $brainIds: _uuid
  $startDate: timestamp
  $endDate: timestamp
  $isTest: Boolean
) {
  rows: get_sessions_count(
    args: {
      account_id: $accountId
      desk_ids: $deskIds
      brain_parent_ids: $brainIds
      start_time: $startDate
      end_time: $endDate
      is_test: $isTest
    }
  ) {
    num_sessions
    num_sessions_brain_send
    num_sessions_send
  }
}
```

**Variables:**

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

## Parameters

| Parameter    | Type        | Description                       |
| ------------ | ----------- | --------------------------------- |
| `accountId`  | `uuid!`     | Account identifier (required)     |
| `deskIds`    | `_uuid`     | Filter by desk IDs                |
| `brainIds`   | `_uuid`     | Filter by AI agent 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                                  |
| ------------------------- | ----- | -------------------------------------------- |
| `num_sessions`            | `Int` | Total number of sessions                     |
| `num_sessions_brain_send` | `Int` | Sessions with at least one AI agent reply    |
| `num_sessions_send`       | `Int` | Sessions with at least one human agent reply |

## Common use cases

## Try it

<GraphiQLPlayground
  query={`query GetSessionsCount(
  \$accountId: uuid!
  \$deskIds: _uuid
  \$brainIds: _uuid
  \$startDate: timestamp
  \$endDate: timestamp
  \$isTest: Boolean
) {
  rows: get_sessions_count(
    args: {
      account_id: \$accountId
      desk_ids: \$deskIds
      brain_parent_ids: \$brainIds
      start_time: \$startDate
      end_time: \$endDate
      is_test: \$isTest
    }
  ) {
    num_sessions
    num_sessions_brain_send
    num_sessions_send
  }
}`}
  variables={`{
  "accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}`}
  endpoint="https://logs.moveo.ai/v1/graphql"
/>

**Account total**

Get session count for an account:

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

**Specific desk**

Get session count for a specific desk:

```json
{
  "accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
  "deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

**Production only**

Exclude test sessions:

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

## Example response

```json
{
  "data": {
    "rows": [
      {
        "num_sessions": 12500,
        "num_sessions_brain_send": 11980,
        "num_sessions_send": 2625
      }
    ]
  }
}
```
