Folders
Tags: files, organization, storage
File and document folder management
Resources
Request and response models used by the endpoints on this page.
AccessGrantResponse
| Field | Type | Required | Description |
|---|---|---|---|
accessMode | Integer | ✓ | |
assignmentId | Integer | ||
bounds | dict[str, Any] | ||
capabilityClass | String | ||
chatId | Integer | ||
consentMethod | String | ||
createdAt | DateTime | ✓ | |
dataTypeId | Integer | ||
dataTypeName | String | ||
expiresAt | DateTime | ||
granteeMemberId | Integer | ✓ | |
granteeMemberName | String | ||
grantorMemberId | Integer | ✓ | |
grantorMemberName | String | ||
id | Integer | ✓ | |
memberCredentialId | Integer | ||
resolvedAt | DateTime | ||
resourceId | Integer | ||
resourceLabel | String | ||
resourceType | String | ✓ | |
revocationReason | String | ||
revokedAt | DateTime | ||
revokedByMemberId | Integer | ||
revokedByMemberName | String | ||
status | String | ✓ | |
trigger | String | ✓ | |
uuid | String | ✓ |
Example:
{
"id": 0,
"uuid": "string",
"grantorMemberId": 0,
"granteeMemberId": 0,
"resourceType": "string",
"accessMode": 0,
"trigger": "string",
"status": "string",
"createdAt": "2024-01-01T00:00:00Z"
}
CreateFileFolderRequest
| Field | Type | Required | Description |
|---|---|---|---|
name | String | ✓ | |
parentId | Integer |
Example:
{
"name": "string"
}
FileEntryResponse
| Field | Type | Required | Description |
|---|---|---|---|
id | Integer | ✓ | |
kind | Literal['file', 'folder'] | ✓ | |
name | String | ✓ | |
size | Integer | Default: 0 |
Example:
{
"id": 0,
"name": "string",
"kind": "file",
"size": 0
}
FileFolderResponse
| Field | Type | Required | Description |
|---|---|---|---|
access | String | Default: private | |
ancestors | Array<FolderPathSegment> | Default: [] | |
childCount | Integer | Default: 0 | |
createdAt | DateTime | ✓ | |
description | String | ||
fileCount | Integer | Default: 0 | |
id | Integer | ✓ | |
index | Boolean | Default: False | |
indexingCompletedAt | DateTime | ||
indexingStartedAt | DateTime | ||
name | String | ✓ | |
ownerId | Integer | ||
ownerName | String | ||
parentId | Integer | ||
path | String | ||
shareable | Boolean | Default: False | |
updatedAt | DateTime | ✓ | |
uuid | String | ✓ |
Example:
{
"id": 0,
"name": "string",
"uuid": "string",
"childCount": 0,
"fileCount": 0,
"access": "private",
"shareable": false,
"index": false,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"ancestors": []
}
FileRoleAssociationResponse
| Field | Type | Required | Description |
|---|---|---|---|
accessMode | Integer | ✓ | |
memberRoleId | Integer | ✓ | |
memberRoleName | String | ✓ |
Example:
{
"memberRoleId": 0,
"memberRoleName": "string",
"accessMode": 0
}
FolderChildrenBatchResponse
| Field | Type | Required | Description |
|---|---|---|---|
childrenByParentId | Dictionary<Integer, Array<FileFolderResponse>> | ✓ |
Example:
{
"childrenByParentId": {}
}
FolderPathSegment
| Field | Type | Required | Description |
|---|---|---|---|
id | Integer | ✓ | |
name | String | ✓ |
Example:
{
"id": 0,
"name": "string"
}
FolderSearchResultResponse
| Field | Type | Required | Description |
|---|---|---|---|
content | String | ✓ | |
fileId | Integer | ✓ | |
fileUuid | String | ✓ | |
filename | String | ✓ | |
metadata | Object | ✓ | |
mimeType | String | ✓ | |
score | Number | ✓ | |
title | String | ✓ |
Example:
{
"content": "string",
"fileId": 0,
"fileUuid": "string",
"filename": "string",
"title": "string",
"mimeType": "string",
"score": 0.0,
"metadata": {}
}
FolderSharingResponse
| Field | Type | Required | Description |
|---|---|---|---|
access | String | ✓ | |
grants | Array<AccessGrantResponse> | ✓ | |
ownerId | Integer | ✓ | |
ownerName | String | ✓ | |
roleAssociations | Array<FileRoleAssociationResponse> | ✓ | |
shareable | Boolean | ✓ |
Example:
{
"ownerId": 0,
"ownerName": "string",
"access": "string",
"shareable": false,
"grants": [],
"roleAssociations": []
}
RoleAssociationEntry
| Field | Type | Required | Description |
|---|---|---|---|
accessMode | Integer | ✓ | |
memberRoleId | Integer | ✓ |
Example:
{
"memberRoleId": 0,
"accessMode": 0
}
SharingGrantEntry
| Field | Type | Required | Description |
|---|---|---|---|
accessMode | Integer | ✓ | |
granteeMemberId | Integer | ✓ |
Example:
{
"granteeMemberId": 0,
"accessMode": 0
}
UpdateFileFolderRequest
| Field | Type | Required | Description |
|---|---|---|---|
index | Boolean | ||
name | String | ||
parentId | Integer |
Example:
{}
UpdateFileRoleAssociationsRequest
| Field | Type | Required | Description |
|---|---|---|---|
associations | Array<RoleAssociationEntry> | ✓ |
Example:
{
"associations": []
}
UpdateFileSharingRequest
| Field | Type | Required | Description |
|---|---|---|---|
access | String | ✓ | |
grants | Array<SharingGrantEntry> | ✓ | |
roleAssociations | Array<RoleAssociationEntry> | ✓ | |
shareable | Boolean |
Example:
{
"access": "string",
"grants": [],
"roleAssociations": []
}
Endpoints
GET /api/v2/w/{workspace_uuid}/folders- ListPOST /api/v2/w/{workspace_uuid}/folders- CreateGET /api/v2/w/{workspace_uuid}/folders/children- ChildrenDELETE /api/v2/w/{workspace_uuid}/folders/{folder_id}- Delete Folder IdGET /api/v2/w/{workspace_uuid}/folders/{folder_id}- Get Folder IdPUT /api/v2/w/{workspace_uuid}/folders/{folder_id}- Update Folder IdGET /api/v2/w/{workspace_uuid}/folders/{folder_id}/entry- EntryPOST /api/v2/w/{workspace_uuid}/folders/{folder_id}/reindex- ReindexGET /api/v2/w/{workspace_uuid}/folders/{folder_id}/search- SearchGET /api/v2/w/{workspace_uuid}/folders/{folder_id}/sharing- SharingPUT /api/v2/w/{workspace_uuid}/folders/{folder_id}/sharing- Update SharingPUT /api/v2/w/{workspace_uuid}/folders/{folder_id}/sharing/roles- Update RolesDELETE /api/v2/w/{workspace_uuid}/folders/{folder_id}/sharing/roles/{member_role_id}- Delete Roles
List
GET /api/v2/w/{workspace_uuid}/folders
Description:
List child folders of the given parent folder.
Authentication: Requires workspace member
Parameters:
parent_id(Integer)
Response: List of FileFolderResponse
Create
POST /api/v2/w/{workspace_uuid}/folders
Description:
Create a new folder.
Authentication: Requires workspace member
Parameters:
folder(CreateFileFolderRequest)
Response: See FileFolderResponse
Children
GET /api/v2/w/{workspace_uuid}/folders/children
Description:
Readable children of each parent folder, in one response.
Same membership filter as GET /folders?parent_id=. Every requested id
is present; a parent with no readable children maps to an empty list.
Authentication: Requires workspace member
Parameters:
parent_ids(Annotated[list[int], Query(min_length=1, max_length=MAX_FOLDER_CHILDREN_PARENTS)])
Response: See FolderChildrenBatchResponse
Delete Folder Id
DELETE /api/v2/w/{workspace_uuid}/folders/{folder_id}
Description:
Delete a folder subtree. Root folders can only be emptied. Shared index rows cascade with their Files.
Authentication: Requires workspace member
Parameters:
folder_id(Integer)
Response: dict[str, str]
Get Folder Id
GET /api/v2/w/{workspace_uuid}/folders/{folder_id}
Description:
Get a specific folder by ID, including its children and files.
Authentication: Requires workspace member
Parameters:
folder_id(String)
Response: See FileFolderResponse
Update Folder Id
PUT /api/v2/w/{workspace_uuid}/folders/{folder_id}
Description:
Update a folder. Shared File chunks remain owned by their File versions.
Authentication: Requires workspace member
Parameters:
folder_id(Integer)folder(UpdateFileFolderRequest)
Response: See FileFolderResponse
Entry
GET /api/v2/w/{workspace_uuid}/folders/{folder_id}/entry
Description:
Resolve a known name; write permission permits stat, never a content read.
Authentication: Requires workspace member
Parameters:
folder_id(Integer)name(String)
Response: See FileEntryResponse
Reindex
POST /api/v2/w/{workspace_uuid}/folders/{folder_id}/reindex
Description:
Refresh one folder's Files in the shared workspace index asynchronously.
The next run refreshes text-bearing Files in the shared workspace index without embedding calls. Indexing timestamps expose progress. Starting a rebuild never changes discovery or sharing.
Authentication: Requires workspace member
Parameters:
folder_id(Integer)
Response: dict[str, str]
Search
GET /api/v2/w/{workspace_uuid}/folders/{folder_id}/search
Description:
Search indexed passages with lexical retrieval and relevance reranking.
Searches the shared workspace collection with BM25 candidates and query-time reranking. Scores are reranker relevance, or normalized BM25 when reranking is unavailable.
Args: folder_id: The folder ID to search in query: The search query text top_k: Number of results to return (default 5) all_files: Search every readable File in the drive instead of one folder's subtree (the file browser's "All files" scope) root_folder_id: The drive root the browser mounts for an "All files" search; omitted scopes to the selected folder's structural root ctx: The execution context
Returns: List of search results with content snippets and metadata
Authentication: Requires workspace member
Parameters:
folder_id(Integer)query(String)top_k(Integer)all_files(Boolean)root_folder_id(Integer)
Response: List of FolderSearchResultResponse
Sharing
GET /api/v2/w/{workspace_uuid}/folders/{folder_id}/sharing
Description:
Get complete sharing state for a folder.
Authentication: Requires workspace member
Parameters:
folder_id(Integer)
Response: See FolderSharingResponse
Update Sharing
PUT /api/v2/w/{workspace_uuid}/folders/{folder_id}/sharing
Description:
Batch-update the complete sharing state for a folder in a single transaction.
Authentication: Requires workspace member
Parameters:
folder_id(Integer)request- See UpdateFileSharingRequest
Response: See FolderSharingResponse
Update Roles
PUT /api/v2/w/{workspace_uuid}/folders/{folder_id}/sharing/roles
Description:
Set role associations for a folder (replaces all).
Authentication: Requires workspace member
Parameters:
folder_id(Integer)request- See UpdateFileRoleAssociationsRequest
Response: List of FileRoleAssociationResponse
Delete Roles
DELETE /api/v2/w/{workspace_uuid}/folders/{folder_id}/sharing/roles/{member_role_id}
Description:
Remove a single role's access to a folder.
Authentication: Requires workspace member
Parameters:
folder_id(Integer)member_role_id(Integer)
Response: dict[str, str]