POST
/
api
/
workflows
/
{workflowName}
/
knowledge-documents
新建项目知识库文档
curl --request POST \
  --url https://wfapi.yuhe.space/api/workflows/{workflowName}/knowledge-documents \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "markdown": "<string>",
  "id": "<string>"
}
'
{
  "errCode": 123,
  "errMessage": "<string>",
  "data": {
    "id": "<string>",
    "title": "<string>",
    "markdown": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

使用 WORKFLOW_SERVER_ADMIN_KEY 或已创建的账号 API Key。

Path Parameters

workflowName
string
required

Query Parameters

response
enum<string>
default:document

返回完整文档或轻量摘要;管理端大文档写入建议使用 summary,避免保存后回传完整 markdown。

Available options:
document,
summary

Body

application/json
title
string
required
markdown
string
required
id
string

可选文档 id。省略时 server 根据 title 生成。

Response

已新建 markdown 文档。

errCode
integer
required
errMessage
string
required
Allowed value: ""
data
object
required