List Folders
Retrieve all folders for the authenticated user
Authorization
RequiresENABLE_FOLDERS feature flag enabled and user permission features.folders or admin role.
Response
Unique identifier for the folder
Name of the folder
ID of the parent folder (null for root folders)
Whether the folder is expanded in the UI
Additional folder data including files and collections
Example Request
cURL
Example Response
200
Create Folder
Create a new folder
Request Body
Name of the folder to create
ID of the parent folder (omit for root folder)
Example Request
cURL
Example Response
200
400 Bad Request
Get Folder by ID
Retrieve a specific folder by ID
Path Parameters
Unique identifier of the folder
Example Request
cURL
Example Response
200
404 Not Found
Update Folder
Update folder name or data
Path Parameters
Unique identifier of the folder to update
Request Body
Updated name for the folder
Updated folder data
Example Request
cURL
Example Response
200
400 Bad Request
Update Folder Parent
Move folder to a different parent folder
Path Parameters
Unique identifier of the folder to move
Request Body
ID of the new parent folder (null to move to root)
Example Request
cURL
Example Response
200
400 Bad Request
Update Folder Expanded State
Update whether the folder is expanded in the UI
Path Parameters
Unique identifier of the folder
Request Body
Whether the folder should be expanded
Example Request
cURL
Example Response
200
Delete Folder
Delete a folder and optionally its contents
Path Parameters
Unique identifier of the folder to delete
Query Parameters
Whether to delete chats in the folder (default: true). If false, chats are moved to root.
Authorization
If the folder contains chats, requireschat.delete permission or admin role.
Example Request
cURL
Example Response
200
403 Forbidden
404 Not Found
Access Control
Folders Feature
- Requires
ENABLE_FOLDERSconfiguration flag to be enabled - Users must have
features.folderspermission or admin role - All folder operations are scoped to the authenticated user
Folder Integrity
- Automatically validates parent folder existence
- Orphaned folders are moved to root automatically
- Files and collections are validated for user access
- Invalid references are removed automatically
Nested Folders
- Folders support hierarchical parent-child relationships
- Deleting a parent folder recursively processes all subfolders
- Moving folders validates name uniqueness within the target parent
Chat Integration
- Folders can contain chats via
folder_idassociation - Deleting folders with chats requires
chat.deletepermission - Chats can be moved to root or deleted based on
delete_contentsflag