List sessions
curl --request GET \
--url https://agp.eu.hcompany.ai/api/v2/sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://agp.eu.hcompany.ai/api/v2/sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agp.eu.hcompany.ai/api/v2/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agp.eu.hcompany.ai/api/v2/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://agp.eu.hcompany.ai/api/v2/sessions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://agp.eu.hcompany.ai/api/v2/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodySessions
List sessions
Browse your sessions with filtering, sorting, and pagination.
GET
/
api
/
v2
/
sessions
List sessions
curl --request GET \
--url https://agp.eu.hcompany.ai/api/v2/sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://agp.eu.hcompany.ai/api/v2/sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agp.eu.hcompany.ai/api/v2/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agp.eu.hcompany.ai/api/v2/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://agp.eu.hcompany.ai/api/v2/sessions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://agp.eu.hcompany.ai/api/v2/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyReturns 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 summary objects. Each row carries
Each child is a session like any other: open it by
last_activity_at, the time the session’s latest event was ingested (agent steps, status changes, user messages), so you can spot which live sessions are actually moving. It is null for sessions that predate the field.
Query parameters
integer
default:"1"
Page number (1-based).
integer
default:"10"
Items per page. Maximum:
100.string
default:"-created_at"
Sort order. Options:
created_at, -created_at.string[]
Filter by session status. Multi-value. Values:
queued, pending, running, paused, idle, awaiting_tool_results, completed, failed, timed_out, interrupted.string[]
Filter by agent identifier. Multi-value. Example:
web-price-finder.string
Filter by group ID. Returns all sessions tagged with this group.
string
Filter by parent session ID. Returns only child sessions of the given parent.
string
Case-insensitive match on the session’s first message or answer.
string
Only sessions created before this timestamp (ISO 8601).
string
Only sessions created after this timestamp (ISO 8601).
string
Only sessions that finished before this timestamp (ISO 8601).
string
Only sessions that finished after this timestamp (ISO 8601).
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.Examples
List your recent sessions
curl "https://agp.eu.hcompany.ai/api/v2/sessions?size=5" \
-H "Authorization: Bearer $HAI_API_KEY"
from hai_agents import Client
client = Client()
page = client.sessions.list_sessions(size=5)
for summary in page.items:
print(summary.id, summary.status)
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);
}
hai sessions list --size 5
Response
{
"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",
"last_activity_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,
"last_activity_at": "2026-05-07T14:29:58Z"
}
],
"page": 1,
"total": 47
}
Filter by status and agent
curl "https://agp.eu.hcompany.ai/api/v2/sessions?status=running&agent=web-price-finder" \
-H "Authorization: Bearer $HAI_API_KEY"
page = client.sessions.list_sessions(status=["running"], agent=["web-price-finder"])
const page = await client.sessions.listSessions({
status: ["running"],
agent: ["web-price-finder"],
});
List all sessions in a group
curl "https://agp.eu.hcompany.ai/api/v2/sessions?group_id=trip-planning-001" \
-H "Authorization: Bearer $HAI_API_KEY"
page = client.sessions.list_sessions(group_id="trip-planning-001")
const page = await client.sessions.listSessions({ groupId: "trip-planning-001" });
Find the subagents a session spawned
Multi-agent runs delegate work to child sessions. The parent’s status lists their IDs insubagent_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.
curl "https://agp.eu.hcompany.ai/api/v2/sessions?parent_session_id=$PARENT_SESSION_ID" \
-H "Authorization: Bearer $HAI_API_KEY"
page = client.sessions.list_sessions(parent_session_id=parent_session_id)
const page = await client.sessions.listSessions({ parentSessionId });
Response
{
"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",
"last_activity_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,
"last_activity_at": "2026-05-07T14:30:55Z"
}
],
"page": 1,
"total": 2
}
id to poll its status, read its answer from /changes, or replay its events.Last modified on September 11, 2026
Was this page helpful?