Skip to main content

Folders

Folders

@toothfairyai/sdk@latest…

Folder Management Module Handles folder CRUD operations for organizing documents.

Accessed via client.folders.

Methods

MethodHTTPEndpoint
createPOSTPOST /folder/create
getGETGET /folder/get/{id}
updatePOSTPOST /folder/update
deleteDELETEDELETE /folder/delete/{id}
listGETGET /folder/list
getRootFoldersderived
getSubfoldersderived
getTreederived
searchderived

create

Create a new folder

async create(
name: string,
options: {
description?: string;
emoji?: string;
status?: string;
parent?: string;
} = {}
)

Endpoint: POST /folder/create · API service

Request fields

FieldTypeRequiredDescription
idstringnoUnique identifier
workspaceidstringyesUnique workspace identifier (UUID v4)
namestringyesName of the resource
descriptionstringnoDetailed description of purpose and capabilities
emojistringnoEmoji icon for the folder
statusstringnoCurrent status of the resource

Allowed: active, inactive | | parent | string | no | ID of the parent folder (for nesting) | | allowedTopics | string | no | List of topic IDs the agent is restricted to (max 10) | | owner | string | no | Owner of this resource | | createdBy | string | no | ID of the user who created this resource | | updatedBy | string | no | ID of the user who last updated this resource |

Response fields

FieldTypeDescription
idstringUnique identifier for the folder
ownerstringOwner of the folder
namestringName of the folder
descriptionstringDescription of the folder
emojistringEmoji character representing the folder
statusstringStatus of the folder

Allowed: active, inactive | | allowedTopics | object | List of topic IDs the agent is restricted to (max 10) | | parent | string | Parent folder ID for nested folder structure | | workspaceID | string | Unique workspace identifier (UUID v4) | | createdBy | string | User ID who created the folder | | updatedBy | string | User ID who last updated the folder | | createdAt | string | Timestamp when this resource was created | | updatedAt | string | Timestamp when this resource was last updated |

Example

const result = await client.folders.create('…');

get

Get a folder by ID

async get(folderId: string)

Endpoint: GET /folder/get/{id} · API service

Response

Returns the Folder object — fields documented in the create section above.

Example

const result = await client.folders.get('agent-id');

update

Update an existing folder

async update(
folderId: string,
options: {
name?: string;
description?: string;
emoji?: string;
status?: string;
parent?: string;
} = {}
)

Endpoint: POST /folder/update · API service

Request fields

FieldTypeRequiredDescription
idstringyesUnique identifier
workspaceidstringnoUnique workspace identifier (UUID v4)
namestringnoName of the resource
descriptionstringnoDetailed description of purpose and capabilities
emojistringnoEmoji icon for the folder
statusstringnoCurrent status of the resource

Allowed: active, inactive | | parent | string | no | ID of the parent folder (for nesting) | | allowedTopics | string | no | List of topic IDs the agent is restricted to (max 10) | | owner | string | no | Owner of this resource | | createdBy | string | no | ID of the user who created this resource | | updatedBy | string | no | ID of the user who last updated this resource |

Response

Returns the Folder object — fields documented in the create section above.

Example

const result = await client.folders.update('agent-id');

delete

Delete a folder

async delete(folderId: string): Promise<

Endpoint: DELETE /folder/delete/{id} · API service

Response

Returns the Folder object — fields documented in the create section above.

Example

const result = await client.folders.delete('agent-id');

list

List folders in the workspace

async list(status?: string, limit?: number, offset?: number)

Endpoint: GET /folder/list · API service

Response

Returns the Folder object — fields documented in the create section above.

Example

const result = await client.folders.list();

getRootFolders

Get root folders (folders without a parent)

async getRootFolders()

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

const result = await client.folders.getRootFolders();

getSubfolders

Get subfolders of a parent folder

async getSubfolders(parentId: string)

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

const result = await client.folders.getSubfolders('agent-id');

getTree

Get folder tree structure

async getTree()

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

const result = await client.folders.getTree();

Search folders by name

async search(searchTerm: string)

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

const result = await client.folders.search('…');