Skip to main content
GET
/
agents
/
{agentId}
/
threads
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 threadSummary of client.threads.list('agent_abc123')) {
  console.log(threadSummary.id);
}
{
  "cursor": "<string>",
  "hasMore": true,
  "threads": [
    {
      "completedAt": "<string>",
      "createdAt": "<string>",
      "id": "<string>",
      "messageCount": 123,
      "model": "<string>",
      "parentThreadId": "<string>",
      "result": "<string>",
      "scheduleId": "<string>",
      "scheduleSeq": 123,
      "stepCount": 123
    }
  ]
}

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"

limit
string

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

Example:

"20"

scheduleId
string

Optional schedule id filter.

Example:

"schedule_abc123"

status
enum<string>

Optional thread status filter.

Available options:
idle,
running,
awaiting,
closed

Response

Threads page.

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