> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tronrental.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Удалить правило для bandwidth

> Удаление правила автопополнения bandwidth

## Удалить правило для bandwidth

Удаляет правило. Пополнений по нему больше не будет, а адрес освобождается для нового правила для bandwidth. Уже купленный bandwidth не забирается: эти аренды действуют до конца своего срока. Прошлые заказы пополнения остаются в истории заказов. Нужен скоуп `buy_bandwidth`.

Чтобы на время остановить пополнения, не теряя правило, лучше [поставьте его на паузу](/ru/api-reference/auto-refill/update-bandwidth-rule).

### Параметры пути

**rule\_id** `number` *required*

ID правила — `id` из ответа создания или списка правил для bandwidth

### Ответ

**status** `string`

`ok`

### Пример

```bash cURL theme={null}
curl -X DELETE https://api.tronrental.com/v1/bandwidth/auto-refill/15 \
  -H "X-API-Key: your_api_key"
```

```python Python theme={null}
import requests

resp = requests.delete(
    "https://api.tronrental.com/v1/bandwidth/auto-refill/15",
    headers={"X-API-Key": "your_api_key"},
)
print(resp.json())
```

```javascript JavaScript theme={null}
const resp = await fetch("https://api.tronrental.com/v1/bandwidth/auto-refill/15", {
  method: "DELETE",
  headers: { "X-API-Key": "your_api_key" },
});
console.log(await resp.json());
```

```json Response theme={null}
{
  "status": "ok"
}
```

### Ошибки

| Статус | Код | Когда |
| - | - | - |
| `403` | `FORBIDDEN` | У API-ключа нет скоупа `buy_bandwidth` |
| `404` | `NOT_FOUND` | В вашем аккаунте нет правила для bandwidth с таким ID (или оно уже удалено) |
| `409` | `AUTOREFILL_IN_PROGRESS` | Прямо сейчас по этому правилу покупается пополнение — повторите через минуту |

```json theme={null}
{
  "detail": {
    "error": {
      "code": "NOT_FOUND",
      "message": "Auto-refill rule not found"
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.