> ## 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.

## Returns

Returns a list of [Session](/concepts/product/version/session) objects.

## Example

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

## Parameters

<ResponseField name="version_id" type="string | list[string]" optional>
  The ID or IDs of the version(s) to filter sessions by.
</ResponseField>

<ResponseField name="test_case_id" type="string | list[string]" optional>
  The ID or IDs of the test case(s) to filter sessions by.
</ResponseField>

<ResponseField name="custom_id" type="string | list[string]" optional>
  The custom ID or IDs to filter sessions by.
</ResponseField>

<ResponseField name="test_id" type="string | list[string]" optional>
  The ID or IDs of the test(s) to filter sessions by.
</ResponseField>

<ResponseField name="from_created_at" type="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`.
</ResponseField>

<ResponseField name="to_created_at" type="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`.
</ResponseField>

<ResponseField name="sort_by_created_at" type="string" optional>
  Sort sessions by creation date. Valid values are "asc" and "desc".
</ResponseField>

<ResponseField name="offset" type="int" default="0" optional>
  Number of sessions to skip before starting to collect results. Use for pagination.

  **Default:** `0` (start from the beginning)
</ResponseField>

<ResponseField name="limit" type="int" default="10000" optional>
  Maximum number of sessions to return in a single request.

  **Default:** `10000`
</ResponseField>

<ResponseField name="id" type="string | list[string]" default="None">
  The ID or IDs of the session(s) to retrieve.
</ResponseField>

<ResponseField name="status" type="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.
</ResponseField>

<Note>
  At least one of the scoping filters (`version_id`, `test_case_id`, `custom_id`, `test_id`, `id`) described above must be passed to the method. `status` is an additional filter and does **not** satisfy this requirement on its own.
</Note>
