> ## 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 three 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), and HoloTab (a free no-code Chrome extension that runs Holo in the user's browser, with recordable routines and schedules). The `holo` CLI (`pip install "hai-agents[cli]"`) runs Agents API agents from a terminal, drives the user's own desktop with `-a h/holo-desktop`, and serves coding agents through `holo mcp`.
> 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: `holo`.
> 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.

# Flag a session

> Flag a session for attention, or replace the note on its flag.

## Behavior

The flag is shared: anyone who can see the session can raise, edit, or [clear](https://hub.hcompany.ai/agents-api/sessions/unflag.md) it. Members see other members' sessions only when their organization allows it (see [Visibility](https://hub.hcompany.ai/agents-api/sessions/visibility.md)). A public [share link](https://hub.hcompany.ai/agents-api/sessions/share.md) does not grant flagging.

Flagging an already flagged session replaces its note and keeps `flagged_at` and `flagged_by` from the first flag. On an [anonymized](https://hub.hcompany.ai/agents-api/sessions/list.md#param-anonymized-at) session the note is not stored. Find flagged sessions with the [`flagged`](https://hub.hcompany.ai/agents-api/sessions/list#param-flagged) filter.

## Path parameters

**id** `string` *required*

The session ID.

## Request body

A body is required. To flag without a note, send `{}`.

**note** `string`

Why the session needs attention, up to 2000 characters.

## Response

`200` with the flag.

**flagged\_at** `string` *required*

ISO 8601 time the session was first flagged.

**note** `string | null`

Why the session needs attention.

**flagged\_by** `string | null`

ID of the user who first flagged the session.

```python Python theme={"system"}
from hai_agents import Client

client = Client()

flag = client.sessions.flag_session(session_id, note="Wrong price extracted")
print(flag.flagged_at)
```

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

const client = new HaiAgentsClient();

const flag = await client.sessions.flagSession({
  id: sessionId,
  note: "Wrong price extracted",
});
console.log(flag.flaggedAt);
```

```bash cURL theme={"system"}
curl -X PUT https://agp.eu.hcompany.ai/api/v2/sessions/$SESSION_ID/flag \
  -H "Authorization: Bearer $HAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"note": "Wrong price extracted"}'
```

```json 200 theme={"system"}
{
  "flagged_at": "2026-05-07T15:02:11Z",
  "note": "Wrong price extracted",
  "flagged_by": "5f0c2a9e-1b3d-4e6f-8a7b-9c0d1e2f3a4b"
}
```

## Errors

| Status | Cause |
| - | - |
| `404` | Not found, or not visible to you. |
| `422` | No request body, or `note` is longer than 2000 characters. |


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