Apps API · KB Pages
KB Pages: 16 个接口
POST /api/v1/kbs/{kb_id}/pages
Create page
权限(scope): kb:page:write · 调用方式: appToken · operationId: create-kb-page
Required app scope: kb:page:write.
Creates a KB page. Response wrapped in standard envelope. A knowledge base that does not exist, was deleted, or is not visible to the caller answers 404 KB_NOT_FOUND (meta.kb_id); a missing parent folder in a live knowledge base answers 404 KB_ERROR.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
kb_id |
path | string (uuid) | 是 | KB UUID |
请求体
application/json · CreatePageRequestBody
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
body |
string | 是 | Page content body |
format |
string: markdown, plain_text |
是 | Page format |
message |
string | Revision message | |
parent_id |
string (uuid) | Parent node UUID | |
title |
string | 是 | Page title |
回包
200OK —application/json·DataResponseCreatedPageItemBodydefaultError —application/problem+json·D8Error
GET /api/v1/pages
List pages
权限(scope): kb:page:read · 调用方式: appToken · operationId: list-pages
Required app scope: kb:page:read.
Returns pages. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
limit |
query | integer (int32) | Items per page (default: 20, max: 100) | |
offset |
query | integer (int32) | Number of items to skip (default: 0) | |
cursor |
query | string | Opaque cursor from previous page |
回包
200OK —application/json·CursorListResponsePageItemBodydefaultError —application/problem+json·D8Error
GET /api/v1/pages/trashed
List trashed pages
权限(scope): kb:page:read · 调用方式: appToken · operationId: list-trashed-pages
Required app scope: kb:page:read.
Returns trashed pages. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
limit |
query | integer (int32) | Items per page (default: 20, max: 100) | |
offset |
query | integer (int32) | Number of items to skip (default: 0) |
回包
200OK —application/json·CursorListResponsePageItemBodydefaultError —application/problem+json·D8Error
DELETE /api/v1/pages/{page_id}
Permanently delete page
权限(scope): kb:page:delete · 调用方式: appToken · operationId: permanent-delete-page
Required app scope: kb:page:delete.
Permanently deletes a page. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page_id |
path | string (uuid) | 是 | Page UUID |
回包
200OK —application/json·DataResponseStruct {}BodydefaultError —application/problem+json·D8Error
GET /api/v1/pages/{page_id}
Get page
权限(scope): kb:page:read · 调用方式: appToken · operationId: get-page
Required app scope: kb:page:read.
Returns a page. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page_id |
path | string (uuid) | 是 | Page UUID |
回包
200OK —application/json·DataResponsePageItemBodydefaultError —application/problem+json·D8Error
PATCH /api/v1/pages/{page_id}
Update page metadata
权限(scope): kb:page:write · 调用方式: appToken · operationId: update-page-metadata
Required app scope: kb:page:write.
Updates page metadata. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page_id |
path | string (uuid) | 是 | Page UUID |
请求体
application/json · UpdatePageMetadataRequestBody
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
title |
string | Page title |
回包
200OK —application/json·DataResponsePageItemBodydefaultError —application/problem+json·D8Error
GET /api/v1/pages/{page_id}/content
Get page content
权限(scope): kb:page:read · 调用方式: appToken · operationId: get-page-content
Required app scope: kb:page:read.
Returns page content. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page_id |
path | string (uuid) | 是 | Page UUID |
回包
200OK —application/json·DataResponsePageContentItemBodydefaultError —application/problem+json·D8Error
PUT /api/v1/pages/{page_id}/content
Update page content
权限(scope): kb:page:write · 调用方式: appToken · operationId: update-page-content
Required app scope: kb:page:write.
Updates page content. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page_id |
path | string (uuid) | 是 | Page UUID |
请求体
application/json · UpdatePageContentRequestBody
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
auto_save |
boolean | 是 | Whether this is an autosave update |
base_revision_id |
integer (int64) | Expected base revision ID | |
body |
string | 是 | Page content body |
message |
string | Revision message |
回包
200OK —application/json·DataResponsePageContentItemBodydefaultError —application/problem+json·D8Error
POST /api/v1/pages/{page_id}/freeze
Freeze page
权限(scope): kb:page:write · 调用方式: appToken · operationId: freeze-page
Required app scope: kb:page:write.
Freezes page content. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page_id |
path | string (uuid) | 是 | Page UUID |
回包
200OK —application/json·DataResponsePageContentItemBodydefaultError —application/problem+json·D8Error
GET /api/v1/pages/{page_id}/references
List page references
权限(scope): kb:page:read · 调用方式: appToken · operationId: list-page-references
Required app scope: kb:page:read.
Returns page references. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page_id |
path | string (uuid) | 是 | Page UUID |
回包
200OK —application/json·DataResponseListPageReferenceItemBodydefaultError —application/problem+json·D8Error
POST /api/v1/pages/{page_id}/restore
Restore page from trash
权限(scope): kb:page:write · 调用方式: appToken · operationId: restore-page-from-trash
Required app scope: kb:page:write.
Restores a trashed page. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page_id |
path | string (uuid) | 是 | Page UUID |
回包
200OK —application/json·DataResponseStruct {}BodydefaultError —application/problem+json·D8Error
GET /api/v1/pages/{page_id}/revisions
List page revisions
权限(scope): kb:page:read · 调用方式: appToken · operationId: list-page-revisions
Required app scope: kb:page:read.
Returns page revisions. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page_id |
path | string (uuid) | 是 | Page UUID |
limit |
query | integer (int32) | Items per page (default: 20, max: 100) | |
offset |
query | integer (int32) | Number of items to skip (default: 0) |
回包
200OK —application/json·CursorListResponseRevisionSummaryItemBodydefaultError —application/problem+json·D8Error
GET /api/v1/pages/{page_id}/revisions/diff
Diff page revisions
权限(scope): kb:page:read · 调用方式: appToken · operationId: diff-page-revisions
Required app scope: kb:page:read.
Returns a diff between page revisions. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page_id |
path | string (uuid) | 是 | Page UUID |
from_revision |
query | integer (int64) | 是 | Base revision ID |
to_revision |
query | integer (int64) | 是 | Target revision ID |
回包
200OK —application/json·DataResponseRevisionDiffItemBodydefaultError —application/problem+json·D8Error
GET /api/v1/pages/{page_id}/revisions/{revision_id}
Get page revision
权限(scope): kb:page:read · 调用方式: appToken · operationId: get-page-revision
Required app scope: kb:page:read.
Returns page revision content. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page_id |
path | string (uuid) | 是 | Page UUID |
revision_id |
path | integer (int64) | 是 | Revision ID |
回包
200OK —application/json·DataResponsePageContentItemBodydefaultError —application/problem+json·D8Error
POST /api/v1/pages/{page_id}/revisions/{revision_id}/restore
Restore page version
权限(scope): kb:page:write · 调用方式: appToken · operationId: restore-page-version
Required app scope: kb:page:write.
Restores a page to a revision. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page_id |
path | string (uuid) | 是 | Page UUID |
revision_id |
path | integer (int64) | 是 | Revision ID |
回包
200OK —application/json·DataResponsePageContentItemBodydefaultError —application/problem+json·D8Error
POST /api/v1/pages/{page_id}/trash
Trash page
权限(scope): kb:page:write · 调用方式: appToken · operationId: trash-page
Required app scope: kb:page:write.
Moves a page to trash. Response wrapped in standard envelope.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page_id |
path | string (uuid) | 是 | Page UUID |
回包
200OK —application/json·DataResponseStruct {}BodydefaultError —application/problem+json·D8Error
