Skip to content
Framework Docs

List Directories

client.beta.directories.list(DirectoryListParams { include_deleted, name, organization_id, 4 more } query?, RequestOptionsoptions?): PaginatedCursor<DirectoryListResponse { id, name, project_id, 7 more } >
GET/api/v1/beta/directories

List Directories

ParametersExpand Collapse
query: DirectoryListParams { include_deleted, name, organization_id, 4 more }
include_deleted?: boolean
name?: string | null
organization_id?: string | null
page_size?: number | null
page_token?: string | null
project_id?: string | null
type?: "user" | "index" | "ephemeral" | null
One of the following:
"user"
"index"
"ephemeral"
ReturnsExpand Collapse
DirectoryListResponse { id, name, project_id, 7 more }

API response schema for a directory.

id: string

Unique identifier for the directory.

name: string

Human-readable name for the directory.

minLength1
project_id: string

Project the directory belongs to.

created_at?: string | null

Creation datetime

formatdate-time
deleted_at?: string | null

Optional timestamp of when the directory was deleted. Null if not deleted.

formatdate-time
description?: string | null

Optional description shown to users.

expires_at?: string | null

When this directory expires and is eligible for cleanup.

formatdate-time
system_metadata?: Record<string, unknown> | null

Reserved system-managed metadata.

type?: "user" | "index" | "ephemeral" | "system_ephemeral" | null

Directory type: 'user', 'index', 'ephemeral', or 'system_ephemeral'.

One of the following:
"user"
"index"
"ephemeral"
"system_ephemeral"
updated_at?: string | null

Update datetime

formatdate-time

List Directories

import LlamaCloud from '@llamaindex/llama-cloud';

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

// Automatically fetches more pages as needed.
for await (const directoryListResponse of client.beta.directories.list()) {
  console.log(directoryListResponse.id);
}
{
  "items": [
    {
      "id": "id",
      "name": "x",
      "project_id": "project_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "deleted_at": "2019-12-27T18:11:19.117Z",
      "description": "description",
      "expires_at": "2019-12-27T18:11:19.117Z",
      "system_metadata": {
        "foo": "bar"
      },
      "type": "user",
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}
Returns Examples
{
  "items": [
    {
      "id": "id",
      "name": "x",
      "project_id": "project_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "deleted_at": "2019-12-27T18:11:19.117Z",
      "description": "description",
      "expires_at": "2019-12-27T18:11:19.117Z",
      "system_metadata": {
        "foo": "bar"
      },
      "type": "user",
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}