## Alert webhooks (`message-webhooks`)

DingTalk, Feishu, WeCom, Telegram and generic JSON alert outputs; several can be configured, and addresses and secrets show only the last 4 characters.

Authentication: Admin only · Docs: https://www-demo.kuxitong.com/en/docs/api/message-webhooks

### GET `/api/v2/message-webhooks`

List alert webhooks · Authentication: Admin only

Query parameters:

| Field | Type | Required | Description |
|---|---|---|---|
| `page` | integer |  | Page number, starting from 1 Default: 1 |
| `page_size` | integer |  | Items per page Default: 20 |

```sh
curl "https://panel.example.com/api/v2/message-webhooks" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

### POST `/api/v2/message-webhooks`

Create alert webhook · Authentication: Admin only

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `chat_id` | string |  | Telegram chat (numeric id or @channel name). |
| `created_at` | string | Yes | Created at |
| `enabled` | boolean |  | Whether it is enabled; disabled ones are skipped. Enabled by default. |
| `id` | integer | Yes | Record ID |
| `kind` | string | Yes | Kind: dingtalk, feishu, wecom, telegram or generic JSON. Values: ["dingtalk","feishu","wecom","telegram","generic"] |
| `last4` | string |  | Last 4 characters of the address (the token for Telegram), for recognition only. |
| `name` | string | Yes | Name, unique across all webhooks. |
| `secret` | string |  | Bot token for Telegram (required); signing secret for the others (optional). Write-only, never echoed. |
| `updated_at` | string | Yes | Updated at |
| `url` | string |  | Bot URL (https, public; required for DingTalk, Feishu, WeCom and generic; unused for Telegram). Write-only, never echoed. |

```sh
curl -X POST "https://panel.example.com/api/v2/message-webhooks" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

### POST `/api/v2/message-webhooks/test`

Test unsaved alert webhook · Authentication: Admin only

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `chat_id` | string |  | Telegram chat (numeric id or @channel name). |
| `id` | integer |  | Record ID |
| `kind` | string | Yes | Kind: dingtalk, feishu, wecom, telegram or generic JSON. Values: ["dingtalk","feishu","wecom","telegram","generic"] |
| `secret` | string |  | Bot token for Telegram (required); signing secret for the others (optional). Write-only, never echoed. |
| `url` | string |  | Bot URL (https, public; required for DingTalk, Feishu, WeCom and generic; unused for Telegram). Write-only, never echoed. |

```sh
curl -X POST "https://panel.example.com/api/v2/message-webhooks/test" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

### PUT `/api/v2/message-webhooks/{id}`

Update alert webhook · Authentication: Admin only

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `chat_id` | string |  | Telegram chat (numeric id or @channel name). |
| `created_at` | string | Yes | Created at |
| `enabled` | boolean |  | Whether it is enabled; disabled ones are skipped. Enabled by default. |
| `id` | integer | Yes | Record ID |
| `kind` | string | Yes | Kind: dingtalk, feishu, wecom, telegram or generic JSON. Values: ["dingtalk","feishu","wecom","telegram","generic"] |
| `last4` | string |  | Last 4 characters of the address (the token for Telegram), for recognition only. |
| `name` | string | Yes | Name, unique across all webhooks. |
| `secret` | string |  | Bot token for Telegram (required); signing secret for the others (optional). Write-only, never echoed. |
| `updated_at` | string | Yes | Updated at |
| `url` | string |  | Bot URL (https, public; required for DingTalk, Feishu, WeCom and generic; unused for Telegram). Write-only, never echoed. |

```sh
curl -X PUT "https://panel.example.com/api/v2/message-webhooks/{id}" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

### DELETE `/api/v2/message-webhooks/{id}`

Delete alert webhook · Authentication: Admin only

```sh
curl -X DELETE "https://panel.example.com/api/v2/message-webhooks/{id}" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

### POST `/api/v2/message-webhooks/{id}/test`

Test saved alert webhook · Authentication: Admin only

```sh
curl -X POST "https://panel.example.com/api/v2/message-webhooks/{id}/test" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

Alert webhooks object:

| Field | Type | Required | Description |
|---|---|---|---|
| `chat_id` | string |  | Telegram chat (numeric id or @channel name). |
| `created_at` | string |  | Created at (read-only) |
| `enabled` | boolean |  | Whether it is enabled; disabled ones are skipped. Enabled by default. |
| `error` | string |  | Error message when the test failed. |
| `id` | integer |  | Record ID (read-only) |
| `kind` | string |  | Kind: dingtalk, feishu, wecom, telegram or generic JSON. Values: ["dingtalk","feishu","wecom","telegram","generic"] |
| `last4` | string |  | Last 4 characters of the address (the token for Telegram), for recognition only. (read-only) |
| `name` | string |  | Name, unique across all webhooks. |
| `ok` | boolean |  | Whether the test send succeeded. |
| `secret` | string |  | Bot token for Telegram (required); signing secret for the others (optional). Write-only, never echoed. |
| `updated_at` | string |  | Updated at (read-only) |
| `url` | string |  | Bot URL (https, public; required for DingTalk, Feishu, WeCom and generic; unused for Telegram). Write-only, never echoed. |
