Skip to content
Letta Platform Letta Platform Letta Docs
Sign up

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

Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order

before?: string | null

Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order

limit?: number | null

Maximum number of agents to return

order?: "asc" | "desc"

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

Accepts 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"
]