Folder API¶
The Folder API manages the hierarchical organization of content in the Unique AI knowledge base.
Overview¶
Organize content into folder structures with:
- Folder creation and management
- Access control
- Ingestion configuration
- Path-based or ID-based operations
Methods¶
unique_sdk.Folder.get_info - Get folder information
Get folder information by scope ID or path.
Parameters:
scopeId(str, optional) - Folder scope ID (required iffolderPathnot provided)folderPath(str, optional) - Folder path (required ifscopeIdnot provided)
Returns:
Returns a FolderInfo object.
Example - By Scope ID:
By Path:
unique_sdk.Folder.get_folder_path - Get folder path
Compatibility
Compatible with release >.48
Get the complete folder path for a scope ID.
Parameters:
scope_id(str, required) - Folder scope ID
Returns:
Returns a FolderPathResponse object.
Example:
unique_sdk.Folder.get_infos - Get paginated folders list
Get paginated list of folders, optionally filtered by parent.
Parameters:
parentId(str, optional) - Parent folder ID (if not provided, returns root folders)skip(int, optional) - Number of folders to skip (default: 0)take(int, optional) - Number of folders to return
Returns:
Returns a FolderInfos object.
Example - Get All Root Folders:
Get Subfolders:
unique_sdk.Folder.create_paths - Create folder paths
Create multiple folder paths at once. Creates missing folders in the path.
Parameters:
paths(List[str], required) - List of folder paths to createinheritAccess(bool, optional) - Whether to inherit access permissions from parent folders (default:True)
Returns:
Returns a CreateFolderStructureResponse object.
Example - Basic Creation:
Without Inheriting Access:
unique_sdk.Folder.update - Update folder properties
Update folder properties: name or parent folder.
Parameters:
scopeId(str, optional) - Folder scope ID (required iffolderPathnot provided)folderPath(str, optional) - Folder path (required ifscopeIdnot provided)name(str, optional) - New folder nameparentId(str | None, optional) - New parent folder ID (useNoneto move to root)parentFolderPath(str, optional) - New parent folder path
Returns:
Returns a Folder object.
Example - Move to New Parent by Path:
Move and Rename:
Move to Root:
unique_sdk.Folder.delete - Delete folder
Compatibility
Compatible with release >.36
Delete a folder by scope ID or path.
Parameters:
scopeId(str, optional) - Folder scope ID (required iffolderPathnot provided)folderPath(str, optional) - Folder path (required ifscopeIdnot provided)recursive(bool, optional) - Delete subfolders and contents (likerm -rf)
Returns:
Returns a DeleteResponse object.
Example - Non-Recursive Delete (Empty Folders Only):
Recursive Delete:
unique_sdk.Folder.update_ingestion_config - Update ingestion config
Update ingestion configuration for a folder and optionally its subfolders.
Parameters:
scopeId(str, optional) - Folder scope ID (required iffolderPathnot provided)folderPath(str, optional) - Folder path (required ifscopeIdnot provided)ingestionConfig(IngestionConfig, required) - Ingestion configuration. SeeFolder.IngestionConfigfor structure.applyToSubScopes(bool, required) - Whether to apply config to subfolders
Returns:
Returns a Folder object.
Example - By Scope ID:
By Path:
unique_sdk.Folder.add_access - Grant access permissions
Grant access permissions to a folder.
Parameters:
scopeId(str, optional) - Folder scope ID (required iffolderPathnot provided)folderPath(str, optional) - Folder path (required ifscopeIdnot provided)scopeAccesses(List[ScopeAccess], required) - List of access permissions. SeeFolder.ScopeAccessfor structure.applyToSubScopes(bool, required) - Whether to apply access to subfolders
Returns:
Returns a Folder object.
Example - Add Group Access:
By Path:
unique_sdk.Folder.remove_access - Revoke access permissions
Revoke access permissions from a folder.
Parameters:
scopeId(str, optional) - Folder scope ID (required iffolderPathnot provided)folderPath(str, optional) - Folder path (required ifscopeIdnot provided)scopeAccesses(List[ScopeAccess], required) - List of access permissions to remove. SeeFolder.ScopeAccessfor structure.applyToSubScopes(bool, required) - Whether to remove access from subfolders
Returns:
Returns a Folder object or dict.
Example - By Scope ID:
By Path:
Use Cases¶
Organize Knowledge Base
Bulk Permission Management
Navigate Folder Tree
Best Practices¶
Use Paths for Readability
Apply Configs to Subfolders
Handle Deletion Failures
Input Types¶
Folder.ScopeAccess¶
The Folder.ScopeAccess type defines access permissions for a folder
Fields:
entityId(str, required) - User or group IDtype(Literal["READ", "WRITE"], required) - Access typeentityType(Literal["USER", "GROUP"], required) - Entity typecreatedAt(str, optional) - Creation timestamp (ISO 8601)
Used in: Folder.add_access(), Folder.remove_access()
Folder.IngestionConfig¶
The Folder.IngestionConfig type defines ingestion configuration for a folder
Fields:
uniqueIngestionMode(str, required) - Ingestion mode (e.g., "standard")chunkStrategy(str, optional) - Chunking strategy (e.g., "default")chunkMaxTokens(int, optional) - Maximum tokens per chunkchunkMaxTokensOnePager(int, optional) - Maximum tokens for one-page documentschunkMinTokens(int, optional) - Minimum tokens per chunkdocumentMinTokens(int, optional) - Minimum tokens per documentexcelReadMode(str, optional) - Excel reading modejpgReadMode(str, optional) - JPG reading modepdfReadMode(str, optional) - PDF reading modepptReadMode(str, optional) - PowerPoint reading modewordReadMode(str, optional) - Word document reading modecustomApiOptions(List[CustomApiOptions], optional) - Custom API optionsvttConfig(VttConfig, optional) - VTT configuration
Used in: Folder.update_ingestion_config()
Return Types¶
Folder¶
The Folder object represents a folder in the knowledge base
Fields:
id(str) - Unique folder identifier (scope ID)name(str) - Folder namescopeAccess(List[ScopeAccess]) - List of access permissions. SeeFolder.ScopeAccessfor structure.children(List[Children]) - List of child folders. SeeFolder.Childrenfor structure.
Returned by: Folder.update(), Folder.update_ingestion_config(), Folder.add_access(), Folder.remove_access()
Folder.Children¶
The Folder.Children type represents a child folder
Fields:
id(str) - Child folder IDname(str) - Child folder name
Used in: Folder.children
Folder.FolderInfo¶
The FolderInfo object represents folder information
Fields:
id(str) - Unique folder identifiername(str) - Folder nameingestionConfig(IngestionConfig) - Ingestion configuration. SeeFolder.IngestionConfigfor structure.createdAt(str | None) - Creation timestamp (ISO 8601)updatedAt(str | None) - Last update timestamp (ISO 8601)parentId(str | None) - Parent folder IDexternalId(str | None) - External system identifier
Returned by: Folder.get_info()
Folder.FolderInfos¶
The FolderInfos object contains paginated folder information
Fields:
folderInfos(List[FolderInfo]) - List of folder info objects. SeeFolder.FolderInfofor structure.totalCount(int) - Total number of matching folders
Returned by: Folder.get_infos()
Folder.FolderPathResponse¶
The FolderPathResponse object contains a folder path
Fields:
folderPath(str) - Complete folder path
Returned by: Folder.get_folder_path()
Folder.CreateFolderStructureResponse¶
The CreateFolderStructureResponse object contains created folder information
Fields:
createdFolders(List[CreatedFolder]) - List of created folders. SeeFolder.CreatedFolderfor structure.
Returned by: Folder.create_paths()
Folder.CreatedFolder¶
The CreatedFolder object represents a newly created folder
Fields:
id(str) - Folder IDobject(str) - Object type identifiername(str) - Folder nameparentId(str | None) - Parent folder ID
Used in: CreateFolderStructureResponse.createdFolders
Folder.DeleteResponse¶
The DeleteResponse object contains deletion results
Fields:
successFolders(List[DeleteFolderResponse]) - List of successfully deleted folders. SeeFolder.DeleteFolderResponsefor structure.failedFolders(List[DeleteFolderResponse]) - List of failed deletions. SeeFolder.DeleteFolderResponsefor structure.
Returned by: Folder.delete()
Folder.DeleteFolderResponse¶
The DeleteFolderResponse object represents a deletion result for a single folder
Fields:
id(str) - Folder IDname(str) - Folder namepath(str) - Folder pathfailReason(str, optional) - Failure reason if deletion failed
Used in: DeleteResponse.successFolders, DeleteResponse.failedFolders
Related Resources¶
- Content API - Manage files within folders
- Group API - Manage group permissions
- User API - Manage user permissions