Skip to main content
GET
/
agents
/
{agentId}
/
events
JavaScript
import Cerca from '@cerca-dev/sdk';

const client = new Cerca({
  apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const subscriptionEvent of client.events.listForAgent('agent_abc123')) {
  console.log(subscriptionEvent.event);
}
{
  "cursor": "<string>",
  "events": [
    {
      "event": {
        "agentId": "<string>",
        "fleetId": "<string>",
        "id": "<string>",
        "orgId": "<string>",
        "threadId": "<string>",
        "timestamp": "<string>",
        "data": {
          "agent": {
            "configuration": {
              "approvals": {
                "tools": {},
                "timeoutMs": 123
              },
              "defaultModel": "<string>",
              "instructions": "<string>",
              "tools": [
                "<string>"
              ]
            },
            "createdAt": "<string>",
            "fleetId": "<string>",
            "id": "<string>",
            "metadata": {
              "project": "alpha"
            },
            "orgId": "<string>",
            "updatedAt": "<string>",
            "userId": "<string>",
            "effective": {
              "approvals": {
                "tools": {},
                "timeoutMs": 123
              },
              "approvalsWritableByAgent": true,
              "defaultModel": "<string>",
              "lockedByFleet": [],
              "resolvedFromFleet": [],
              "tools": [],
              "instructions": "<string>"
            }
          }
        }
      },
      "seq": 123
    }
  ],
  "hasMore": true
}

Documentation Index

Fetch the complete documentation index at: https://docs.cerca.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agentId
string
required
Minimum string length: 1
Example:

"agent_abc123"

Query Parameters

cursor
string

Opaque pagination cursor returned by a previous request.

Example:

"cursor_abc123"

events
string

Comma-separated event type filter.

Example:

"thread.created,thread.completed"

history
enum<string>

When true, starts from the beginning of the retained buffer.

Available options:
true,
false
Example:

"true"

limit
string

Maximum number of items to return. Defaults to 20 and preserves parseInt semantics.

Example:

"20"

Response

Agent events page.

cursor
string | null
required
events
object[]
required
hasMore
boolean
required