> ## 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 до удаления, всё равно оплачивается. Нужен скоуп `buy_bandwidth`.

Чтобы ненадолго остановиться, не теряя настроек, вместо этого [поставьте подписку на паузу](https://docs.tronrental.com/ru/api-reference/auto-bandwidth/update-subscription.md) с `enabled: false`.

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

**sub\_id** `number` *required*

ID подписки — `id` из создания подписки или списка подписок

### Ответ

**id** `number`

ID удалённой подписки

**status** `string`

`deleted`

### Пример

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

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

resp = requests.delete(
    "https://api.tronrental.com/v1/bandwidth/auto/42",
    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/42", {
  method: "DELETE",
  headers: { "X-API-Key": "your_api_key" },
});
console.log(await resp.json());
```

```json Response theme={null}
{
  "id": 42,
  "status": "deleted"
}
```

### Ошибки

| Статус | Код | Когда |
| - | - | - |
| `403` | `FORBIDDEN` | У API-ключа нет скоупа `buy_bandwidth` |
| `404` | `NOT_FOUND` | В вашем аккаунте нет подписки с таким ID (или она уже удалена) |

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


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