Skip to main content
This endpoint returns the complete session history for a given agent, ordered newest-first by creation time. Each session record includes the metadata attached at creation and the ID of the key that was used to start it. Use this endpoint to audit agent activity, replay debugging timelines, or surface session IDs for downstream log queries.

Endpoint

GET /api/agent/v1/sessions/list/
Base URL: http://localhost:8000

Request headers

X-OTAS-USER-TOKEN
string
required
JWT obtained from the OTAS login endpoint, identifying the calling user.
X-OTAS-PROJECT-ID
string
required
UUID of the project the agent belongs to. The agent must be active and owned by this project or the request returns a 403.

Query parameters

agent_id
string
required
UUID of the agent whose sessions you want to retrieve.

Response

status
number
1 on success.
status_description
string
"agent_sessions_listed" on success.
response
object

Errors

Statusstatus_descriptionCause
400agent_id_requiredThe agent_id query parameter was not provided.
403agent_not_found_or_no_accessNo active agent with that UUID exists in the project, or the agent belongs to a different project.

Example

cURL
curl --request GET \
  --url "http://localhost:8000/api/agent/v1/sessions/list/?agent_id=d1e2f3a4-b5c6-7890-abcd-ef1234567890" \
  --header "X-OTAS-USER-TOKEN: <your-user-jwt>" \
  --header "X-OTAS-PROJECT-ID: 4b7e2f1a-9c3d-4e8b-a012-3f5d6e7c8b9a"
Response (200)
{
  "status": 1,
  "status_description": "agent_sessions_listed",
  "response": {
    "agent_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
    "sessions": [
      {
        "id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
        "agent_key_id": "c9d8e7f6-a5b4-3210-fedc-ba9876543210",
        "created_at": "2026-04-16T14:30:00.000000+00:00",
        "meta": {
          "task": "summarize",
          "input_length": 512
        }
      },
      {
        "id": "a9b8c7d6-e5f4-3210-9876-543210abcdef",
        "agent_key_id": "c9d8e7f6-a5b4-3210-fedc-ba9876543210",
        "created_at": "2026-04-16T09:15:00.000000+00:00",
        "meta": {}
      }
    ]
  }
}

Build docs developers (and LLMs) love