Agent get request
Request of get agent session
Endpoint
GET /api/agent/session/get/
Auth
Authorization: Bearer ${token}
Query Parameters
| Key | Default | Description |
|---|---|---|
| identity | Session identity |
Response
Json
[
{
"kind": "status",
"payload": {
"code": 0,
"message": ""
}
},
{
"kind": "entity",
"payload": {
"identity": "",
"workflow": "",
"created_at": "",
"history": [
{
"role": "",
"content": "",
"tool_calls": [
{
"id": "",
"name": "",
"argument": ""
}
],
"tool_results": [
{
"id": "",
"name": "",
"output": "",
"failed": false
}
]
}
],
"usage": {
"input": 0,
"output": 0,
"cache_write": 0,
"cache_read": 0
},
"latest": {
"model": "",
"input": "",
"output": ""
}
}
}
]
Notes
- Agent Permission Required
- Returns the session state: its context
workflow, native conversationhistory, tokenusage, and thelatestmodel call. latestis the most recent model call: itsmodelid and the clippedinputandoutputmessages (trimmed to 32 characters). Absent until the session has been prompted.historyis the native conversation — user and assistantroles, each turn'scontent, and the assistant'stool_callswith theirtool_results(afailedresult the agent recovered from).workflowis the context (most recently used) workflow, present once the session has one.- Live per-workflow data — steps, events, logs, stats, and artifacts — comes from the workflow API, not the agent endpoints.
created_athere is an RFC3339 timestamp string, unlike the Unixcreated_atin the list and create entities.