Agent get request

Request of get agent session

Endpoint

GET /api/agent/session/get/

Auth

Authorization: Bearer ${token}

Query Parameters

KeyDefaultDescription
identitySession 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 conversation history, token usage, and the latest model call.
  • latest is the most recent model call: its model id and the clipped input and output messages (trimmed to 32 characters). Absent until the session has been prompted.
  • history is the native conversation — user and assistant roles, each turn's content, and the assistant's tool_calls with their tool_results (a failed result the agent recovered from). workflow is 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_at here is an RFC3339 timestamp string, unlike the Unix created_at in the list and create entities.