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

# List sessions

> Browse your sessions with filtering, sorting, and pagination.

Returns a paginated list of sessions visible to the authenticated user. Results are sorted by creation date (newest first) by default.

**Returns** a paginated list of [Session](/computer-use-agents/sessions/overview) summary objects.

***

## Query parameters

<ParamField query="page" type="integer" default="1">
  Page number (1-based).
</ParamField>

<ParamField query="size" type="integer" default="10">
  Items per page. Maximum: `100`.
</ParamField>

<ParamField query="sort" type="string" default="-created_at">
  Sort order. Options: `created_at`, `-created_at`.
</ParamField>

<ParamField query="status" type="string[]">
  Filter by session status. Multi-value. Values: `queued`, `pending`, `running`, `paused`, `idle`, `awaiting_tool_results`, `completed`, `failed`, `timed_out`, `interrupted`.
</ParamField>

<ParamField query="agent" type="string[]">
  Filter by agent identifier. Multi-value. Example: `web-price-finder`.
</ParamField>

<ParamField query="group_id" type="string">
  Filter by group ID. Returns all sessions tagged with this group.
</ParamField>

<ParamField query="parent_session_id" type="string">
  Filter by parent session ID. Returns only child sessions of the given parent.
</ParamField>

<ParamField query="schedule_id" type="string">
  Filter by [schedule](/computer-use-agents/schedules/overview) ID. Returns only sessions created by that schedule's fires.
</ParamField>

<ParamField query="search" type="string">
  Case-insensitive match on the session's first message or answer.
</ParamField>

<ParamField query="created_before" type="string">
  Only sessions created before this timestamp (ISO 8601).
</ParamField>

<ParamField query="created_after" type="string">
  Only sessions created after this timestamp (ISO 8601).
</ParamField>

<ParamField query="finished_before" type="string">
  Only sessions that finished before this timestamp (ISO 8601).
</ParamField>

<ParamField query="finished_after" type="string">
  Only sessions that finished after this timestamp (ISO 8601).
</ParamField>

<ParamField query="owner" type="string" default="me-in-organization">
  Access scope: `me` (your sessions anywhere), `me-in-organization` (your sessions in the current org), `organization` (everyone's sessions in the org), or `me-or-organization`.
</ParamField>

***

## Examples

### List your recent sessions

<CodeGroup>
  ```bash CLI theme={null}
  hai sessions list --size 5
  ```

  ```bash cURL theme={null}
  curl "https://agp.eu.hcompany.ai/api/v2/sessions?size=5" \
    -H "Authorization: Bearer $HAI_API_KEY"
  ```

  ```python Python theme={null}
  from hai_agents import Client

  client = Client()

  page = client.sessions.list_sessions(size=5)
  for summary in page.items:
      print(summary.id, summary.status)
  ```

  ```typescript TypeScript theme={null}
  import { HaiAgentsClient } from "hai-agents";

  const client = new HaiAgentsClient();

  const page = await client.sessions.listSessions({ size: 5 });
  for (const summary of page.items) {
    console.log(summary.id, summary.status);
  }
  ```
</CodeGroup>

```json Response theme={null}
{
  "items": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "agent": "h/web-surfer-flash",
      "status": "completed",
      "agent_view_url": "https://platform.hcompany.ai/agents/sessions/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "first_message": {"type": "user_message", "message": "Top 3 stories on Hacker News?", "images": [], "caller_id": "user"},
      "created_at": "2026-05-07T14:30:00Z",
      "started_at": "2026-05-07T14:30:02Z",
      "finished_at": "2026-05-07T14:31:15Z"
    },
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "agent": "web-price-finder",
      "status": "running",
      "agent_view_url": "https://platform.hcompany.ai/agents/sessions/b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "first_message": {"type": "user_message", "message": "Find direct flights CDG to NRT", "images": [], "caller_id": "user"},
      "created_at": "2026-05-07T14:25:00Z",
      "started_at": "2026-05-07T14:25:01Z",
      "finished_at": null
    }
  ],
  "page": 1,
  "total": 47
}
```

### Filter by status and agent

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://agp.eu.hcompany.ai/api/v2/sessions?status=running&agent=web-price-finder" \
    -H "Authorization: Bearer $HAI_API_KEY"
  ```

  ```python Python theme={null}
  page = client.sessions.list_sessions(status=["running"], agent=["web-price-finder"])
  ```

  ```typescript TypeScript theme={null}
  const page = await client.sessions.listSessions({
    status: ["running"],
    agent: ["web-price-finder"],
  });
  ```
</CodeGroup>

### List all sessions in a group

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://agp.eu.hcompany.ai/api/v2/sessions?group_id=trip-planning-001" \
    -H "Authorization: Bearer $HAI_API_KEY"
  ```

  ```python Python theme={null}
  page = client.sessions.list_sessions(group_id="trip-planning-001")
  ```

  ```typescript TypeScript theme={null}
  const page = await client.sessions.listSessions({ groupId: "trip-planning-001" });
  ```
</CodeGroup>

### Find the subagents a session spawned

[Multi-agent](/computer-use-agents/multi-agent) runs delegate work to child sessions. The parent's [status](/computer-use-agents/sessions/status) lists their IDs in `subagent_session_ids`; pass the parent's ID to `parent_session_id` to pull the whole roster in one call, each child labeled with the `agent` that ran it. Walk deeper trees by recursing on a child's own ID.

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://agp.eu.hcompany.ai/api/v2/sessions?parent_session_id=$PARENT_SESSION_ID" \
    -H "Authorization: Bearer $HAI_API_KEY"
  ```

  ```python Python theme={null}
  page = client.sessions.list_sessions(parent_session_id=parent_session_id)
  ```

  ```typescript TypeScript theme={null}
  const page = await client.sessions.listSessions({ parentSessionId });
  ```
</CodeGroup>

```json Response theme={null}
{
  "items": [
    {
      "id": "c3d4e5f6-a7b8-9012-cdef-234567890abc",
      "agent": "fast-searcher",
      "status": "completed",
      "agent_view_url": "https://platform.hcompany.ai/agents/sessions/c3d4e5f6-a7b8-9012-cdef-234567890abc",
      "first_message": {"type": "user_message", "message": "Search EV market-share figures for 2025", "images": [], "caller_id": "user"},
      "created_at": "2026-05-07T14:30:05Z",
      "started_at": "2026-05-07T14:30:06Z",
      "finished_at": "2026-05-07T14:30:41Z"
    },
    {
      "id": "d4e5f6a7-b8c9-0123-def4-34567890abcd",
      "agent": "visual-verifier",
      "status": "running",
      "agent_view_url": "https://platform.hcompany.ai/agents/sessions/d4e5f6a7-b8c9-0123-def4-34567890abcd",
      "first_message": {"type": "user_message", "message": "Verify the 2025 figure on the source page", "images": [], "caller_id": "user"},
      "created_at": "2026-05-07T14:30:42Z",
      "started_at": "2026-05-07T14:30:43Z",
      "finished_at": null
    }
  ],
  "page": 1,
  "total": 2
}
```

Each child is a session like any other: open it by `id` to poll its [status](/computer-use-agents/sessions/status), read its answer from [`/changes`](/computer-use-agents/sessions/changes), or replay its [events](/computer-use-agents/sessions/events).
