Share, flag and feedback
Flag a session
Flag a session for attention, or replace the note on its flag.
PUT
/
api
/
v2
/
sessions
/
{id}
/
flag
from hai_agents import Client
client = Client()
flag = client.sessions.flag_session(session_id, note="Wrong price extracted")
print(flag.flagged_at)
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);
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"}'
{
"flagged_at": "2026-05-07T15:02:11Z",
"note": "Wrong price extracted",
"flagged_by": "5f0c2a9e-1b3d-4e6f-8a7b-9c0d1e2f3a4b"
}
Behavior
The flag is shared: anyone who can see the session can raise, edit, or clear it. Members see other members’ sessions only when their organization allows it (see Visibility). A public share link does not grant flagging. Flagging an already flagged session replaces its note and keepsflagged_at and flagged_by from the first flag. On an anonymized session the note is not stored. Find flagged sessions with the flagged filter.
Path parameters
Request body
A body is required. To flag without a note, send{}.
Response
200 with the flag.
from hai_agents import Client
client = Client()
flag = client.sessions.flag_session(session_id, note="Wrong price extracted")
print(flag.flagged_at)
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);
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"}'
{
"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. |
Was this page helpful?
⌘I
from hai_agents import Client
client = Client()
flag = client.sessions.flag_session(session_id, note="Wrong price extracted")
print(flag.flagged_at)
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);
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"}'
{
"flagged_at": "2026-05-07T15:02:11Z",
"note": "Wrong price extracted",
"flagged_by": "5f0c2a9e-1b3d-4e6f-8a7b-9c0d1e2f3a4b"
}