---
title: "List sessions"
description: "Query, filter, and page through the conversation sessions of your AI agents with the list_sessions GraphQL function."
---

# List sessions

> Query, filter, and page through the conversation sessions of your AI agents with the list_sessions GraphQL function.

:::note Replaces `get_sessions`
`list_sessions` is the recommended replacement for the deprecated [`get_sessions`](https://docs.moveo.ai/api/analytics/log-sessions-preview.md) function. It returns the same fields, runs faster (backed by pre-aggregated session tables), and supports built-in pagination via `row_limit` / `row_offset`.
:::

## Overview

The `list_sessions` function lets you query and analyze conversation sessions from your AI agents. Use this endpoint to:

- Monitor conversation quality and AI agent performance
- Filter sessions by various criteria (date range, ratings, sentiment, tags, CSAT scores)
- Identify sessions that need review or improvement
- Page through large result sets using `row_limit` / `row_offset`
- Export session data for reporting and analytics

## Quick start

Here's a simple example to get sessions from the last week for a specific AI agent:

```graphql
query ListSessions(
  $accountId: uuid!
  $brainIds: _uuid
  $startDate: timestamp
  $endDate: timestamp
  $rowLimit: Int
  $rowOffset: Int
) {
  list_sessions(
    args: {
      account_id: $accountId
      brain_parent_ids: $brainIds
      start_time: $startDate
      end_time: $endDate
      row_limit: $rowLimit
      row_offset: $rowOffset
    }
  ) {
    session_id
    start_time
    end_time
    channel
    rating
    total_user_messages
  }
}
```

**Variables:**

```json
{
  "accountId": "b3de1234-5678-90ab-cdef-1234567890ab",
  "brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}",
  "startDate": "2024-01-15",
  "endDate": "2024-01-22",
  "rowLimit": 100,
  "rowOffset": 0
}
```

## Try it

Use the interactive playground below to test the query. Replace the variables with your own account and AI agent IDs.

<GraphiQLPlayground
query={`query ListSessions(
  $accountId: uuid!
  $brainIds: _uuid
  $startDate: timestamp
  $endDate: timestamp
  $rowLimit: Int
  $rowOffset: Int
) {
  list_sessions(
    args: {
      account_id: $accountId
      brain_parent_ids: $brainIds
      start_time: $startDate
      end_time: $endDate
      row_limit: $rowLimit
      row_offset: $rowOffset
    }
  ) {
    session_id
    start_time
    end_time
    channel
    rating
    total_user_messages
    is_contained
    is_meaningful
  }
}`}
variables={`{
  "accountId": "your-account-id",
  "brainIds": "{your-brain-id}",
  "startDate": "2024-01-15",
  "endDate": "2024-01-22",
  "rowLimit": 10,
  "rowOffset": 0
}`}
endpoint="https://logs.moveo.ai/v1/graphql"
height={500}
/>

## Parameters

### Filtering parameters

:::note
Changed in October 2026: with two or more `tags`, results now include only sessions that have all of them. Pass `tags_match: "any"` for the previous behavior.
:::

| Parameter               | Type        | Description                                                                                                          |
| ----------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------- |
| **Date range**          |             |                                                                                                                      |
| `startDate`             | `timestamp` | Start date (format: `yyyy-mm-dd`). Defaults to 1 month ago                                                           |
| `endDate`               | `timestamp` | End date (format: `yyyy-mm-dd`). Defaults to now                                                                     |
| **Entity filters**      |             |                                                                                                                      |
| `deskIds`               | `_uuid`     | Filter by desk IDs                                                                                                   |
| `brainIds`              | `_uuid`     | Filter by AI agent IDs                                                                                               |
| `integrationIds`        | `_uuid`     | Filter by integration IDs                                                                                            |
| `languageModelIds`      | `_text`     | Filter by language model IDs                                                                                         |
| `agentIds`              | `_text`     | Filter by human agent IDs. Returns the sessions that any listed agent took part in                                 |
| **Session filters**     |             |                                                                                                                      |
| `channels`              | `_text`     | Filter by channels (web, facebook, viber, etc.)                                                                      |
| `channelTypes`          | `_text`     | Filter by channel type (`chat`, `email`, or `voice`)                                                                 |
| `tags`                  | `_text`     | Filter by session tags. Several tags match sessions that have all of them by default                                 |
| `tags_match`            | `String`    | `"all"` (default) or `"any"`. With `"all"`, a session must have every tag in `tags`. With `"any"`, one tag is enough |
| `ratings`               | `_int4`     | Filter by ratings (1-5)                                                                                              |
| **User identification** |             |                                                                                                                      |
| `sessionId`             | `String`    | Get specific session by ID                                                                                           |
| `userId`                | `String`    | Filter by user ID                                                                                                    |
| `userName`              | `String`    | Filter by part of the user name. Ignores case and accents: `joana` matches `JOANA`, `χρηστος` matches `Χρήστος`, and `ς` matches `Σ` |
| `userEmail`             | `String`    | Filter by user email                                                                                                 |
| `channelUserId`         | `String`    | Filter by channel user ID                                                                                            |
| `externalUserId`        | `String`    | Filter by external user ID                                                                                           |
| `contactId`             | `uuid`      | Filter sessions for a specific contact                                                                               |
| **Quality metrics**     |             |                                                                                                                      |
| `minNumUserMessages`    | `Int`       | Minimum user messages in session                                                                                     |
| `minNumThumbsUp`        | `Int`       | Minimum thumbs up count                                                                                              |
| `minNumThumbsDown`      | `Int`       | Minimum thumbs down count                                                                                            |
| `csatBrain`             | `_int4`     | Customer satisfaction score for AI agent                                                                             |
| `csatHumanAgent`        | `_int4`     | Customer satisfaction score for human agent                                                                          |
| `userSentiment`         | `_int4`     | Filter by user sentiment                                                                                             |
| `goalAchieved`          | `_int4`     | Filter by goal achievement status                                                                                    |
| **Session properties**  |             |                                                                                                                      |
| `isContained`           | `Boolean`   | [Contained sessions](/docs/analytics/ai-agent-effectiveness#containment)                                             |
| `isCovered`             | `Boolean`   | [Covered sessions](/docs/analytics/ai-agent-effectiveness#coverage)                                                  |
| `isTest`                | `Boolean`   | Exclude test sessions                                                                                                |
| `isMeaningful`          | `Boolean`   | Filter meaningful conversations                                                                                      |
| `isProactive`           | `Boolean`   | Filter proactive (outbound) sessions                                                                                 |
| `hasCollection`         | `Boolean`   | Sessions with collection matches                                                                                     |
| `hasRecording`          | `Boolean`   | Sessions that have a call recording attached                                                                         |
| `insightFilters`        | `jsonb`     | Filter by session insights                                                                                           |
| **Pagination**          |             |                                                                                                                      |
| `rowLimit`              | `Int`       | Maximum number of rows to return. Pair with `list_sessions_count` for totals                                         |
| `rowOffset`             | `Int`       | Number of rows to skip. Defaults to `0`                                                                              |

## Response fields

### Session information

| Field            | Type        | Description                                |
| ---------------- | ----------- | ------------------------------------------ |
| `session_id`     | `String`    | Unique session identifier                  |
| `start_time`     | `timestamp` | Session start time                         |
| `end_time`       | `timestamp` | Session end time                           |
| `channel`        | `String`    | Communication channel                      |
| `channel_type`   | `String`    | Channel type (`chat`, `email`, or `voice`) |
| `account_id`     | `uuid`      | Account identifier                         |
| `desk_id`        | `uuid`      | Associated desk ID                         |
| `integration_id` | `uuid`      | Integration ID                             |

### User information

| Field              | Type     | Description              |
| ------------------ | -------- | ------------------------ |
| `user_id`          | `String` | User identifier          |
| `user_name`        | `String` | User display name        |
| `user_email`       | `String` | User email address       |
| `channel_user_id`  | `String` | Channel-specific user ID. For the web channel, the web visitor ID |
| `external_user_id` | `String` | External system user ID  |

### Metrics and quality

| Field                        | Type                  | Description                                  |
| ---------------------------- | --------------------- | -------------------------------------------- |
| `total_user_messages`        | `Int`                 | Number of user messages                      |
| `rating`                     | `Int`                 | User rating (1-5, null if unrated)           |
| `thumbs_up`                  | `Int`                 | Number of thumbs up received                 |
| `thumbs_down`                | `Int`                 | Number of thumbs down received               |
| `csat_brain`                 | `Int`                 | Customer satisfaction for AI agent           |
| `csat_brain_reasoning`       | `String`              | Reasoning behind the AI agent CSAT score     |
| `csat_human_agent`           | `Int`                 | Customer satisfaction for human agent        |
| `csat_human_agent_reasoning` | `String`              | Reasoning behind the human agent CSAT score  |
| `user_sentiment`             | `user_sentiment_type` | User sentiment score                         |
| `user_sentiment_reasoning`   | `String`              | Reasoning behind the user sentiment score    |
| `goal_achieved`              | `goal_achieved_type`  | Goal achievement status                      |
| `goal_achieved_reasoning`    | `String`              | Reasoning behind the goal achievement status |
| `error_count`                | `Int`                 | Number of errors in session                  |

### Session properties

| Field                          | Type      | Description                                                                      |
| ------------------------------ | --------- | -------------------------------------------------------------------------------- |
| `is_contained`                 | `Boolean` | Session handled entirely by AI                                                   |
| `is_covered`                   | `Boolean` | Session topics within AI scope                                                   |
| `is_meaningful`                | `Boolean` | Meaningful conversation                                                          |
| `is_test`                      | `Boolean` | Test/preview session                                                             |
| `tags`                         | `_text`   | Associated tags                                                                  |
| `insights`                     | `jsonb`   | Session insights data                                                            |
| `participated_agents`          | `Array`   | Human agents involved (empty array if none)                                      |
| `participated_brains`          | `Array`   | AI agents involved with details (`brain_id`, `brain_version`, `brain_parent_id`)       |
| `participated_collections`     | `Array`   | Knowledge base collection IDs used                                               |
| `participated_language_models` | `Array`   | Language models used with details (model_id, brain_parent_id, language_model_id) |

## Pagination

`list_sessions` accepts `row_limit` and `row_offset` so you can page through results without re-issuing increasingly large queries. To show a total row count alongside the current page (for example in a paginated UI), combine it with `list_sessions_count`, which accepts the same filtering arguments and returns just the total.

```graphql
query ListSessionsPaginated(
  $accountId: uuid!
  $startDate: timestamp
  $endDate: timestamp
  $rowLimit: Int
  $rowOffset: Int
) {
  rows: list_sessions(
    args: {
      account_id: $accountId
      start_time: $startDate
      end_time: $endDate
      row_limit: $rowLimit
      row_offset: $rowOffset
    }
  ) {
    session_id
    start_time
    end_time
    channel
    rating
  }
  total: list_sessions_count(
    args: {
      account_id: $accountId
      start_time: $startDate
      end_time: $endDate
    }
  ) {
    total_count
  }
}
```

Use the same filter arguments on both functions so the total matches the filtered result set.

## Export many transcripts

`list_sessions` returns session metadata only. It has no message text. To export the transcripts of
many sessions, page through `list_sessions`, then call [`get_session`](https://docs.moveo.ai/api/analytics/get-session.md) for each
`session_id`. The `messages` field of `get_session` holds the transcript. The Analytics API has no
single call that returns the transcripts of many sessions.

1. Create an API key of the type **Analytics**. See [API keys](/docs/platform/platform-api-keys).
2. Call `list_sessions` with your filters, `row_limit`, and `row_offset`. Increase `row_offset` by
   `row_limit` until a page returns fewer rows than `row_limit`.
3. For each `session_id`, call `get_session`. Pass the `start_time` of the session as the start of
   the search window, so the query runs faster.
4. Save the `messages` array of each session.

This Node.js 18 example exports the sessions of one week to a JSON Lines file:

```javascript
import { appendFileSync } from "node:fs";

const URL = "https://logs.moveo.ai/v1/graphql";
const HEADERS = {
  "Content-Type": "application/json",
  Authorization: `apikey ${process.env.MOVEO_ANALYTICS_KEY}`,
  "X-Moveo-Account-Id": process.env.MOVEO_ACCOUNT_ID,
};

async function gql(query, variables) {
  const res = await fetch(URL, {
    method: "POST",
    headers: HEADERS,
    body: JSON.stringify({ query, variables }),
  });
  const body = await res.json();
  if (body.errors) throw new Error(JSON.stringify(body.errors));
  return body.data;
}

const LIST = `query ($accountId: uuid!, $start: timestamp, $end: timestamp, $limit: Int, $offset: Int) {
  list_sessions(args: { account_id: $accountId, start_time: $start, end_time: $end,
    row_limit: $limit, row_offset: $offset }) { session_id start_time end_time }
}`;
const GET = `query ($id: String!, $start: timestamp) {
  get_session(args: { session_id: $id, start_time: $start }) {
    session_id channel messages
  }
}`;

const limit = 100;
for (let offset = 0; ; offset += limit) {
  const { list_sessions: page } = await gql(LIST, {
    accountId: process.env.MOVEO_ACCOUNT_ID,
    start: "2026-10-01",
    end: "2026-10-08",
    limit,
    offset,
  });
  for (const s of page) {
    const { get_session } = await gql(GET, {
      id: s.session_id,
      start: s.start_time,
    });
    appendFileSync("transcripts.jsonl", JSON.stringify(get_session[0]) + "\n");
  }
  if (page.length < limit) break;
}
```

To get one transcript through the REST API instead, call
[`GET /v1/sessions/{session_id}/transcript`](/api/rest/get-session-transcript-top-level) with a
`manage` API key. The Moveo MCP server has the same one-session read in
`moveo_get_session_transcript`, but it cannot list sessions.

## Common use cases

**Basic query**

Get sessions for a specific desk within a date range:

```json
{
  "accountId": "b3de1234-5678-90ab-cdef-1234567890ab",
  "deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

**Poor ratings**

Get sessions with ratings of 1-3:

```json
{
  "accountId": "b3de1234-5678-90ab-cdef-1234567890ab",
  "deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
  "ratings": "{1,2,3}",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

**Escalated sessions**

Find non-contained sessions (escalated to human):

```json
{
  "accountId": "b3de1234-5678-90ab-cdef-1234567890ab",
  "brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}",
  "isContained": false,
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

**With recordings**

Only sessions that have a call recording attached:

```json
{
  "accountId": "b3de1234-5678-90ab-cdef-1234567890ab",
  "hasRecording": true,
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

**Specific user**

Find sessions for a specific user:

```json
{
  "accountId": "b3de1234-5678-90ab-cdef-1234567890ab",
  "userId": "mApUE81oSmzUWTA_w2ZbL",
  "channelUserId": "ePlhV5VeCXg"
}
```

## Example response

```json
{
  "data": {
    "list_sessions": [
      {
        "account_id": "8fb5d9d4-c3f0-4165-a8e9-41655e0fe624",
        "channel": "web",
        "channel_user_id": "PWxLcHkYCFEyOMhqPfMBP0KZG5DZ1lVMTPIiBAcVmw8",
        "csat_brain": null,
        "csat_human_agent": null,
        "desk_id": "4168c7cf-1ffc-4f2d-92f9-c5b9d7b2e4ff",
        "start_time": "2025-10-24T09:21:50.446",
        "end_time": "2025-10-24T09:22:22.143",
        "error_count": 0,
        "external_user_id": null,
        "goal_achieved": null,
        "insights": null,
        "integration_id": "92b8a685-9c06-4728-8f0e-446dbd7832d7",
        "is_contained": true,
        "is_covered": true,
        "is_meaningful": false,
        "is_test": true,
        "participated_agents": [],
        "participated_brains": [
          {
            "brain_id": "4d3f98e0-47da-418c-a487-99b5bdc180c4",
            "brain_version": "8",
            "brain_parent_id": "21f45e59-feab-445b-a133-0bb5bf26912f"
          }
        ],
        "participated_collections": ["427c3ea2-e481-4575-8d86-657c28a6bdfe"],
        "participated_language_models": [
          {
            "model_id": "base",
            "brain_parent_id": "21f45e59-feab-445b-a133-0bb5bf26912f",
            "language_model_id": null
          }
        ],
        "rating": null,
        "session_id": "58c0c8ca-4830-4782-adb8-31f1597bdad9",
        "tags": ["kg"],
        "thumbs_down": 0,
        "thumbs_up": 1,
        "total_user_messages": 3,
        "user_email": "test@test.com",
        "user_id": "YYz6i3khqoyEUrksmI-95",
        "user_name": "Visitor 48",
        "user_sentiment": null
      }
    ]
  }
}
```

## Full query reference

<details>
<summary>View complete GraphQL query with all available fields</summary>

```graphql
query ListSessions(
  $accountId: uuid!
  $brainIds: _uuid
  $channels: _text
  $channelTypes: _text
  $channelUserId: String
  $contactId: uuid
  $csatBrain: _int4
  $csatHumanAgent: _int4
  $deskIds: _uuid
  $startDate: timestamp
  $endDate: timestamp
  $externalUserId: String
  $goalAchieved: _int4
  $hasCollection: Boolean
  $hasRecording: Boolean
  $insightFilters: jsonb
  $integrationIds: _uuid
  $isContained: Boolean
  $isCovered: Boolean
  $isMeaningful: Boolean
  $isProactive: Boolean
  $isTest: Boolean
  $languageModelIds: _text
  $minNumThumbsDown: Int
  $minNumThumbsUp: Int
  $minNumUserMessages: Int
  $ratings: _int4
  $sessionId: String
  $tags: _text
  $userEmail: String
  $userId: String
  $userName: String
  $userSentiment: _int4
  $agentIds: _text
  $rowLimit: Int
  $rowOffset: Int
) {
  list_sessions(
    args: {
      account_id: $accountId
      brain_parent_ids: $brainIds
      channels: $channels
      channel_types: $channelTypes
      channel_user_id: $channelUserId
      contact_id: $contactId
      csat_brain: $csatBrain
      csat_human_agent: $csatHumanAgent
      desk_ids: $deskIds
      start_time: $startDate
      end_time: $endDate
      external_user_id: $externalUserId
      goal_achieved: $goalAchieved
      has_collection: $hasCollection
      has_recording: $hasRecording
      insight_filters: $insightFilters
      integration_ids: $integrationIds
      is_contained: $isContained
      is_covered: $isCovered
      is_meaningful: $isMeaningful
      is_proactive: $isProactive
      is_test: $isTest
      language_model_ids: $languageModelIds
      min_num_thumbs_down: $minNumThumbsDown
      min_num_thumbs_up: $minNumThumbsUp
      min_num_user_messages: $minNumUserMessages
      ratings: $ratings
      session_id: $sessionId
      tags: $tags
      user_email: $userEmail
      user_id: $userId
      user_name: $userName
      user_sentiment: $userSentiment
      agent_ids: $agentIds
      row_limit: $rowLimit
      row_offset: $rowOffset
    }
  ) {
    account_id
    channel
    channel_type
    channel_user_id
    csat_brain
    csat_brain_reasoning
    csat_human_agent
    csat_human_agent_reasoning
    desk_id
    start_time
    end_time
    error_count
    external_user_id
    goal_achieved
    goal_achieved_reasoning
    insights
    integration_id
    is_contained
    is_covered
    is_meaningful
    is_test
    participated_agents
    participated_brains
    participated_collections
    participated_language_models
    rating
    session_id
    tags
    thumbs_down
    thumbs_up
    total_user_messages
    user_email
    user_id
    user_name
    user_sentiment
    user_sentiment_reasoning
  }
}
```

</details>
