Skip to main content
POST
确保知识包存在

限制说明

使用说明

  • 幂等:若(scope, scope_id)已存在知识包,则原样返回。
  • 账户范围忽略 scope_id(使用账户 ID),首次创建时会自动写入默认 DUTY.md
  • 创建账户范围知识包需要账户 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

要确保存在知识包的范围。

scope
enum<string>
必填

知识包范围。可选值:account(账户级知识包,scope_id 固定为调用方账户 ID,仅账户管理员可创建;首次创建会播种默认 DUTY.md)、team(团队级知识包,必须提供 scope_id 团队 ID,调用者需属于该团队)。

可用选项:
account,
team
scope_id
integer<int64>

团队 ID;团队范围必填,账户范围忽略。

响应

成功

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
必填

本次请求的唯一 ID,与 Flashcat-Request-Id 响应头一致。反馈问题时请携带该 ID。

示例:

"01HK8XQE3Z7JM2NTFQ5YJ8P9R4"

error
object

响应结构中的错误 payload,仅在非 2xx 响应时出现。

data
object

知识包——一棵带版本号的文件树,AI SRE 会话启动时会注入到每个沙箱中。每个(账户, scope, scope_id)仅有一个知识包。