Skip to content
Sign up

List Conversations

client.conversations.list(ConversationListParams { agent_id, after, limit } query, RequestOptionsoptions?): ConversationListResponse { id, agent_id, created_at, 5 more }
get/v1/conversations/

List all conversations for an agent.

ParametersExpand Collapse
query: ConversationListParams { agent_id, after, limit }
agent_id: string

The agent ID to list conversations for

after?: string | null

Cursor for pagination (conversation ID)

limit?: number

Maximum number of conversations to return

ReturnsExpand Collapse
ConversationListResponse = Array<Conversation { id, agent_id, created_at, 5 more } >
id: string

The unique identifier of the conversation.

agent_id: string

The ID of the agent this conversation belongs to.

created_at?: string | null

The timestamp when the object was created.

formatdate-time
created_by_id?: string | null

The id of the user that made this object.

in_context_message_ids?: Array<string>

The IDs of in-context messages for the conversation.

last_updated_by_id?: string | null

The id of the user that made this object.

summary?: string | null

A summary of the conversation.

updated_at?: string | null

The timestamp when the object was last updated.

formatdate-time
List Conversations
import Letta from '@letta-ai/letta-client';

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

const conversations = await client.conversations.list({ agent_id: 'agent_id' });

console.log(conversations);
[
  {
    "id": "id",
    "agent_id": "agent_id",
    "created_at": "2019-12-27T18:11:19.117Z",
    "created_by_id": "created_by_id",
    "in_context_message_ids": [
      "string"
    ],
    "last_updated_by_id": "last_updated_by_id",
    "summary": "summary",
    "updated_at": "2019-12-27T18:11:19.117Z"
  }
]
Returns Examples
[
  {
    "id": "id",
    "agent_id": "agent_id",
    "created_at": "2019-12-27T18:11:19.117Z",
    "created_by_id": "created_by_id",
    "in_context_message_ids": [
      "string"
    ],
    "last_updated_by_id": "last_updated_by_id",
    "summary": "summary",
    "updated_at": "2019-12-27T18:11:19.117Z"
  }
]