Skip to content

Update Directory

client.beta.directories.update(stringdirectoryID, DirectoryUpdateParams { organization_id, project_id, description, name } params, RequestOptionsoptions?): DirectoryUpdateResponse { id, name, project_id, 5 more }
PATCH/api/v1/beta/directories/{directory_id}

Update directory metadata.

ParametersExpand Collapse
directoryID: string
params: DirectoryUpdateParams { organization_id, project_id, description, name }
organization_id?: string | null

Query param

formatuuid
project_id?: string | null

Query param

formatuuid
description?: string | null

Body param: Updated description for the directory.

name?: string | null

Body param: Updated name for the directory.

minLength1
ReturnsExpand Collapse
DirectoryUpdateResponse { id, name, project_id, 5 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
data_source_id?: string | null

Optional data source id the directory syncs from. Null if just manual uploads.

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.

updated_at?: string | null

Update datetime

formatdate-time

Update Directory

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
});

const directory = await client.beta.directories.update('directory_id');

console.log(directory.id);
{
  "id": "id",
  "name": "x",
  "project_id": "project_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "data_source_id": "data_source_id",
  "deleted_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
Returns Examples
{
  "id": "id",
  "name": "x",
  "project_id": "project_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "data_source_id": "data_source_id",
  "deleted_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "updated_at": "2019-12-27T18:11:19.117Z"
}