# List sessions (/en/api-reference/api-ref/conversational-ai/platform/list-sessions)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

> Documentation: Conversational AI API.
> Documentation version: Preview.
> This document describes only this version. [Version index](/llms/doc-versions-convoai-api-v2.txt).


Retrieves the sessions in your project that match the filters.

- OpenAPI: /openapi/conversational-ai/rest-api-platform.en.yaml
- Operation ID: list-sessions
- Method: GET
- Path: /v1/projects/{appid}/sessions
- Endpoint: https://preview.ai.agora.io/conversational-ai/v1/projects/{appid}/sessions

## Servers

- https://preview.ai.agora.io/conversational-ai

By default, the response contains running sessions that started in the last two hours.


## Authorization

This endpoint requires authentication.

- `tokenAuth`
- `basicAuth`

## Parameters

- `appid` (path, required, string) - The App ID of your project.
- `channel` (query, optional, string) - Return only sessions in this RTC channel. The match is exact and case-sensitive. Telephony sessions have no RTC channel and never match.
- `status` (query, optional, string) - The statuses to include, separated by commas, for example `RUNNING,STOPPED`. Valid statuses are `IDLE`, `STARTING`, `RUNNING`, `STOPPING`, `STOPPED`, and `FAILED`.
  - Default: `RUNNING`
- `started_after` (query, optional, integer) - Return only sessions that started after this time, as a Unix timestamp in seconds. Defaults to two hours before the request.
  - Minimum: `0`
- `started_before` (query, optional, integer) - Return only sessions that started before this time, as a Unix timestamp in seconds. Defaults to the time of the request.
  - Minimum: `0`
- `limit` (query, optional, integer) - The maximum number of sessions to return on each page.
  - Default: `20`
  - Minimum: `1`
- `cursor` (query, optional, string) - The `next_cursor` value from the previous page of results. Omit it to get the first page. The cursor is opaque, so pass it back unchanged.

## Request body

No request body.

## Responses

### 200

The request was successful. The response body contains a page of sessions.

- `has_more` (boolean) - Whether more results are available after this page.
- `next_cursor` (string | null | null) - The cursor for the next page. Pass it in the `cursor` query parameter of your next request. `null` on the last page.
- `data` (object)
  - `data.count` (integer) - The number of sessions on this page.
  - `data.list` (array) - The sessions on this page.
    - `data.list.items` (object)
      - `data.list.items.agent_session_id` (string) - The ID of the session.
      - `data.list.items.status` (string) - The status of the session:

- `IDLE`: The session is idle.
- `STARTING`: The session is starting.
- `RUNNING`: The session is running.
- `STOPPING`: The session is stopping.
- `STOPPED`: The session has ended.
- `FAILED`: The session failed.
        - Allowed: `IDLE` | `STARTING` | `RUNNING` | `STOPPING` | `STOPPED` | `FAILED`
      - `data.list.items.start_ts` (integer) - The time the session was created, as a Unix timestamp in seconds.
### 401

Authentication is missing or invalid. The reason is `InvalidPermission`.

- `detail` (string, required) - A human-readable description of the error. It names the field or resource involved, when there is one. Don't parse it; branch on `reason` instead.
- `reason` (string, required) - A machine-readable error reason, such as `InvalidFieldValue` or `ResourceNotFound`. For all reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).
### default

The request failed. The response body contains the `reason` and `detail` of the failure. For possible reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).

- `detail` (string, required) - A human-readable description of the error. It names the field or resource involved, when there is one. Don't parse it; branch on `reason` instead.
- `reason` (string, required) - A machine-readable error reason, such as `InvalidFieldValue` or `ResourceNotFound`. For all reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).

## Response examples

### 200

```json
{
  "data": {
    "count": 1,
    "list": [
      {
        "agent_session_id": "a42ac95tp25py49fc37hp94vm67ht52h",
        "start_ts": 1735035893,
        "status": "RUNNING"
      }
    ]
  },
  "has_more": true,
  "next_cursor": "a42aj97dh44ve73km82yr34rr67pk75e"
}
```
