Skip to main content

Folders

Tags: files, organization, storage

File and document folder management

Resources​

Request and response models used by the endpoints on this page.

AccessGrantResponse​

FieldTypeRequiredDescription
accessModeInteger✓
assignmentIdInteger
boundsdict[str, Any]
capabilityClassString
chatIdInteger
consentMethodString
createdAtDateTime✓
dataTypeIdInteger
dataTypeNameString
expiresAtDateTime
granteeMemberIdInteger✓
granteeMemberNameString
grantorMemberIdInteger✓
grantorMemberNameString
idInteger✓
memberCredentialIdInteger
resolvedAtDateTime
resourceIdInteger
resourceLabelString
resourceTypeString✓
revocationReasonString
revokedAtDateTime
revokedByMemberIdInteger
revokedByMemberNameString
statusString✓
triggerString✓
uuidString✓

Example:

{
"id": 0,
"uuid": "string",
"grantorMemberId": 0,
"granteeMemberId": 0,
"resourceType": "string",
"accessMode": 0,
"trigger": "string",
"status": "string",
"createdAt": "2024-01-01T00:00:00Z"
}

CreateFileFolderRequest​

FieldTypeRequiredDescription
nameString✓
parentIdInteger

Example:

{
"name": "string"
}

FileEntryResponse​

FieldTypeRequiredDescription
idInteger✓
kindLiteral['file', 'folder']✓
nameString✓
sizeIntegerDefault: 0

Example:

{
"id": 0,
"name": "string",
"kind": "file",
"size": 0
}

FileFolderResponse​

FieldTypeRequiredDescription
accessStringDefault: private
ancestorsArray<FolderPathSegment>Default: []
childCountIntegerDefault: 0
createdAtDateTime✓
descriptionString
fileCountIntegerDefault: 0
idInteger✓
indexBooleanDefault: False
indexingCompletedAtDateTime
indexingStartedAtDateTime
nameString✓
ownerIdInteger
ownerNameString
parentIdInteger
pathString
shareableBooleanDefault: False
updatedAtDateTime✓
uuidString✓

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​

FieldTypeRequiredDescription
accessModeInteger✓
memberRoleIdInteger✓
memberRoleNameString✓

Example:

{
"memberRoleId": 0,
"memberRoleName": "string",
"accessMode": 0
}

FolderChildrenBatchResponse​

FieldTypeRequiredDescription
childrenByParentIdDictionary<Integer, Array<FileFolderResponse>>✓

Example:

{
"childrenByParentId": {}
}

FolderPathSegment​

FieldTypeRequiredDescription
idInteger✓
nameString✓

Example:

{
"id": 0,
"name": "string"
}

FolderSearchResultResponse​

FieldTypeRequiredDescription
contentString✓
fileIdInteger✓
fileUuidString✓
filenameString✓
metadataObject✓
mimeTypeString✓
scoreNumber✓
titleString✓

Example:

{
"content": "string",
"fileId": 0,
"fileUuid": "string",
"filename": "string",
"title": "string",
"mimeType": "string",
"score": 0.0,
"metadata": {}
}

FolderSharingResponse​

FieldTypeRequiredDescription
accessString✓
grantsArray<AccessGrantResponse>✓
ownerIdInteger✓
ownerNameString✓
roleAssociationsArray<FileRoleAssociationResponse>✓
shareableBoolean✓

Example:

{
"ownerId": 0,
"ownerName": "string",
"access": "string",
"shareable": false,
"grants": [],
"roleAssociations": []
}

RoleAssociationEntry​

FieldTypeRequiredDescription
accessModeInteger✓
memberRoleIdInteger✓

Example:

{
"memberRoleId": 0,
"accessMode": 0
}

SharingGrantEntry​

FieldTypeRequiredDescription
accessModeInteger✓
granteeMemberIdInteger✓

Example:

{
"granteeMemberId": 0,
"accessMode": 0
}

UpdateFileFolderRequest​

FieldTypeRequiredDescription
indexBoolean
nameString
parentIdInteger

Example:

{}

UpdateFileRoleAssociationsRequest​

FieldTypeRequiredDescription
associationsArray<RoleAssociationEntry>✓

Example:

{
"associations": []
}

UpdateFileSharingRequest​

FieldTypeRequiredDescription
accessString✓
grantsArray<SharingGrantEntry>✓
roleAssociationsArray<RoleAssociationEntry>✓
shareableBoolean

Example:

{
"access": "string",
"grants": [],
"roleAssociations": []
}

Endpoints​

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]


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:

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:

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]