## Delivery channels (`message-channels`)

Configure and test the email (SMTP) and SMS delivery channels.

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

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

Delivery channels · Authentication: Admin only

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

### PUT `/api/v2/message-channels`

Update delivery channels · Authentication: Admin only

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `sms` | SmsChannel | Yes | SMS channel settings. |
| `smtp` | SmtpChannel | Yes | SMTP email channel settings. |

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

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

Test delivery channel · Authentication: Admin only

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `channel` | string | Yes | Channel to test (email or sms). Values: ["email","sms"] |
| `draft` | ChannelTestDraft |  | Unsaved channel settings; same shape as the save endpoint, omitted fields and blank secrets fall back to the stored values. |
| `template_id` | string |  | An approved template id is required for the Tencent Cloud SMS channel (not needed for SMSBao). |
| `to` | string | Yes | Recipient address or phone number. |

```sh
curl -X POST "https://panel.example.com/api/v2/message-channels/test" \
  -H "X-API-Key: $GOCDN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"channel":"email","to":"admin@example.com"}'
```

Delivery channels object:

| Field | Type | Required | Description |
|---|---|---|---|
| `channel` | string | Yes | Channel to test (email or sms). Values: ["email","sms"] |
| `draft` | ChannelTestDraft |  | Unsaved channel settings; same shape as the save endpoint, omitted fields and blank secrets fall back to the stored values. |
| `error` | string |  | Error message when the test failed. |
| `ok` | boolean |  | Whether the test send succeeded. |
| `sms` | SmsChannel |  | SMS channel settings. |
| `smtp` | SmtpChannel |  | SMTP email channel settings. |
| `template_id` | string |  | An approved template id is required for the Tencent Cloud SMS channel (not needed for SMSBao). |
| `to` | string | Yes | Recipient address or phone number. |
