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_folders—derived
get_subfolders—derived
get_tree—derived
search—derived

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​

Python kwargWire fieldTypeRequiredDescription
ididstringnoUnique identifier
workspace_idworkspaceidstringyesUnique workspace identifier (UUID v4)
namenamestringyesName of the resource
descriptiondescriptionstringnoDetailed description of purpose and capabilities
emojiemojistringnoEmoji icon for the folder
statusstatusstringnoCurrent status of the resource

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

Always pass snake_case keyword arguments — the Python kwarg column shows the exact name to use for each wire field (as a named parameter where it appears in the method signature, otherwise via **kwargs). The SDK converts it deterministically to the camelCase wire key the API expects. Passing camelCase directly is deprecated: it emits a warning and converts to the same wire key.

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​

Python kwargWire fieldTypeRequiredDescription
ididstringyesUnique identifier
workspace_idworkspaceidstringnoUnique workspace identifier (UUID v4)
namenamestringnoName of the resource
descriptiondescriptionstringnoDetailed description of purpose and capabilities
emojiemojistringnoEmoji icon for the folder
statusstatusstringnoCurrent status of the resource

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

Always pass snake_case keyword arguments — the Python kwarg column shows the exact name to use for each wire field (as a named parameter where it appears in the method signature, otherwise via **kwargs). The SDK converts it deterministically to the camelCase wire key the API expects. Passing camelCase directly is deprecated: it emits a warning and converts to the same wire key.

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="…")