Skip to Content
kosemdocs
ReferenceAPIAgents

List agent events

Lists the events of an agent's transcript, oldest first, or newest first.

GET
/v1/projects/{project}/agents/{agent}/events

Lists the events of an agent's transcript, oldest first, or newest first.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

project*string

The project's ID.

Match^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$
agent*string

The agent's ID.

Match^ags_[0-7][0-9a-hjkmnp-tv-z]{25}$

Query Parameters

pageSize?integer

Maximum number of events to return. Defaults to 50; values above 500 are treated as 500. A page holds fewer once its events reach 2 MiB, which files can.

Formatint32
Range0 <= value
pageToken?string

Page token from a previous response, with the same orderBy.

orderBy?string

sequence, the default, lists the oldest events first; sequence desc lists the newest first, as a reader opening a long transcript wants.

Value in"sequence""sequence desc"

Response Body

OK

application/json
  1. response
events*array<>

Events, in the order asked: oldest first by default.

nextPageToken*string

Token for the next page; empty on the last page.

Example Request
curl -X GET 'https://api.kosem.ai/v1/projects/string/agents/string/events'
Example Response
{
  "events": [
    {
      "agentMessage": {
        "id": "string",
        "model": "string",
        "parts": [
          {
            "file": {
              "data": "string",
              "file": "string",
              "filename": "string",
              "mediaType": "string",
              "url": "http://example.com"
            },
            "reasoning": {
              "text": "string"
            },
            "text": {
              "text": "string"
            },
            "toolCall": {
              "id": "string",
              "input": "string",
              "tool": "string"
            }
          }
        ],
        "readSequence": 0,
        "stop": "END",
        "usage": {
          "cacheReadTokens": 0,
          "inputTokens": 0,
          "outputTokens": 0
        }
      },
      "configChange": {
        "author": "string",
        "changedFields": [
          "model"
        ],
        "config": {
          "environment": {
            "diskGib": 0,
            "env": {
              "property1": "string",
              "property2": "string"
            },
            "idleTimeoutSeconds": 0,
            "image": "string",
            "memoryMib": 0,
            "runnerPool": "string",
            "secrets": [
              {
                "credential": "string",
                "env": "string",
                "file": "string",
                "scope": {
                  "property1": null,
                  "property2": null
                },
                "secret": "string",
                "state": "ACTIVE",
                "stateReason": "string"
              }
            ],
            "stoppedTtlSeconds": 0,
            "vcpus": 0
          },
          "instructions": "string",
          "maxModelCalls": 0,
          "model": "string",
          "reasoningEffort": "",
          "tools": [
            "string"
          ]
        },
        "grantedSecrets": [
          "string"
        ],
        "removedSecrets": [
          "string"
        ]
      },
      "contextCleared": {
        "resultSequences": [
          0
        ],
        "throughSequence": 0
      },
      "contextSummary": {
        "summary": "string",
        "throughSequence": 0
      },
      "createTime": "2019-08-24T14:15:22Z",
      "interrupt": {
        "author": "string"
      },
      "jobEnded": {
        "command": {
          "command": "string",
          "durationMs": 0,
          "endReason": "string",
          "environmentStart": "STARTED",
          "exitCode": 0,
          "job": "string",
          "running": true,
          "secrets": [
            "string"
          ],
          "startDurationMs": 0,
          "stderr": "string",
          "stderrTruncated": true,
          "stdout": "string",
          "stdoutTruncated": true,
          "workingDirectory": "string"
        },
        "job": "string",
        "text": "string"
      },
      "sequence": 0,
      "status": {
        "awaitingCalls": [
          "string"
        ],
        "state": "IDLE",
        "stop": {
          "message": "string",
          "reason": "END_TURN"
        }
      },
      "toolResult": {
        "author": "string",
        "callId": "string",
        "content": [
          {
            "file": {
              "data": "string",
              "file": "string",
              "filename": "string",
              "mediaType": "string",
              "url": "http://example.com"
            },
            "reasoning": {
              "text": "string"
            },
            "text": {
              "text": "string"
            },
            "toolCall": {
              "id": "string",
              "input": "string",
              "tool": "string"
            }
          }
        ],
        "display": {
          "accessDecision": {
            "alias": "string",
            "approved": true,
            "expireTime": "2019-08-24T14:15:22Z",
            "note": "string",
            "scope": {
              "property1": null,
              "property2": null
            },
            "target": "string"
          },
          "answer": {
            "selected": [
              "string"
            ],
            "text": "string"
          },
          "command": {
            "command": "string",
            "durationMs": 0,
            "endReason": "string",
            "environmentStart": "STARTED",
            "exitCode": 0,
            "job": "string",
            "running": true,
            "secrets": [
              "string"
            ],
            "startDurationMs": 0,
            "stderr": "string",
            "stderrTruncated": true,
            "stdout": "string",
            "stdoutTruncated": true,
            "workingDirectory": "string"
          },
          "publishedSite": {
            "displayName": "string",
            "fileCount": 0,
            "home": true,
            "live": true,
            "newSite": true,
            "site": "string",
            "sizeBytes": 0,
            "uri": "string",
            "version": "string"
          },
          "todoList": {
            "items": [
              {
                "content": "string",
                "state": "PENDING"
              }
            ]
          },
          "webPage": {
            "characters": 0,
            "title": "string",
            "truncated": true,
            "url": "string"
          },
          "webSearch": {
            "query": "string",
            "results": [
              {
                "publishTime": "2019-08-24T14:15:22Z",
                "snippet": "string",
                "title": "string",
                "url": "string"
              }
            ]
          }
        },
        "isError": true,
        "tool": "string"
      },
      "toolStarted": {
        "callId": "string",
        "tool": "string"
      },
      "turn": 0,
      "userMessage": {
        "author": "string",
        "parts": [
          {
            "file": {
              "data": "string",
              "file": "string",
              "filename": "string",
              "mediaType": "string",
              "url": "http://example.com"
            },
            "reasoning": {
              "text": "string"
            },
            "text": {
              "text": "string"
            },
            "toolCall": {
              "id": "string",
              "input": "string",
              "tool": "string"
            }
          }
        ]
      },
      "warning": {
        "message": "string"
      }
    }
  ],
  "nextPageToken": "string"
}