Skip to content
Discord

List Agents For Folder

client.folders.agents.list(stringfolderID, AgentListParams { after, before, limit, 2 more } query?, RequestOptionsoptions?): AgentListResponse
GET/v1/folders/{folder_id}/agents

Get all agent IDs that have the specified folder attached.

ParametersExpand Collapse
folderID: string

The ID of the source in the format ‘source-

minLength43
maxLength43
query: AgentListParams { after, before, limit, 2 more }
after?: string | null

Cursor for pagination (agent ID). Returns results relative to this ID in the specified sort order. Expected format: ‘agent-

minLength42
maxLength42
before?: string | null

Cursor for pagination (agent ID). Returns results relative to this ID in the specified sort order. Expected format: ‘agent-

minLength42
maxLength42
limit?: number | null

Maximum number of agents to return

maximum200
order?: "asc" | "desc"

Sort order for agents by creation time. ‘asc’ for oldest first, ‘desc’ for newest first

One of the following:
"asc"
"desc"
order_by?: "created_at"

Field to sort by

ReturnsExpand Collapse
AgentListResponse = Array<string>

List Agents For Folder

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 agents = await client.folders.agents.list('source-123e4567-e89b-42d3-8456-426614174000');

console.log(agents);
[
  "string"
]
Returns Examples
[
  "string"
]