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

# 删除带宽规则

> 删除一条带宽自动补充规则

## 删除带宽规则

删除一条规则。该规则不再进行任何补充，该地址也可以重新用于新的带宽规则。已购买的带宽不会被收回：这些租赁会持续到其租期结束。以往的补充订单会保留在您的订单历史中。需要 `buy_bandwidth` 权限。

如果只想暂时停止补充而不丢失规则，请改为[暂停规则](/zh/api-reference/auto-refill/update-bandwidth-rule)。

### 路径参数

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

规则 ID——创建或列出带宽规则时返回的 `id`

### 响应

**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` | 您的账户中没有此 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.