Skip to main content
GET
/
api
/
v2
/
sessions
/
{id}
Retrieve a session
curl --request GET \
  --url https://agp.eu.hcompany.ai/api/v2/sessions/{id} \
  --header 'Authorization: Bearer <token>'
Retrieves the complete Session object, including the original request, current status, execution metadata, and latest_answer (the agent’s final answer once produced). This is the cursor-independent way to read a finished run’s result, with no event loop to drain. Auth is optional, so public shares are supported. Returns the Session object if the ID is valid and you have access. Returns 404 otherwise.

Path parameters

id
string
required
The session ID returned when the session was created.

Examples

hai sessions get a1b2c3d4-e5f6-7890-abcd-ef1234567890
Response
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "request": {
    "agent": "h/web-surfer-flash",
    "messages": [
      {"type": "user_message", "message": "Find the top 3 stories on Hacker News"}
    ]
  },
  "status": {
    "status": "completed",
    "error": null,
    "steps": 12,
    "usage_per_model": [
      {
        "name": "holo3-1-35b-a3b",
        "input_tokens": 24800,
        "output_tokens": 1420,
        "reasoning_tokens": 0
      }
    ],
    "subagent_session_ids": []
  },
  "agent_view_url": "https://platform.hcompany.ai/agents/sessions/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "latest_answer": "1. ... 2. ... 3. ...",
  "created_at": "2026-05-07T14:30:00Z",
  "started_at": "2026-05-07T14:30:02Z",
  "finished_at": "2026-05-07T14:31:15Z"
}

Errors

StatusCause
404Session not found, or you don’t have access to it.
If you only need to know whether the session has finished, poll the lighter, faster GET /sessions/{id}/status instead.