Skip to main content
PATCH

校验与状态码

  • 顶层只接受 channel_config,内部至少一个可更新字段。未知字段、空更新或类型错误返回 400。
  • 非 Feishu 传 group_reply_in_thread 返回 400,即使值为 false;该字段不接受 null。
  • 非 DingTalk 传卡片字段返回 400;WeChat 不支持此 PATCH,返回 400。
  • 不能修改 credentials、Agent/template、name、response_options、private_memory_store_enabled 或 enabled。需要更换这些设置时删除并重建 Channel。
  • 群聊模板最多 4096 个 UTF-16 code units;{{context_note}} 与 {{messages}} 各出现一次。空串、缺失/重复、未知或残缺占位符返回 400。只做一次文本替换,不支持表达式。
  • 模板 ID trim 后 1–256 字符,仅字母/数字/下划线/点/冒号/连字符;正文变量 trim 后 1–64 字符,字母开头,后续仅字母/数字/下划线。
  • 不存在、已删除或不属于当前账号的 Channel 返回 404;并发归档或更新冲突返回 409;超限返回 429。

更新示例

新接收消息使用新配置,已开始处理或已冻结输入的消息继续旧配置。配置更新可能重建连接,HTTP 200 不代表连接已恢复或真实消息已通过。飞书已有话题始终沿用原话题,关闭开关不把它搬回群主线。限流规则见创建 Channel。

Authorizations

Authorization
string
header
required

标准的 HTTP Bearer 认证方式,在 API Keys 页面获取密钥。

Headers

zai-version
enum<string>
default:2026-05-26
required

Channel API v0 基础协议标识,固定为 2026-05-26。

Available options:
2026-05-26
Example:

"2026-05-26"

zai-beta
string
default:managed-agents-2026-05-26
required

可有多个逗号分隔值,但必须包含 managed-agents-2026-05-26。

Example:

"managed-agents-2026-05-26"

Path Parameters

channelId
string
required

channelId 资源标识。

Body

application/json

局部更新,省略字段保留原值。group_prompt_template 适用 Feishu/WeCom/DingTalk,话题开关仅 Feishu,卡片字段仅 DingTalk。WeChat 不支持 PATCH。未知字段或跨渠道字段返回 400;不能修改 credentials、template、name、response_options、private_memory_store_enabled、enabled。

channel_config
object
required

Response

请求成功。

固定 Agent 版本和渠道安全配置。不回显 credentials、扫码 token、平台消息 ID、内部 Session ID 或计费字段。

id
string
required
Example:

"channel_xxx"

type
enum<string>
required
Available options:
channel
channel_type
enum<string>
required

渠道平台。

Available options:
feishu
name
string
required
Example:

"Channel xxx"

template
object
required
enabled
boolean
required

新建 Channel 固定为 true。

Example:

true

binding_status
string
required

绑定状态。WeChat 创建后为 unbound;创建扫码会话后可能为 pending,继续查询 QR 状态;手机确认后为 bound。其他渠道通常创建后为 bound。

Example:

"bound"

connection_status
enum<string>
required

异步连接状态。disconnected 尚未建立;connecting 连接中;connected 已连接;error 查看 last_error。

Available options:
disconnected,
connecting,
connected,
error
Example:

"disconnected"

channel_config
飞书 · object
required
last_error
object | null
required

最近连接错误的安全提示,正常时为 null;不能仅凭该字段判断某轮 Agent 执行是否成功。

Example:

null

created_at
string<date-time>
required

创建时间。

updated_at
string<date-time>
required

更新时间。