Skip to main content

Folders

Folders

toothfairyai@latest…

Manager for folder operations.

This manager provides methods to create, update, and manage folders including hierarchical operations.

Example:

>>> client = ToothFairyClient(api_key="...", workspace_id="...")
>>> folder = client.folders.create(
... name="Documents"
... )

Accessed via client.folders.

Methods

MethodHTTPEndpoint
createPOSTPOST /folder/create
getGETGET /folder/get/{folder_id}
updatePOSTPOST /folder/update
deleteDELETEDELETE /folder/delete/{folder_id}
listGETGET /folder/list
get_root_foldersderived
get_subfoldersderived
get_treederived
searchderived

create

Create a new folder.

def create(
name: str,
description: Optional[str] = None,
emoji: Optional[str] = None,
status: str = 'active',
parent: Optional[str] = None,
allowed_topics: Optional[List[str]] = None
) -> Folder

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 |

The Python SDK accepts snake_case keyword arguments and converts them to the camelCase wire fields shown above.

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

client.folders.create(name="…")

get

Get a folder by ID.

def get(folder_id: str) -> Folder

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

Response

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

Example

client.folders.get(folder_id="agent-id")

update

Update a folder.

def update(
folder_id: str,
name: Optional[str] = None,
description: Optional[str] = None,
emoji: Optional[str] = None,
status: Optional[str] = None,
parent: Optional[str] = None,
allowed_topics: Optional[List[str]] = None
) -> Folder

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 |

The Python SDK accepts snake_case keyword arguments and converts them to the camelCase wire fields shown above.

Response

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

Example

client.folders.update(folder_id="agent-id")

delete

Delete a folder.

def delete(folder_id: str) -> Dict[str, bool]

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

Response

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

Example

client.folders.delete(folder_id="agent-id")

list

List folders.

def list(
status: Optional[str] = None,
limit: Optional[int] = None,
offset: Optional[int] = None
) -> ListResponse

Endpoint: GET /folder/list · API service

Response

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

Example

client.folders.list()

get_root_folders

Get all root folders (folders without a parent).

def get_root_folders() -> List[Folder]

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

Example

client.folders.get_root_folders()

get_subfolders

Get all subfolders of a parent folder.

def get_subfolders(parent_id: str) -> List[Folder]

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

Example

client.folders.get_subfolders(parent_id="agent-id")

get_tree

Get the folder hierarchy as a tree structure.

def get_tree() -> List[FolderTreeNode]

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

Example

client.folders.get_tree()

Search folders by name.

def search(search_term: str) -> List[Folder]

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

Example

client.folders.search(search_term="…")