> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bigmodel.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建 Channel

> 创建 Channel，将固定版本的 Agent 绑定到飞书、企业微信、钉钉或个人微信；201 仅表示保存成功，连接异步建立，凭据永不回显。

## 请求协议

所有请求携带 Bearer 凭据、`zai-version: 2026-05-26` 和 `zai-beta: managed-agents-2026-05-26`；多个 beta 值用逗号分隔且必须包含此值。JSON 请求设置 `Content-Type: application/json`。Channel 当前不支持 Coding Plan 请求。

## 选择渠道与凭据

| channel\_type | 渠道 | 必需凭据与专属配置 |
| - | - | - |
| `feishu` | 飞书 | `app_id/app_secret`；可设置 `group_reply_in_thread` |
| `wecom` | 企业微信 | 智能机器人长连接的 `bot_id/secret` |
| `dingtalk` | 钉钉 | 应用 `client_id/client_secret`；可设置已发布互动卡片模板 |
| `wechat` | 个人微信 | 不传 credentials，创建后[扫码绑定](https://docs.bigmodel.cn/api-reference/channel/qr-create.md) |

企业微信不接受群机器人 Webhook URL、CorpID 或 AgentId。钉钉凭据对应开放平台的 Client ID/AppKey 与 Client Secret/AppSecret。不同渠道的专属字段不能混用；未知字段或错误类型返回 400。

四个请求示例可在右侧示例选择器切换。准备机器人、完整接入命令和真实消息验证见[接入聊天渠道](https://docs.bigmodel.cn/cn/managed-agents/channels.md)。字段、默认值、响应和错误码以本页自动生成的接口定义为准。

## 资源与组合校验

调用 Create API 的身份必须具有目标 Agent 的 owner 权限。Agent、Environment、Vault、File 和 Memory Store 必须属于同一账号；资源 ID 均在 trim 后为 1–128 字符。Agent 字符串或省略 version 时，创建时解析并固定当前版本，后续更新 Agent 不会改变已有 Channel。

序列化后的 `channel_config` 配置 JSON 不得超过 65,535 UTF-8 字节，超限返回 400。凭据中的标识字段 trim 后为 1–256 字符；Secret 为 1–4096 字符且不 trim。凭据对象还受加密存储的组合长度上限约束，单字段长度合法也可能因组合过长返回 400，不能只按单字段长度判断。

群聊模板的占位符、钉钉卡片字段格式及 Memory Store 挂载总数等跨字段校验见相应字段说明。owner 或资源预检调用失败时返回 500，不创建 Channel。

## 创建后状态与错误

201 只表示预检和保存成功，初始连接状态为 disconnected；微信初始 unbound，须继续扫码。调用[获取 Channel](https://docs.bigmodel.cn/api-reference/channel/get.md)检查绑定、连接状态和 last\_error，并发送真实消息验证。连接成功与消息处理、文本和附件送达分别判断。

同一账号默认最多 5 个 Create 预检在途；繁忙时返回 503 和 `Retry-After: 1`，不排队。这与请求频率超限的 429 不同。502 在本接口表示渠道探测未返回有效机器人身份；[二维码创建接口](https://docs.bigmodel.cn/api-reference/channel/qr-create.md)的无效二维码响应或渲染失败也可能返回 502。

## 请求限流

同一账号的不同 API Key 共享请求频率额度。GET（含扫码查询）计入 read，POST/PATCH/DELETE（含扫码创建）计入 write。下表为默认值，实际额度以服务响应为准。

| 类别 | 账号容量 | 账号每秒补充 | 全局容量 | 全局每秒补充 |
| - | -: | -: | -: | -: |
| read | 100 | 50 | 1000 | 500 |
| write | 20 | 10 | 400 | 200 |

429 响应携带 `ratelimit-limit`、`ratelimit-remaining`、`ratelimit-reset` 和 `retry-after`；后两项为相对秒数，全局限流另带 `x-ratelimit-scope: global`。并发预检忙返回 503，不属于 429。


## OpenAPI

````yaml /openapi/openapi-channel.json post /agent/forward/v0/channels
openapi: 3.0.1
info:
  title: Channel API
  version: '2026-10-30'
  description: >-
    Channel API v0：将固定版本的 Agent
    接入飞书、企业微信、钉钉和个人微信。提供创建、分页查询、详情、有限配置更新、删除以及微信扫码会话创建和查询。连接异步建立；201 仅表示配置保存成功。
servers:
  - url: https://agent-api.bigmodel.cn/api
    description: 生产环境
security:
  - bearerAuth: []
tags:
  - name: Channel
    description: 渠道管理；Agent 运行仍通过 Managed Session 和 Events API。
paths:
  /agent/forward/v0/channels:
    post:
      tags:
        - Channel
      summary: 创建 Channel
      description: 创建 Channel，将固定版本的 Agent 绑定到飞书、企业微信、钉钉或个人微信；201 仅表示保存成功，连接异步建立，凭据永不回显。
      operationId: forwardPostChannels
      parameters:
        - $ref: '#/components/parameters/ForwardZaiVersion'
        - $ref: '#/components/parameters/ForwardZaiBeta'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForwardChannelCreateRequest'
            examples:
              feishu:
                summary: 飞书
                value:
                  channel_type: feishu
                  name: 飞书 Channel xxx
                  template:
                    agent: agent_xxx
                    environment_id: env_xxx
                  channel_config:
                    credentials:
                      app_id: xxx
                      app_secret: xxx
                    group_reply_in_thread: true
              wecom:
                summary: 企业微信
                value:
                  channel_type: wecom
                  name: 企业微信 Channel xxx
                  template:
                    agent: agent_xxx
                    environment_id: env_xxx
                  channel_config:
                    credentials:
                      bot_id: xxx
                      secret: xxx
              dingtalk:
                summary: 钉钉
                value:
                  channel_type: dingtalk
                  name: 钉钉 Channel xxx
                  template:
                    agent: agent_xxx
                    environment_id: env_xxx
                  channel_config:
                    credentials:
                      client_id: xxx
                      client_secret: xxx
                    card_template_id: xxx.schema
                    card_content_key: content
              wechat:
                summary: 个人微信
                value:
                  channel_type: wechat
                  name: 个人微信 Channel xxx
                  template:
                    agent: agent_xxx
                    environment_id: env_xxx
                  channel_config: {}
      responses:
        '201':
          description: 预检与配置保存成功，初始连接状态 disconnected；不代表可收发消息。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForwardChannel'
              examples:
                feishu:
                  summary: 飞书
                  value:
                    id: channel_feishu_xxx
                    type: channel
                    channel_type: feishu
                    name: 飞书 Channel xxx
                    template:
                      agent:
                        type: agent
                        id: agent_xxx
                        version: 3
                      environment_id: env_xxx
                      vault_ids: []
                      file_ids: []
                      memory_stores: []
                    enabled: true
                    binding_status: bound
                    connection_status: disconnected
                    channel_config:
                      response_options:
                        include_tool_calls: false
                        include_process: false
                        card_output: true
                      private_memory_store_enabled: false
                      group_prompt_template: null
                      group_reply_in_thread: true
                    last_error: null
                    created_at: '2026-10-30T00:00:00.000Z'
                    updated_at: '2026-10-30T00:00:00.000Z'
                wecom:
                  summary: 企业微信
                  value:
                    id: channel_wecom_xxx
                    type: channel
                    channel_type: wecom
                    name: 企业微信 Channel xxx
                    template:
                      agent:
                        type: agent
                        id: agent_xxx
                        version: 3
                      environment_id: env_xxx
                      vault_ids: []
                      file_ids: []
                      memory_stores: []
                    enabled: true
                    binding_status: bound
                    connection_status: disconnected
                    channel_config:
                      response_options:
                        include_tool_calls: false
                        include_process: false
                        card_output: true
                      private_memory_store_enabled: false
                      group_prompt_template: null
                    last_error: null
                    created_at: '2026-10-30T00:00:00.000Z'
                    updated_at: '2026-10-30T00:00:00.000Z'
                dingtalk:
                  summary: 钉钉
                  value:
                    id: channel_dingtalk_xxx
                    type: channel
                    channel_type: dingtalk
                    name: 钉钉 Channel xxx
                    template:
                      agent:
                        type: agent
                        id: agent_xxx
                        version: 3
                      environment_id: env_xxx
                      vault_ids: []
                      file_ids: []
                      memory_stores: []
                    enabled: true
                    binding_status: bound
                    connection_status: disconnected
                    channel_config:
                      response_options:
                        include_tool_calls: false
                        include_process: false
                        card_output: true
                      private_memory_store_enabled: false
                      group_prompt_template: null
                      card_template_id: xxx.schema
                      card_content_key: content
                    last_error: null
                    created_at: '2026-10-30T00:00:00.000Z'
                    updated_at: '2026-10-30T00:00:00.000Z'
                wechat:
                  summary: 个人微信
                  value:
                    id: channel_wechat_xxx
                    type: channel
                    channel_type: wechat
                    name: 个人微信 Channel xxx
                    template:
                      agent:
                        type: agent
                        id: agent_xxx
                        version: 3
                      environment_id: env_xxx
                      vault_ids: []
                      file_ids: []
                      memory_stores: []
                    enabled: true
                    binding_status: unbound
                    connection_status: disconnected
                    channel_config:
                      response_options:
                        include_tool_calls: false
                        include_process: false
                        card_output: true
                      private_memory_store_enabled: false
                      group_prompt_template: null
                    last_error: null
                    created_at: '2026-10-30T00:00:00.000Z'
                    updated_at: '2026-10-30T00:00:00.000Z'
        '400':
          description: Schema、凭据或渠道字段不合法。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForwardAgentErrorResponse'
              example:
                type: error
                error:
                  type: invalid_request_error
                  message: Schema、凭据或渠道字段不合法。
                  details: {}
                request_id: req_xxx
        '404':
          description: 指定 Agent version 不存在。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForwardAgentErrorResponse'
              example:
                type: error
                error:
                  type: not_found_error
                  message: 指定 Agent version 不存在。
                  details: {}
                request_id: req_xxx
        '409':
          description: 机器人已有绑定或 Memory Store 已归档。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForwardAgentErrorResponse'
              example:
                type: error
                error:
                  type: conflict_error
                  message: 机器人已有绑定或 Memory Store 已归档。
                  details: {}
                request_id: req_xxx
        '429':
          description: 账号或全局请求频率超限。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForwardAgentErrorResponse'
              example:
                type: error
                error:
                  type: rate_limit_error
                  message: 账号或全局请求频率超限。
                  details: {}
                request_id: req_xxx
          headers:
            retry-after:
              description: 建议等待的相对秒数。503 并发预检忙时可为 1。
              schema:
                type: string
            ratelimit-limit:
              description: 当前桶容量。
              schema:
                type: string
            ratelimit-remaining:
              description: 剩余容量，拒绝时为 0。
              schema:
                type: string
            ratelimit-reset:
              description: 恢复一个请求额度所需的相对秒数。
              schema:
                type: string
            x-ratelimit-scope:
              description: 仅全局限流时返回 global。
              schema:
                type: string
        '500':
          description: owner 或资源预检失败，未创建 Channel。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForwardAgentErrorResponse'
              example:
                type: error
                error:
                  type: api_error
                  message: owner 或资源预检失败，未创建 Channel。
                  details: {}
                request_id: req_xxx
        '502':
          description: 渠道探测未返回有效机器人身份。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForwardAgentErrorResponse'
              example:
                type: error
                error:
                  type: api_error
                  message: 渠道探测未返回有效机器人身份。
                  details: {}
                request_id: req_xxx
        '503':
          description: 渠道暂时不可用、并发预检忙或依赖不可用。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForwardAgentErrorResponse'
              example:
                type: error
                error:
                  type: api_error
                  message: 渠道暂时不可用、并发预检忙或依赖不可用。
                  details: {}
                request_id: req_xxx
          headers:
            retry-after:
              description: 建议等待的相对秒数。503 并发预检忙时可为 1。
              schema:
                type: string
components:
  parameters:
    ForwardZaiVersion:
      name: zai-version
      in: header
      required: true
      description: Channel API v0 基础协议标识，固定为 2026-05-26。
      schema:
        type: string
        enum:
          - '2026-05-26'
        default: '2026-05-26'
        example: '2026-05-26'
    ForwardZaiBeta:
      name: zai-beta
      in: header
      required: true
      description: 可有多个逗号分隔值，但必须包含 managed-agents-2026-05-26。
      schema:
        type: string
        default: managed-agents-2026-05-26
        example: managed-agents-2026-05-26
  schemas:
    ForwardChannelCreateRequest:
      oneOf:
        - $ref: '#/components/schemas/ForwardFeishuChannelCreateRequest'
        - $ref: '#/components/schemas/ForwardWeComChannelCreateRequest'
        - $ref: '#/components/schemas/ForwardDingTalkChannelCreateRequest'
        - $ref: '#/components/schemas/ForwardWeChatChannelCreateRequest'
      discriminator:
        propertyName: channel_type
        mapping:
          feishu: '#/components/schemas/ForwardFeishuChannelCreateRequest'
          wecom: '#/components/schemas/ForwardWeComChannelCreateRequest'
          dingtalk: '#/components/schemas/ForwardDingTalkChannelCreateRequest'
          wechat: '#/components/schemas/ForwardWeChatChannelCreateRequest'
      description: 按 channel_type 选择配置。所有对象均为严格 Schema，未知、跨渠道字段或类型错误返回 400。
    ForwardChannel:
      oneOf:
        - $ref: '#/components/schemas/ForwardFeishuChannel'
        - $ref: '#/components/schemas/ForwardWeComChannel'
        - $ref: '#/components/schemas/ForwardDingTalkChannel'
        - $ref: '#/components/schemas/ForwardWeChatChannel'
      discriminator:
        propertyName: channel_type
        mapping:
          feishu: '#/components/schemas/ForwardFeishuChannel'
          wecom: '#/components/schemas/ForwardWeComChannel'
          dingtalk: '#/components/schemas/ForwardDingTalkChannel'
          wechat: '#/components/schemas/ForwardWeChatChannel'
      description: 固定 Agent 版本和渠道安全配置。不回显 credentials、扫码 token、平台消息 ID、内部 Session ID 或计费字段。
    ForwardAgentErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - error
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - authentication_error
                - permission_error
                - invalid_request_error
                - not_found_error
                - conflict_error
                - rate_limit_error
                - api_error
            message:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - type
            - message
            - details
          additionalProperties: false
        request_id:
          type: string
          example: req_xxx
      required:
        - type
        - error
        - request_id
      additionalProperties: false
    ForwardFeishuChannelCreateRequest:
      type: object
      properties:
        channel_type:
          type: string
          description: 固定为 feishu。
          enum:
            - feishu
        name:
          type: string
          minLength: 1
          maxLength: 128
          description: 名称；trim 后 1–128 字符。
          example: Channel xxx
        template:
          allOf:
            - $ref: '#/components/schemas/ForwardChannelTemplateInput'
          description: 收到消息后创建 Managed Session 所用的固定模板。
        channel_config:
          $ref: '#/components/schemas/ForwardFeishuChannelConfigInput'
      required:
        - channel_type
        - name
        - template
        - channel_config
      additionalProperties: false
      example:
        channel_type: feishu
        name: 飞书 Channel xxx
        template:
          agent: agent_xxx
          environment_id: env_xxx
        channel_config:
          credentials:
            app_id: xxx
            app_secret: xxx
          group_reply_in_thread: true
      title: 飞书
    ForwardWeComChannelCreateRequest:
      type: object
      properties:
        channel_type:
          type: string
          description: 固定为 wecom。
          enum:
            - wecom
        name:
          type: string
          minLength: 1
          maxLength: 128
          description: 名称；trim 后 1–128 字符。
          example: Channel xxx
        template:
          allOf:
            - $ref: '#/components/schemas/ForwardChannelTemplateInput'
          description: 收到消息后创建 Managed Session 所用的固定模板。
        channel_config:
          $ref: '#/components/schemas/ForwardWeComChannelConfigInput'
      required:
        - channel_type
        - name
        - template
        - channel_config
      additionalProperties: false
      example:
        channel_type: wecom
        name: 企业微信 Channel xxx
        template:
          agent: agent_xxx
          environment_id: env_xxx
        channel_config:
          credentials:
            bot_id: xxx
            secret: xxx
      title: 企业微信
    ForwardDingTalkChannelCreateRequest:
      type: object
      properties:
        channel_type:
          type: string
          description: 固定为 dingtalk。
          enum:
            - dingtalk
        name:
          type: string
          minLength: 1
          maxLength: 128
          description: 名称；trim 后 1–128 字符。
          example: Channel xxx
        template:
          allOf:
            - $ref: '#/components/schemas/ForwardChannelTemplateInput'
          description: 收到消息后创建 Managed Session 所用的固定模板。
        channel_config:
          $ref: '#/components/schemas/ForwardDingTalkChannelConfigInput'
      required:
        - channel_type
        - name
        - template
        - channel_config
      additionalProperties: false
      example:
        channel_type: dingtalk
        name: 钉钉 Channel xxx
        template:
          agent: agent_xxx
          environment_id: env_xxx
        channel_config:
          credentials:
            client_id: xxx
            client_secret: xxx
          card_template_id: xxx.schema
          card_content_key: content
      title: 钉钉
    ForwardWeChatChannelCreateRequest:
      type: object
      properties:
        channel_type:
          type: string
          description: 固定为 wechat。
          enum:
            - wechat
        name:
          type: string
          minLength: 1
          maxLength: 128
          description: 名称；trim 后 1–128 字符。
          example: Channel xxx
        template:
          allOf:
            - $ref: '#/components/schemas/ForwardChannelTemplateInput'
          description: 收到消息后创建 Managed Session 所用的固定模板。
        channel_config:
          $ref: '#/components/schemas/ForwardWeChatChannelConfigInput'
      required:
        - channel_type
        - name
        - template
        - channel_config
      additionalProperties: false
      example:
        channel_type: wechat
        name: 个人微信 Channel xxx
        template:
          agent: agent_xxx
          environment_id: env_xxx
        channel_config: {}
      title: 个人微信
    ForwardFeishuChannel:
      type: object
      properties:
        id:
          type: string
          example: channel_xxx
        type:
          type: string
          enum:
            - channel
        channel_type:
          type: string
          description: 渠道平台。
          enum:
            - feishu
        name:
          type: string
          example: Channel xxx
        template:
          $ref: '#/components/schemas/ForwardChannelTemplate'
        enabled:
          type: boolean
          description: 新建 Channel 固定为 true。
          example: true
        binding_status:
          type: string
          description: >-
            绑定状态。WeChat 创建后为 unbound；创建扫码会话后可能为 pending，继续查询 QR 状态；手机确认后为
            bound。其他渠道通常创建后为 bound。
          example: bound
        connection_status:
          type: string
          description: >-
            异步连接状态。disconnected 尚未建立；connecting 连接中；connected 已连接；error 查看
            last_error。
          enum:
            - disconnected
            - connecting
            - connected
            - error
          example: disconnected
        channel_config:
          $ref: '#/components/schemas/ForwardFeishuChannelConfig'
        last_error:
          type: object
          nullable: true
          additionalProperties: true
          example: null
          description: 最近连接错误的安全提示，正常时为 null；不能仅凭该字段判断某轮 Agent 执行是否成功。
        created_at:
          type: string
          format: date-time
          description: 创建时间。
        updated_at:
          type: string
          format: date-time
          description: 更新时间。
      required:
        - id
        - type
        - channel_type
        - name
        - template
        - enabled
        - binding_status
        - connection_status
        - channel_config
        - last_error
        - created_at
        - updated_at
      additionalProperties: false
      example:
        id: channel_feishu_xxx
        type: channel
        channel_type: feishu
        name: 飞书 Channel xxx
        template:
          agent:
            type: agent
            id: agent_xxx
            version: 3
          environment_id: env_xxx
          vault_ids: []
          file_ids: []
          memory_stores: []
        enabled: true
        binding_status: bound
        connection_status: disconnected
        channel_config:
          response_options:
            include_tool_calls: false
            include_process: false
            card_output: true
          private_memory_store_enabled: false
          group_prompt_template: null
          group_reply_in_thread: true
        last_error: null
        created_at: '2026-10-30T00:00:00.000Z'
        updated_at: '2026-10-30T00:00:00.000Z'
      title: 飞书
    ForwardWeComChannel:
      type: object
      properties:
        id:
          type: string
          example: channel_xxx
        type:
          type: string
          enum:
            - channel
        channel_type:
          type: string
          description: 渠道平台。
          enum:
            - wecom
        name:
          type: string
          example: Channel xxx
        template:
          $ref: '#/components/schemas/ForwardChannelTemplate'
        enabled:
          type: boolean
          description: 新建 Channel 固定为 true。
          example: true
        binding_status:
          type: string
          description: >-
            绑定状态。WeChat 创建后为 unbound；创建扫码会话后可能为 pending，继续查询 QR 状态；手机确认后为
            bound。其他渠道通常创建后为 bound。
          example: bound
        connection_status:
          type: string
          description: >-
            异步连接状态。disconnected 尚未建立；connecting 连接中；connected 已连接；error 查看
            last_error。
          enum:
            - disconnected
            - connecting
            - connected
            - error
          example: disconnected
        channel_config:
          $ref: '#/components/schemas/ForwardWeComChannelConfig'
        last_error:
          type: object
          nullable: true
          additionalProperties: true
          example: null
          description: 最近连接错误的安全提示，正常时为 null；不能仅凭该字段判断某轮 Agent 执行是否成功。
        created_at:
          type: string
          format: date-time
          description: 创建时间。
        updated_at:
          type: string
          format: date-time
          description: 更新时间。
      required:
        - id
        - type
        - channel_type
        - name
        - template
        - enabled
        - binding_status
        - connection_status
        - channel_config
        - last_error
        - created_at
        - updated_at
      additionalProperties: false
      example:
        id: channel_wecom_xxx
        type: channel
        channel_type: wecom
        name: 企业微信 Channel xxx
        template:
          agent:
            type: agent
            id: agent_xxx
            version: 3
          environment_id: env_xxx
          vault_ids: []
          file_ids: []
          memory_stores: []
        enabled: true
        binding_status: bound
        connection_status: disconnected
        channel_config:
          response_options:
            include_tool_calls: false
            include_process: false
            card_output: true
          private_memory_store_enabled: false
          group_prompt_template: null
        last_error: null
        created_at: '2026-10-30T00:00:00.000Z'
        updated_at: '2026-10-30T00:00:00.000Z'
      title: 企业微信
    ForwardDingTalkChannel:
      type: object
      properties:
        id:
          type: string
          example: channel_xxx
        type:
          type: string
          enum:
            - channel
        channel_type:
          type: string
          description: 渠道平台。
          enum:
            - dingtalk
        name:
          type: string
          example: Channel xxx
        template:
          $ref: '#/components/schemas/ForwardChannelTemplate'
        enabled:
          type: boolean
          description: 新建 Channel 固定为 true。
          example: true
        binding_status:
          type: string
          description: >-
            绑定状态。WeChat 创建后为 unbound；创建扫码会话后可能为 pending，继续查询 QR 状态；手机确认后为
            bound。其他渠道通常创建后为 bound。
          example: bound
        connection_status:
          type: string
          description: >-
            异步连接状态。disconnected 尚未建立；connecting 连接中；connected 已连接；error 查看
            last_error。
          enum:
            - disconnected
            - connecting
            - connected
            - error
          example: disconnected
        channel_config:
          $ref: '#/components/schemas/ForwardDingTalkChannelConfig'
        last_error:
          type: object
          nullable: true
          additionalProperties: true
          example: null
          description: 最近连接错误的安全提示，正常时为 null；不能仅凭该字段判断某轮 Agent 执行是否成功。
        created_at:
          type: string
          format: date-time
          description: 创建时间。
        updated_at:
          type: string
          format: date-time
          description: 更新时间。
      required:
        - id
        - type
        - channel_type
        - name
        - template
        - enabled
        - binding_status
        - connection_status
        - channel_config
        - last_error
        - created_at
        - updated_at
      additionalProperties: false
      example:
        id: channel_dingtalk_xxx
        type: channel
        channel_type: dingtalk
        name: 钉钉 Channel xxx
        template:
          agent:
            type: agent
            id: agent_xxx
            version: 3
          environment_id: env_xxx
          vault_ids: []
          file_ids: []
          memory_stores: []
        enabled: true
        binding_status: bound
        connection_status: disconnected
        channel_config:
          response_options:
            include_tool_calls: false
            include_process: false
            card_output: true
          private_memory_store_enabled: false
          group_prompt_template: null
          card_template_id: xxx.schema
          card_content_key: content
        last_error: null
        created_at: '2026-10-30T00:00:00.000Z'
        updated_at: '2026-10-30T00:00:00.000Z'
      title: 钉钉
    ForwardWeChatChannel:
      type: object
      properties:
        id:
          type: string
          example: channel_xxx
        type:
          type: string
          enum:
            - channel
        channel_type:
          type: string
          description: 渠道平台。
          enum:
            - wechat
        name:
          type: string
          example: Channel xxx
        template:
          $ref: '#/components/schemas/ForwardChannelTemplate'
        enabled:
          type: boolean
          description: 新建 Channel 固定为 true。
          example: true
        binding_status:
          type: string
          description: >-
            绑定状态。WeChat 创建后为 unbound；创建扫码会话后可能为 pending，继续查询 QR 状态；手机确认后为
            bound。其他渠道通常创建后为 bound。
          example: bound
        connection_status:
          type: string
          description: >-
            异步连接状态。disconnected 尚未建立；connecting 连接中；connected 已连接；error 查看
            last_error。
          enum:
            - disconnected
            - connecting
            - connected
            - error
          example: disconnected
        channel_config:
          $ref: '#/components/schemas/ForwardWeChatChannelConfig'
        last_error:
          type: object
          nullable: true
          additionalProperties: true
          example: null
          description: 最近连接错误的安全提示，正常时为 null；不能仅凭该字段判断某轮 Agent 执行是否成功。
        created_at:
          type: string
          format: date-time
          description: 创建时间。
        updated_at:
          type: string
          format: date-time
          description: 更新时间。
      required:
        - id
        - type
        - channel_type
        - name
        - template
        - enabled
        - binding_status
        - connection_status
        - channel_config
        - last_error
        - created_at
        - updated_at
      additionalProperties: false
      example:
        id: channel_wechat_xxx
        type: channel
        channel_type: wechat
        name: 个人微信 Channel xxx
        template:
          agent:
            type: agent
            id: agent_xxx
            version: 3
          environment_id: env_xxx
          vault_ids: []
          file_ids: []
          memory_stores: []
        enabled: true
        binding_status: unbound
        connection_status: disconnected
        channel_config:
          response_options:
            include_tool_calls: false
            include_process: false
            card_output: true
          private_memory_store_enabled: false
          group_prompt_template: null
        last_error: null
        created_at: '2026-10-30T00:00:00.000Z'
        updated_at: '2026-10-30T00:00:00.000Z'
      title: 个人微信
    ForwardChannelTemplateInput:
      type: object
      properties:
        agent:
          allOf:
            - $ref: '#/components/schemas/ForwardChannelAgentInput'
          description: Channel 使用的 Managed Agent；创建时固定版本。
        environment_id:
          type: string
          description: 当前账号未归档的 Environment ID；trim 后 1–128 字符。
          minLength: 1
          maxLength: 128
          example: env_xxx
        vault_ids:
          type: array
          maxItems: 20
          default: []
          items:
            type: string
            description: 资源 ID；trim 后 1–128 字符。
            minLength: 1
            maxLength: 128
          description: 默认 []，最多 20 项，服务端按 ID 去重；每个 ID trim 后为 1–128 字符，资源须属于当前账号。
        file_ids:
          type: array
          maxItems: 20
          default: []
          items:
            type: string
            description: 资源 ID；trim 后 1–128 字符。
            minLength: 1
            maxLength: 128
          description: 默认 []，最多 20 项，服务端按 ID 去重；每个 ID trim 后为 1–128 字符，资源须属于当前账号。
        memory_stores:
          type: array
          items:
            $ref: '#/components/schemas/ForwardChannelMemoryStore'
          maxItems: 8
          description: >-
            默认 []，最多 8 项；memory_store_id 不得重复。Store 须属于当前账号且未归档；与自动创建的私有 Memory
            Store 合计最多 8 个。已归档 Store 返回 409，资源预检调用失败返回 500。
          default: []
      required:
        - agent
        - environment_id
      additionalProperties: false
      description: >-
        Channel 固定资源模板。调用 Create API 的身份必须具有目标 Agent 的 owner 权限；所有资源须属于同一账号。资源
        ID 均在 trim 后为 1–128 字符。模型、工具、MCP 与 Skills 由固定 Agent 版本定义，不接受临时覆盖。
    ForwardFeishuChannelConfigInput:
      type: object
      properties:
        response_options:
          $ref: '#/components/schemas/ForwardChannelResponseOptionsInput'
        private_memory_store_enabled:
          type: boolean
          default: false
          description: >-
            自动为会话范围创建并挂载私有 Memory Store；创建后不可修改。与 template.memory_stores 合计最多 8
            个。
        credentials:
          $ref: '#/components/schemas/ForwardFeishuCredentials'
        group_prompt_template:
          type: string
          description: >-
            群聊提示模板；仅 Feishu / WeCom / DingTalk 可写入，WeChat 禁止。null 恢复默认。最多 4096 个
            UTF-16 code units；{{context_note}} 与 {{messages}}
            必须各出现一次，空串、缺失/重复/未知或残缺占位符返回 400。只做一次文本替换，不支持表达式。
          nullable: true
          maxLength: 4096
        group_reply_in_thread:
          type: boolean
          default: false
          description: >-
            仅 Feishu。true 时普通群 @ 后在触发消息下创建话题回复；false
            直接回复。已有话题沿用原话题，私聊不受影响；不扩大历史权限。
      required:
        - credentials
      additionalProperties: false
      description: 飞书创建配置；未知字段、类型错误和跨渠道字段返回 400。序列化后的配置 JSON 不得超过 65,535 UTF-8 字节，超限返回 400。
      title: 飞书
    ForwardWeComChannelConfigInput:
      type: object
      properties:
        response_options:
          $ref: '#/components/schemas/ForwardChannelResponseOptionsInput'
        private_memory_store_enabled:
          type: boolean
          default: false
          description: >-
            自动为会话范围创建并挂载私有 Memory Store；创建后不可修改。与 template.memory_stores 合计最多 8
            个。
        credentials:
          $ref: '#/components/schemas/ForwardWeComCredentials'
        group_prompt_template:
          type: string
          description: >-
            群聊提示模板；仅 Feishu / WeCom / DingTalk 可写入，WeChat 禁止。null 恢复默认。最多 4096 个
            UTF-16 code units；{{context_note}} 与 {{messages}}
            必须各出现一次，空串、缺失/重复/未知或残缺占位符返回 400。只做一次文本替换，不支持表达式。
          nullable: true
          maxLength: 4096
      required:
        - credentials
      additionalProperties: false
      description: >-
        企业微信创建配置；未知字段、类型错误和跨渠道字段返回 400。序列化后的配置 JSON 不得超过 65,535 UTF-8 字节，超限返回
        400。
      title: 企业微信
    ForwardDingTalkChannelConfigInput:
      type: object
      properties:
        response_options:
          $ref: '#/components/schemas/ForwardChannelResponseOptionsInput'
        private_memory_store_enabled:
          type: boolean
          default: false
          description: >-
            自动为会话范围创建并挂载私有 Memory Store；创建后不可修改。与 template.memory_stores 合计最多 8
            个。
        credentials:
          $ref: '#/components/schemas/ForwardDingTalkCredentials'
        group_prompt_template:
          type: string
          description: >-
            群聊提示模板；仅 Feishu / WeCom / DingTalk 可写入，WeChat 禁止。null 恢复默认。最多 4096 个
            UTF-16 code units；{{context_note}} 与 {{messages}}
            必须各出现一次，空串、缺失/重复/未知或残缺占位符返回 400。只做一次文本替换，不支持表达式。
          nullable: true
          maxLength: 4096
        card_template_id:
          type: string
          description: >-
            仅 DingTalk；已发布且该应用可访问的互动卡片模板 ID。trim 后 1–256
            字符，只含字母、数字、下划线、点、冒号、连字符；null 关闭模板。
          nullable: true
          default: null
          pattern: ^\s*[A-Za-z0-9_.:-]{1,256}\s*$
        card_content_key:
          type: string
          description: >-
            仅 DingTalk；绑定 Markdown 正文的变量名，默认 content。trim 后 1–64
            字符，字母开头，后续仅字母、数字或下划线。
          default: content
          pattern: ^\s*[A-Za-z][A-Za-z0-9_]{0,63}\s*$
      required:
        - credentials
      additionalProperties: false
      description: 钉钉创建配置；未知字段、类型错误和跨渠道字段返回 400。序列化后的配置 JSON 不得超过 65,535 UTF-8 字节，超限返回 400。
      title: 钉钉
    ForwardWeChatChannelConfigInput:
      type: object
      properties:
        response_options:
          $ref: '#/components/schemas/ForwardChannelResponseOptionsInput'
        private_memory_store_enabled:
          type: boolean
          default: false
          description: >-
            自动为会话范围创建并挂载私有 Memory Store；创建后不可修改。与 template.memory_stores 合计最多 8
            个。
      additionalProperties: false
      description: >-
        个人微信创建配置；未知字段、类型错误和跨渠道字段返回 400。创建时不传 credentials
        或任何群聊、话题、卡片字段；后续扫码绑定。序列化后的配置 JSON 不得超过 65,535 UTF-8 字节，超限返回 400。
      title: 个人微信
    ForwardChannelTemplate:
      type: object
      properties:
        agent:
          $ref: '#/components/schemas/ForwardChannelAgent'
        environment_id:
          type: string
          example: env_xxx
          description: 当前账号未归档的 Environment ID；trim 后 1–128 字符。
        vault_ids:
          type: array
          maxItems: 20
          items:
            type: string
            description: 资源 ID；trim 后 1–128 字符。
          example:
            - vault_xxx
          description: 默认 []，最多 20 项，服务端按 ID 去重；每个 ID trim 后为 1–128 字符，资源须属于当前账号。
        file_ids:
          type: array
          maxItems: 20
          items:
            type: string
            description: 资源 ID；trim 后 1–128 字符。
          example:
            - file_xxx
          description: 默认 []，最多 20 项，服务端按 ID 去重；每个 ID trim 后为 1–128 字符，资源须属于当前账号。
        memory_stores:
          type: array
          items:
            $ref: '#/components/schemas/ForwardChannelMemoryStore'
          maxItems: 8
          description: 共享 Memory Store；ID 不可重复，与自动创建的私有 Store 合计最多挂载 8 个。
      required:
        - agent
        - environment_id
        - vault_ids
        - file_ids
        - memory_stores
      additionalProperties: false
    ForwardFeishuChannelConfig:
      type: object
      properties:
        response_options:
          $ref: '#/components/schemas/ForwardChannelResponseOptions'
        private_memory_store_enabled:
          type: boolean
        group_prompt_template:
          type: string
          description: 群聊提示模板；所有渠道均返回。WeChat 固定为 null，不接受配置。
          nullable: true
          maxLength: 4096
        group_reply_in_thread:
          type: boolean
          default: false
          description: >-
            仅 Feishu。true 时普通群 @ 后在触发消息下创建话题回复；false
            直接回复。已有话题沿用原话题，私聊不受影响；不扩大历史权限。
      required:
        - response_options
        - private_memory_store_enabled
        - group_prompt_template
        - group_reply_in_thread
      additionalProperties: false
      title: 飞书
    ForwardWeComChannelConfig:
      type: object
      properties:
        response_options:
          $ref: '#/components/schemas/ForwardChannelResponseOptions'
        private_memory_store_enabled:
          type: boolean
        group_prompt_template:
          type: string
          description: 群聊提示模板；所有渠道均返回。WeChat 固定为 null，不接受配置。
          nullable: true
          maxLength: 4096
      required:
        - response_options
        - private_memory_store_enabled
        - group_prompt_template
      additionalProperties: false
      title: 企业微信
    ForwardDingTalkChannelConfig:
      type: object
      properties:
        response_options:
          $ref: '#/components/schemas/ForwardChannelResponseOptions'
        private_memory_store_enabled:
          type: boolean
        group_prompt_template:
          type: string
          description: 群聊提示模板；所有渠道均返回。WeChat 固定为 null，不接受配置。
          nullable: true
          maxLength: 4096
        card_template_id:
          type: string
          description: >-
            仅 DingTalk；已发布且该应用可访问的互动卡片模板 ID。trim 后 1–256
            字符，只含字母、数字、下划线、点、冒号、连字符；null 关闭模板。
          nullable: true
          default: null
          pattern: ^\s*[A-Za-z0-9_.:-]{1,256}\s*$
        card_content_key:
          type: string
          description: >-
            仅 DingTalk；绑定 Markdown 正文的变量名，默认 content。trim 后 1–64
            字符，字母开头，后续仅字母、数字或下划线。
          default: content
          pattern: ^\s*[A-Za-z][A-Za-z0-9_]{0,63}\s*$
      required:
        - response_options
        - private_memory_store_enabled
        - group_prompt_template
        - card_template_id
        - card_content_key
      additionalProperties: false
      title: 钉钉
    ForwardWeChatChannelConfig:
      type: object
      properties:
        response_options:
          $ref: '#/components/schemas/ForwardChannelResponseOptions'
        private_memory_store_enabled:
          type: boolean
        group_prompt_template:
          type: string
          nullable: true
          enum:
            - null
          description: WeChat 固定为 null。
      required:
        - response_options
        - private_memory_store_enabled
        - group_prompt_template
      additionalProperties: false
      title: 个人微信
    ForwardChannelAgentInput:
      oneOf:
        - type: string
          minLength: 1
          description: Agent ID，trim 后 1–128 字符；Create 解析并固定当前版本。
          example: agent_xxx
          maxLength: 128
        - type: object
          properties:
            type:
              type: string
              enum:
                - agent
            id:
              type: string
              minLength: 1
              description: 当前身份可访问的 Agent ID；trim 后 1–128 字符。
              example: agent_xxx
              maxLength: 128
            version:
              type: integer
              minimum: 1
              description: 正整数，必须属于当前 Agent；省略时创建并固定当前版本。指定版本不存在返回 404；资源预检调用失败返回 500。
              example: 3
          required:
            - type
            - id
          additionalProperties: false
    ForwardChannelMemoryStore:
      type: object
      properties:
        memory_store_id:
          type: string
          minLength: 1
          maxLength: 128
          example: memstore_xxx
          description: Memory Store ID；trim 后 1–128 字符，须属于当前账号且未归档。
        access:
          type: string
          enum:
            - read_only
            - read_write
          default: read_write
      additionalProperties: false
      required:
        - memory_store_id
    ForwardChannelResponseOptionsInput:
      type: object
      properties:
        include_tool_calls:
          type: boolean
          default: false
          description: 展示公开工具名称、状态和返回项数；不展示工具原始参数或结果。
        include_process:
          type: boolean
          default: false
          description: 展示公开 Agent 过程正文，不展示隐藏推理。最终回复取本轮最后一条非空 agent.message。
        card_output:
          type: boolean
          default: true
          description: 启用渠道卡片或流式展示；false 时仅发送最终文本。钉钉还需有效互动卡片模板；个人微信始终仅最终回复。
      additionalProperties: false
    ForwardFeishuCredentials:
      type: object
      properties:
        app_id:
          type: string
          description: 飞书机器人/应用标识；trim 后 1–256 字符。
          minLength: 1
          maxLength: 256
          example: xxx
        app_secret:
          type: string
          description: 飞书 Secret，1–4096 字符；不 trim，仅写入，永不回显。
          minLength: 1
          maxLength: 4096
          writeOnly: true
          example: xxx
      required:
        - app_id
        - app_secret
      additionalProperties: false
      description: >-
        标识字段 trim 后 1–256 字符，Secret 1–4096 字符且不 trim。凭据对象另有加密存储的组合长度上限，组合过长返回
        400；凭据永不回显。
    ForwardWeComCredentials:
      type: object
      properties:
        bot_id:
          type: string
          description: >-
            企业微信智能机器人的 Bot ID，对应长连接 API 配置页的 Bot ID；trim 后 1–256 字符。不接受
            CorpID、AgentId 或群机器人 Webhook URL。
          minLength: 1
          maxLength: 256
          example: xxx
        secret:
          type: string
          description: >-
            同一企业微信智能机器人长连接 API 配置页的 Secret，不是普通自建应用 Secret；1–4096 字符，不
            trim，仅写入，永不回显。
          minLength: 1
          maxLength: 4096
          writeOnly: true
          example: xxx
      required:
        - bot_id
        - secret
      additionalProperties: false
      description: >-
        标识字段 trim 后 1–256 字符，Secret 1–4096 字符且不 trim。凭据对象另有加密存储的组合长度上限，组合过长返回
        400；凭据永不回显。
    ForwardDingTalkCredentials:
      type: object
      properties:
        client_id:
          type: string
          description: 钉钉机器人/应用标识；trim 后 1–256 字符。
          minLength: 1
          maxLength: 256
          example: xxx
        client_secret:
          type: string
          description: 钉钉 Secret，1–4096 字符；不 trim，仅写入，永不回显。
          minLength: 1
          maxLength: 4096
          writeOnly: true
          example: xxx
      required:
        - client_id
        - client_secret
      additionalProperties: false
      description: >-
        标识字段 trim 后 1–256 字符，Secret 1–4096 字符且不 trim。凭据对象另有加密存储的组合长度上限，组合过长返回
        400；凭据永不回显。
    ForwardChannelAgent:
      type: object
      properties:
        type:
          type: string
          enum:
            - agent
        id:
          type: string
          example: agent_xxx
        version:
          type: integer
          example: 3
      required:
        - type
        - id
        - version
      additionalProperties: false
    ForwardChannelResponseOptions:
      type: object
      properties:
        include_tool_calls:
          type: boolean
          default: false
          description: 展示公开工具名称、状态和返回项数；不展示工具原始参数或结果。
        include_process:
          type: boolean
          default: false
          description: 展示公开 Agent 过程正文，不展示隐藏推理。最终回复取本轮最后一条非空 agent.message。
        card_output:
          type: boolean
          default: true
          description: 启用渠道卡片或流式展示；false 时仅发送最终文本。钉钉还需有效互动卡片模板；个人微信始终仅最终回复。
      required:
        - include_tool_calls
        - include_process
        - card_output
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        标准的 HTTP Bearer 认证方式，在 [API
        Keys](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) 页面获取密钥。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.