Apps API · KB Tree
KB Tree: 13 个接口
GET /api/v1/kbs/{kb_id}/tree
Get full tree
权限(scope): kb:file:read · 调用方式: appToken · operationId: get-full-tree
Required app scope: kb:file:read.
Returns the KB tree. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
kb_id |
path | string (uuid) | 是 | KB UUID |
回包
200OK —application/json·DataResponseListTreeNodeWithChildrenItemBodydefaultError —application/problem+json·D8Error
POST /api/v1/kbs/{kb_id}/tree/files
Create tree file node
权限(scope): kb:file:write · 调用方式: appToken · operationId: create-tree-file
Required app scope: kb:file:write.
Creates a tree file node. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
kb_id |
path | string (uuid) | 是 | KB UUID |
请求体
application/json · CreateFileNodeRequestBody
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
artifact_id |
string (uuid) | 是 | Artifact UUID |
name |
string | 是 | File node name |
parent_id |
string (uuid) | Parent node UUID |
回包
200OK —application/json·DataResponseTreeNodeItemBodydefaultError —application/problem+json·D8Error
POST /api/v1/kbs/{kb_id}/tree/files/batch-download
Batch get file downloads
权限(scope): kb:file:read · 调用方式: appToken · operationId: batch-get-file-download
Required app scope: kb:file:read.
Returns presigned file download URLs. When knowledge-base download tickets are enabled, download_url is a short-lived platform URL (download-artifact-ticket) instead of a storage URL and expires_at is the ticket expiry: single-use for inline=false, reusable until expiry for inline=true; the knowledge-base read access of the caller is re-checked when it is opened. Fetch it when the file is opened rather than keeping it. If a ticket cannot be issued the request fails with 503 ARTIFACT_ACCESS_UNAVAILABLE and no URL is returned. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
kb_id |
path | string (uuid) | 是 | KB UUID |
请求体
application/json · BatchGetFileDownloadRequestBody
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
inline |
boolean | 是 | Request inline content disposition |
node_ids |
array of string | 是 | Tree node UUIDs |
回包
200OK —application/json·DataResponseListFileDownloadResultItemBodydefaultError —application/problem+json·D8Error
POST /api/v1/kbs/{kb_id}/tree/folders
Create tree folder
权限(scope): kb:file:write · 调用方式: appToken · operationId: create-tree-folder
Required app scope: kb:file:write.
Creates a tree folder. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
kb_id |
path | string (uuid) | 是 | KB UUID |
请求体
application/json · CreateFolderRequestBody
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
name |
string | 是 | Folder name |
parent_id |
string (uuid) | Parent node UUID |
回包
200OK —application/json·DataResponseTreeNodeItemBodydefaultError —application/problem+json·D8Error
DELETE /api/v1/kbs/{kb_id}/tree/nodes/{node_id}
Delete tree node
权限(scope): kb:page:delete · 调用方式: appToken · operationId: delete-tree-node
Required app scope: kb:page:delete.
Deletes a tree node. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
kb_id |
path | string (uuid) | 是 | KB UUID |
node_id |
path | string (uuid) | 是 | Tree node UUID |
回包
200OK —application/json·DataResponseStruct {}BodydefaultError —application/problem+json·D8Error
GET /api/v1/kbs/{kb_id}/tree/nodes/{node_id}
Get tree node
权限(scope): kb:file:read · 调用方式: appToken · operationId: get-tree-node
Required app scope: kb:file:read.
Returns a tree node. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
kb_id |
path | string (uuid) | 是 | KB UUID |
node_id |
path | string (uuid) | 是 | Tree node UUID |
回包
200OK —application/json·DataResponseTreeNodeItemBodydefaultError —application/problem+json·D8Error
GET /api/v1/kbs/{kb_id}/tree/nodes/{node_id}/breadcrumb
Get tree breadcrumb
权限(scope): kb:file:read · 调用方式: appToken · operationId: get-tree-breadcrumb
Required app scope: kb:file:read.
Returns breadcrumb nodes. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
kb_id |
path | string (uuid) | 是 | KB UUID |
node_id |
path | string (uuid) | 是 | Tree node UUID |
回包
200OK —application/json·DataResponseListTreeNodeItemBodydefaultError —application/problem+json·D8Error
GET /api/v1/kbs/{kb_id}/tree/nodes/{node_id}/children
List tree children
权限(scope): kb:file:read · 调用方式: appToken · operationId: list-tree-children
Required app scope: kb:file:read.
Returns child tree nodes. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
kb_id |
path | string (uuid) | 是 | KB UUID |
node_id |
path | string (uuid) | 是 | Tree node UUID |
回包
200OK —application/json·DataResponseListTreeNodeItemBodydefaultError —application/problem+json·D8Error
GET /api/v1/kbs/{kb_id}/tree/nodes/{node_id}/download
Get file download
权限(scope): kb:file:read · 调用方式: appToken · operationId: get-file-download
Required app scope: kb:file:read.
Returns a presigned file download URL. When knowledge-base download tickets are enabled, download_url is a short-lived platform URL (download-artifact-ticket) instead of a storage URL and expires_at is the ticket expiry: single-use for inline=false, reusable until expiry for inline=true; the knowledge-base read access of the caller is re-checked when it is opened. Fetch it when the file is opened rather than keeping it. If a ticket cannot be issued the request fails with 503 ARTIFACT_ACCESS_UNAVAILABLE and no URL is returned. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
kb_id |
path | string (uuid) | 是 | KB UUID |
node_id |
path | string (uuid) | 是 | Tree node UUID |
inline |
query | boolean | Request inline content disposition |
回包
200OK —application/json·DataResponseFileDownloadItemBodydefaultError —application/problem+json·D8Error
POST /api/v1/kbs/{kb_id}/tree/nodes/{node_id}/move
Move tree node
权限(scope): kb:file:write · 调用方式: appToken · operationId: move-tree-node
Required app scope: kb:file:write.
Moves a tree node. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
kb_id |
path | string (uuid) | 是 | KB UUID |
node_id |
path | string (uuid) | 是 | Tree node UUID |
请求体
application/json · MoveNodeRequestBody
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
parent_id |
string (uuid) | New parent node UUID |
回包
200OK —application/json·DataResponseStruct {}BodydefaultError —application/problem+json·D8Error
GET /api/v1/kbs/{kb_id}/tree/nodes/{node_id}/preview
Get file preview info
权限(scope): kb:file:read · 调用方式: appToken · operationId: get-file-preview-info
Required app scope: kb:file:read.
Returns file preview metadata. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
kb_id |
path | string (uuid) | 是 | KB UUID |
node_id |
path | string (uuid) | 是 | Tree node UUID |
回包
200OK —application/json·DataResponseFilePreviewItemBodydefaultError —application/problem+json·D8Error
PATCH /api/v1/kbs/{kb_id}/tree/nodes/{node_id}/rename
Rename tree node
权限(scope): kb:file:write · 调用方式: appToken · operationId: rename-tree-node
Required app scope: kb:file:write.
Renames a tree node. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
kb_id |
path | string (uuid) | 是 | KB UUID |
node_id |
path | string (uuid) | 是 | Tree node UUID |
请求体
application/json · RenameNodeRequestBody
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
name |
string | 是 | Tree node name |
回包
200OK —application/json·DataResponseStruct {}BodydefaultError —application/problem+json·D8Error
GET /api/v1/kbs/{kb_id}/tree/roots
List tree roots
权限(scope): kb:file:read · 调用方式: appToken · operationId: list-tree-roots
Required app scope: kb:file:read.
Returns root tree nodes. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
kb_id |
path | string (uuid) | 是 | KB UUID |
回包
200OK —application/json·DataResponseListTreeNodeItemBodydefaultError —application/problem+json·D8Error
