Skip to main content
GET
/
agents
/
{agentId}
/
threads
/
{threadId}
/
messages
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 message of client.threads.listMessages('agent_abc123', 'thread_abc123')) {
  console.log(message.content);
}
{
  "cursor": "<string>",
  "hasMore": true,
  "messages": [
    {
      "content": [
        {
          "text": "Hello",
          "type": "text"
        }
      ],
      "createdAt": "<string>",
      "seq": 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"

threadId
string
required
Minimum string length: 1
Example:

"thread_abc123"

Query Parameters

cursor
string

Cursor returned by a previous thread messages response.

Pattern: ^\d+$
Example:

"42"

fleetId
string

Optional fleet id for index-backed authorization.

limit
string

Maximum number of messages to include, capped at 500.

Pattern: ^\d+$
Example:

"100"

Response

Thread messages page.

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