Skip to main content
POST
上传知识文件

限制说明

使用说明

  • 文件内容以 JSON 字段 content_b64 中的 Base64 文本上传——不是 multipart 上传。
  • 写入已存在的 rel_path 会覆盖原文件;content_type 留空时按扩展名推断(.mdtext/markdown)。
  • 内容解码后必须是合法的 UTF-8 文本,二进制内容会被拒绝并返回 InvalidParameter
  • 编辑账户范围知识包需要账户 Owner/Admin 权限;编辑团队知识包需要是该团队成员。
  • 每次调用都会记录到账户审计日志。

授权

app_key
string
query
必填

App key issued from the Flashduty console. Required on every public API call. Keep it secret — it grants the same access as the owning account.

请求体

application/json

要创建或覆盖的文件。文件体通过 content_b64 以 Base64 文本上传,不是 multipart 上传。

rel_path
string
必填

相对于知识包根目录的目标路径;已存在的文件会被覆盖。

pack_id
string

知识包 ID;默认为调用者的账户范围知识包。

content_b64
string

Base64 编码的文件内容;解码后必须是合法的 UTF-8 文本。

content_type
string

MIME 类型;留空时按扩展名推断。

响应

Success

Standard response envelope used by every Flashduty public API. On success data contains the endpoint-specific payload and error is absent. On failure error is present and data is absent. request_id is always present and is also mirrored in the Flashcat-Request-Id response header.

request_id
string
必填

Unique ID for this request. Mirrored in the Flashcat-Request-Id header. Include it when reporting issues.

示例:

"01HK8XQE3Z7JM2NTFQ5YJ8P9R4"

error
object

Error payload inside the response envelope. Present only on non-2xx responses.

data
object

写入的文件及非阻塞提示。