> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/welcome/cn/platform/notification-center/add-bots.md).

# 设置机器人

机器人用于通过 Webhook 向您的即时通讯（IM）群组发送消息通知。目前支持主流的一些即时通讯工具，如 Slack、企业微信、飞书、钉钉、Telegram、Webhook 等。

<div align="left" data-with-frame="true"><figure><img src="/files/qF31UC4fUxra2LVXUeXu" alt=""><figcaption></figcaption></figure></div>

## 添加机器人

1. 在消息中心，进入**机器人**。
2. 点击\*\*+ 添加机器人\*\*。
3. 选择您的即时通讯应用。
4. 输入该应用提供的 Webhook 地址，并为机器人命名。
5. 点击**确认**。

如需配置自定义 Webhook，请参阅下方[自定义 Webhook](#zi-ding-yi-webhook)。

## 自定义 Webhook

使用 **Webhook** 选项，可将 zenConsole 告警推送到任何支持 HTTP 请求的服务。

### 配置说明

| 字段            | 说明                                         |
| ------------- | ------------------------------------------ |
| Webhook 地址    | 接收通知请求的端点地址。                               |
| 机器人名称         | 用于标识该机器人的显示名称。                             |
| HTTP Method   | 发送请求使用的 HTTP 方法，默认为 `POST`。                |
| Authorization | 可选。`Authorization` 请求头的值，默认使用 `Bearer` 方案。 |

### 请求体

zenConsole 以 JSON 格式发送通知，其中 `${content}` 会被替换为实际通知内容：

```json
{
  "text": "${content}"
}
```

以下是一条通知负载的示例：

```json
{
  "teamName": "QC-TEST15",
  "duration": "5min",
  "restoreTime": "2025-11-14 09:00:28 UTC",
  "instance": "d01f4c25-026c-4bdc-be1e-22d5803fc07f",
  "instanceName": "qctest0924e.ecn.zenlayer.net",
  "metricDesc": "Edge 5xx Codes Error Rate",
  "information": "Edge 5xx Codes Error Rate > 50% for 5 min",
  "triggerTime": "2025-11-14 08:55:00 UTC",
  "currentValue": "100.00%"
}
```

### 成功条件

您的端点必须返回 HTTP `200` 状态码，其他状态码均视为推送失败。
