Channel

创建微信扫码会话

Changed on

创建个人微信扫码会话。Body 只能为空或 {},其他内容返回 400。成功返回 201;不能给非 WeChat Channel 创建二维码,返回 409。

post/agent/forward/v0/channels/{channelId}/qr-sessions

Request

  • Base URL
    https://agent-api.bigmodel.cn/api
  • Auth
    HTTP bearer

Path parameters

channelIdstring required
Example:channel_wechat_xxx

当前账号的 WeChat Channel ID。

Headers

zai-version'2026-05-26' required
Example:2026-05-26

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

zai-betastring required
Example:managed-agents-2026-05-26

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

Request body

object required

Response

扫码会话创建成功。

type'channel_qr_session' required

固定资源类型。

session_keystring required

扫码会话 ID。

channel_idstring required

所属 Channel。

provider'wechat' required

固定 wechat。

status'waiting' | 'scanned' | 'confirmed' | 'expired' | 'denied' | 'error' required

scanned 只表示已扫码;confirmed 表示手机端确认成功,仍需查询 Channel 状态。

qr_codestring nullable required

PNG data URL,仅有效 waiting/scanned 状态返回;终态或过期为 null。不要公开到群聊或共享文档。

expires_atstring date-time required

约 8 分钟,以此过期时间为准。

confirmed_atstring date-time nullable required

确认时间,未确认时为 null。

created_atstring date-time required

创建时间。

updated_atstring date-time required

更新时间。

errorobject nullable

仅 error 状态可能返回的安全错误提示。

Example response

{
  "type": "channel_qr_session",
  "session_key": "chqr_xxx",
  "channel_id": "channel_wechat_xxx",
  "provider": "wechat",
  "status": "confirmed",
  "qr_code": null,
  "expires_at": "2026-10-30T00:08:00.000Z",
  "confirmed_at": "2026-10-30T00:01:00.000Z",
  "created_at": "2026-10-30T00:00:00.000Z",
  "updated_at": "2026-10-30T00:01:00.000Z"
}

Changes