folders
Classes
FoldersClient
FoldersClient(client: OWUIClientBase)
Bases: ResourceBase
Client for the Folders endpoints.
- Code Reference client Classes OpenWebUI Attributes folders
Source code in src/owui_client/client_base.py
Functions
get_folders
get_folders() -> List[FolderNameIdResponse]
Get all folders for the current user.
Returns:
| Type | Description |
|---|---|
List[FolderNameIdResponse]
|
List[FolderNameIdResponse]: A list of folders with basic information. |
Source code in src/owui_client/routers/folders.py
get_shared_folders
get_shared_folders() -> List[SharedFolderResponse]
Get all folders shared with the current user (not owned by them).
Lists folders the caller can access via direct user grants, group membership, or
public (user:*) grants. Each entry includes the owner's display name and the
highest permission the caller holds ('read' or 'write'). Child folders of a
shared root inherit the root's permission. Folders owned by the caller are excluded.
Requires the folders feature to be enabled and the features.folders permission.
Returns:
| Type | Description |
|---|---|
List[SharedFolderResponse]
|
List[SharedFolderResponse]: Folders shared with the current user. Empty if none. |
Source code in src/owui_client/routers/folders.py
create_folder
create_folder(form_data: FolderForm) -> FolderModel
Create a new root folder.
To create a nested folder, create a root folder and then move it using update_folder_parent_id_by_id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
FolderForm
|
The form data for creating the folder. |
required |
Returns:
| Type | Description |
|---|---|
FolderModel
|
|
Source code in src/owui_client/routers/folders.py
get_folder_by_id
get_folder_by_id(id: str) -> Optional[FolderModel]
Get a folder by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The folder ID. |
required |
Returns:
| Type | Description |
|---|---|
Optional[FolderModel]
|
Optional[FolderModel]: The folder model, or None if not found. |
Source code in src/owui_client/routers/folders.py
update_folder_name_by_id
update_folder_name_by_id(
id: str, form_data: FolderUpdateForm
) -> FolderModel
Update a folder's details (name, data, meta) by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The folder ID. |
required |
form_data
|
FolderUpdateForm
|
The update form data. |
required |
Returns:
| Type | Description |
|---|---|
FolderModel
|
|
Source code in src/owui_client/routers/folders.py
update_folder_parent_id_by_id
update_folder_parent_id_by_id(
id: str, form_data: FolderParentIdForm
) -> FolderModel
Move a folder to a new parent folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The folder ID. |
required |
form_data
|
FolderParentIdForm
|
The parent ID form data. |
required |
Returns:
| Type | Description |
|---|---|
FolderModel
|
|
Source code in src/owui_client/routers/folders.py
update_folder_is_expanded_by_id
update_folder_is_expanded_by_id(
id: str, form_data: FolderIsExpandedForm
) -> FolderModel
Update a folder's expansion status (is_expanded) by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The folder ID. |
required |
form_data
|
FolderIsExpandedForm
|
The is_expanded form data. |
required |
Returns:
| Type | Description |
|---|---|
FolderModel
|
|
Source code in src/owui_client/routers/folders.py
update_folder_access_by_id
update_folder_access_by_id(
id: str, form_data: FolderAccessGrantsForm
) -> FolderModel
Replace the access grants on a folder (share it with users, groups, or everyone).
The supplied access_grants list fully replaces the folder's existing grants.
Only the folder owner, an admin, or a user with write access may call this. For
non-admin users, grants that exceed their sharing permissions are silently stripped
(e.g. public or individual-user grants); admins are not filtered.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The folder ID. |
required |
form_data
|
FolderAccessGrantsForm
|
The access grants form. Each grant dict uses keys |
required |
Returns:
| Type | Description |
|---|---|
FolderModel
|
|
FolderModel
|
(the resulting grant dicts). |
Source code in src/owui_client/routers/folders.py
get_shared_folder_chats
List the chats inside a shared folder.
Returns chats across all users who placed a chat in the folder, each annotated
with owner_name and a readonly flag (True for chats not owned by the caller).
The caller needs at least read access to the folder; owners and admins get write.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The folder ID. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The shared-folder chats payload. |
dict
|
Dict Fields:
- |
Source code in src/owui_client/routers/folders.py
delete_folder_by_id
Delete a folder by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The folder ID. |
required |
delete_contents
|
Optional[bool]
|
Whether to delete the contents of the folder (chats, etc). Defaults to True. If False, contents might be moved or handled differently depending on the backend logic (usually chats are moved to root or detached). |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if successful. |