Session object fields idstringSession ID, format sesn_<ULID>typestringFixed as sessionstatusstringSession status: idle / running / terminatedstop_reasonobject / nullThe reason the session returned to idle. A discriminated union: null (running, or idle and just created) / {"type": "end_turn"} / {"type": "retries_exhausted"} / {"type": "requires_action", "pending_batch_id": "...", "pending_call_ids": [...]}. Only meaningful when status is idle; see Retrieve Session for full detailsagentobjectAgent configuration snapshot, including id/version/name/model/system/tools, etc.environment_idstringThe bound environment IDtitle / metadatastring / objectSession title and custom business metadataarchived_atstring / nullArchive time; null when not archivedcreated_at / updated_atstringCreation/last update time, ISO 8601environment_variablesobjectEnvironment variables injected into the session runtime as string key-value pairs; sandbox code can read them directly by name | Response example {
"data": [
{
"id": "sesn_xxx",
"type": "session",
"status": "idle",
"stop_reason": null,
"agent": {
"id": "agent_xxx",
"type": "agent",
"version": 1,
"name": "data-analyst",
"model": {"id": "qwen3.7-max"},
"system": "You are a data analysis expert who uses pandas to process CSV files.",
"tools": []
},
"environment_id": "env_xxx",
"title": "Q3 sales data analysis",
"metadata": {"biz_ticket_id": "1234"},
"archived_at": null,
"created_at": "2026-05-28T08:23:11.456000Z",
"updated_at": "2026-05-28T08:23:25.789000Z",
"environment_variables": {"API_BASE_URL": "https://api.example.com", "LOG_LEVEL": "info"}
}
],
"next_page": "xxx",
"request_id": "xxx"
}
The response contains data (an array of Session objects) and next_page (cursor for the next page). Session object fields are as follows: |