Levain LabsLevain Labs
ApiSessions

Get Session

Fetch session metadata and event timeline.

Fetch session metadata and event timeline.

since is an exclusive cursor on sequence_no — pass the last seen sequence number to receive only new events.

For the high-frequency event poll, prefer GET /sessions/{id}/events?since=N — it returns just the events plus state/last_activity_at and skips the metadata fields that don't change between polls.

GET
/api/v1/sessions/{session_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

session_id*Session Id
Formatuuid

Query Parameters

since?Since
Default0

Header Parameters

X-API-Key?string|null

Response Body

application/json

application/json

curl -X GET "https://api.levainlabs.com/api/v1/sessions/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "id": "string",
  "agent_id": "string",
  "agent_version_id": "string",
  "state": "string",
  "title": "string",
  "kind": "agent",
  "first_prompt": "string",
  "origin": "slack",
  "origin_provider": "string",
  "origin_provider_display": "string",
  "has_artifacts": true,
  "archived_at": "string",
  "created_at": "string",
  "last_activity_at": "string",
  "terminated_at": "string",
  "rounds": [],
  "events": [],
  "steered": true,
  "dispatched_run_id": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}