> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galtea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List Sessions

> List sessions with optional filtering.

> [!WARNING]
>
> You are reading the docs of Galtea 5.13. [Read this page in the latest version](https://docs.galtea.ai/sdk/api/session/list.md).

## Returns

Returns a list of [Session](https://docs.galtea.ai/v5.13/concepts/product/version/session.md) objects.

## Example

```python theme={"system"}
sessions = galtea.sessions.list(version_id=version_id, limit=10)
```

## Parameters

**version\_id** `string | list[string]`

The ID or IDs of the version(s) to filter sessions by.

**test\_case\_id** `string | list[string]`

The ID or IDs of the test case(s) to filter sessions by.

**custom\_id** `string | list[string]`

The custom ID or IDs to filter sessions by.

**dataset\_id** `string | list[string]`

The ID or IDs of the dataset(s) to filter sessions by.

> [!NOTE]
>
> Deprecated alias: `test_id`.

**from\_created\_at** `str | int` (default: None)

Filter sessions created at or after this timestamp. Accepts ISO 8601 string (e.g., `'2024-01-01T00:00:00Z'`) or Unix timestamp in seconds. Can be used independently or together with `to_created_at`.

**to\_created\_at** `str | int` (default: None)

Filter sessions created at or before this timestamp. Accepts ISO 8601 string (e.g., `'2024-12-31T23:59:59Z'`) or Unix timestamp in seconds. Can be used independently or together with `from_created_at`.

**sort\_by\_created\_at** `string`

Sort sessions by creation date. Valid values are "asc" and "desc".

**offset** `int` (default: 0)

Number of sessions to skip before starting to collect results. Use for pagination.

**Default:** `0` (start from the beginning)

**limit** `int` (default: 10000)

Maximum number of sessions to return in a single request.

**Default:** `10000`

**id** `string | list[string]` (default: None)

The ID or IDs of the session(s) to retrieve.

**status** `string | list[string]` (default: None)

Filter sessions by status. Valid values are `PENDING`, `COMPLETED`, and `FAILED`. Accepts a single value or a list of values (results are OR-combined). Other string values are sent to the API unchanged, so values added in newer API versions can be used; the API rejects invalid ones.

**user\_id** `string | list[string]`

Filter by the ID of the user who launched the session. A production session has no launcher and never matches this filter. A session ingested from OpenTelemetry traces is production too, unless its spans name a test case; that one records the user of the API key that sent the traces, so it does match. This is an additional filter; it does not satisfy the scoping requirement below.

> [!NOTE]
>
> At least one of the scoping filters (`version_id`, `test_case_id`, `custom_id`, `dataset_id`, `id`) described above must be passed to the method. `status` and `user_id` are additional filters and do **not** satisfy this requirement on their own.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.