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

> ## Agent Instructions
> H Platform has four products: the Agents API (managed computer-use agents, base URL https://agp.eu.hcompany.ai/api/v2 or https://agp.hcompany.ai/api/v2 for the US), the Models API (OpenAI-compatible Holo vision-language models at https://api.hcompany.ai/v1), HoloDesktop CLI (Holo on the user's own desktop), and HoloTab (a free no-code Chrome extension that runs Holo in the user's browser, with recordable routines and schedules).
> Authenticate with a bearer API key from the HAI_API_KEY environment variable. SDKs: `pip install hai-agents` (Python, `from hai_agents import Client`) and `npm install hai-agents` (TypeScript, `import { HaiAgentsClient } from "hai-agents"`). CLI: `hai`.
> Agents do work in a browser or on a desktop; describe the task as an imperative instruction. To run a task quickly, prefer the pre-built agent `h/web-surfer-flash`. Read results from the session's `latest_answer` after it reaches a terminal status.
> Sessions are the unit of work; wait for a terminal status (completed, failed, timed_out, interrupted) before reading the answer. Use webhooks or the `changes` long-poll endpoint to follow progress.

# List sessions

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

Lists the sessions visible to you, newest first by default.

**Returns** a [page envelope](/agents-api/api-reference#pagination) whose `items` are session summaries (fields [below](#response)). Read a full session with [Retrieve](/agents-api/sessions/retrieve).

## Query parameters

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

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

<ParamField query="group_id" type="string">
  Only sessions tagged with this group.
</ParamField>

<ParamField query="parent_session_id" type="string">
  Only child sessions of this parent.
</ParamField>

<ParamField query="schedule_id" type="string">
  Only sessions created by this [schedule](/agents-api/schedules/overview).
</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 ISO 8601 timestamp.
</ParamField>

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

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

<ParamField query="finished_after" type="string">
  Only sessions that finished after this ISO 8601 timestamp.
</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>

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

## Response

<ResponseField name="id" type="string">
  Session UUID.
</ResponseField>

<ResponseField name="agent" type="string | null">
  Name of the agent that ran the session.
</ResponseField>

<ResponseField name="status" type="string">
  Current [status](/agents-api/sessions/overview#lifecycle).
</ResponseField>

<ResponseField name="agent_view_url" type="string | null">
  The session's [Agent View](/agents-api/observe-and-steer) page.
</ResponseField>

<ResponseField name="first_message" type="object | null">
  The first user message: `type`, `message`, `images`, `files`, `caller_id`.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 creation time.
</ResponseField>

<ResponseField name="started_at" type="string | null">
  When the agent started.
</ResponseField>

<ResponseField name="finished_at" type="string | null">
  When the session reached a terminal state.
</ResponseField>

<ResponseField name="last_activity_at" type="string | null">
  When the session's latest event was ingested (agent steps, status changes, user messages), to spot which live sessions are moving. `null` for sessions that predate the field.
</ResponseField>

<ResponseField name="anonymized_at" type="string | null">
  When the session's PII text and screenshots were irreversibly anonymized. `null` if not anonymized.
</ResponseField>

## Examples

### List your recent sessions

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

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

  ```python Python theme={"system"}
  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={"system"}
  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={"system"}
{
  "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": "Open Hacker News and list the top 3 stories with their URLs.", "images": [], "files": [], "caller_id": "user"},
      "created_at": "2026-05-07T14:30:00Z",
      "started_at": "2026-05-07T14:30:02Z",
      "finished_at": "2026-05-07T14:31:15Z",
      "last_activity_at": "2026-05-07T14:31:15Z",
      "anonymized_at": null
    },
    {
      "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": [], "files": [], "caller_id": "user"},
      "created_at": "2026-05-07T14:25:00Z",
      "started_at": "2026-05-07T14:25:01Z",
      "finished_at": null,
      "last_activity_at": "2026-05-07T14:29:58Z",
      "anonymized_at": null
    }
  ],
  "page": 1,
  "total": 47
}
```

### Filter by status and agent

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

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

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

### List all sessions in a group

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

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

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

### Find the subagents a session spawned

Pass a [multi-agent](/agents-api/multi-agent) parent's ID as `parent_session_id` to list its child sessions, each labeled with the `agent` that ran it. Recurse on a child's ID for deeper trees.

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

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

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

```json Response theme={"system"}
{
  "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": [], "files": [], "caller_id": "user"},
      "created_at": "2026-05-07T14:30:05Z",
      "started_at": "2026-05-07T14:30:06Z",
      "finished_at": "2026-05-07T14:30:41Z",
      "last_activity_at": "2026-05-07T14:30:41Z",
      "anonymized_at": null
    }
  ],
  "page": 1,
  "total": 1
}
```


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