# Bật/tắt tự gia hạn tên miền

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

Bật hoặc tắt tự gia hạn tên miền.

## HTTP request

| Mục | Giá trị |
| --- | --- |
| URL | `https://api.tino.vn/v1/domain/@id/autorenew` |
| 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 | integer | có | ID tên miền |
| `autorenew` | body | boolean | có | true\|false |

## Example request

```bash
curl -X PUT "https://api.tino.vn/v1/domain/200001/autorenew" \
  -H "Authorization: Bearer $TINO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "autorenew": true
}'
```

`$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_auto_renew(id, autorenew=...)`, Node.js `await client.domains.updateAutoRenew(id, { autorenew: ... });`, PHP `$client->domains->updateAutoRenew($id, ['autorenew' => ...]);`.

## 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)`).
