# Cập nhật chuyển tiếp email

`PUT /v1/domain/@id/emforwarding` · quyền `domains:write`

Đặt quy tắc chuyển tiếp email của tên miền.

## HTTP request

| Mục | Giá trị |
| --- | --- |
| URL | `https://api.tino.vn/v1/domain/@id/emforwarding` |
| Method | `PUT` |
| Quyền (scope) | `domains:write` |
| Header | `Authorization: Bearer <token>` |
| Content-Type | `application/json` |
| Token gọi được | token ứng dụng (`tinoat_`), token API cá nhân (`tinopat_`) |

## Tham số

| Tên | Vị trí | Kiểu | Bắt buộc | Mô tả |
| --- | --- | --- | --- | --- |
| `id` | đường dẫn | string | có | ID tên miền |
| `from` | body | string | không | Email address that you want to forward |
| `to` | body | string | không | Email address that will receive forwarded emails |
| `records` | body | array | không | Multiple forwarding rules [{"from":"info","to":"dest@example.com"},{"from":"support","to":"help@example.com"}] |

## Example request

```bash
curl -X PUT "https://api.tino.vn/v1/domain/200001/emforwarding" \
  -H "Authorization: Bearer $TINO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "from": "info@example.com",
  "to": "destination@example.com",
  "records": "<records>"
}'
```

`$TINO_TOKEN` là token có quyền `domains:write`. Tham số đường dẫn trong ví dụ là giá trị mẫu.

SDK ([SDK & Ví dụ](/docs/sdk)): Python `client.domains.update_email_forwarding(id, id=...)`, Node.js `await client.domains.updateEmailForwarding(id, { id: ... });`, PHP `$client->domains->updateEmailForwarding($id, ['id' => ...]);`.

## Example response

```json
{
 "success": true,
 "info": [
  "success_changes_save"
 ]
}
```

Mẫu thật từ tài khoản thử, đã che dữ liệu cá nhân; mảng và chuỗi dài được rút gọn (`… N more item(s)`, `… N more line(s)`).
