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

# Delete Subscription

> Delete an Auto Bandwidth subscription

## Delete Subscription

Deletes a subscription. We stop watching the address and take back the bandwidth we delegated to it, within a few seconds; the address becomes free for a new subscription. A transfer that used our bandwidth before the deletion is still charged. Requires the `buy_bandwidth` scope.

To stop for a while without losing the settings, [pause the subscription](https://docs.tronrental.com/api-reference/auto-bandwidth/update-subscription.md) with `enabled: false` instead.

### Path parameters

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

Subscription ID — the `id` from Create or List Subscriptions

### Response

**id** `number`

The deleted subscription's ID

**status** `string`

`deleted`

### Example

```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"
}
```

### Errors

| Status | Code | When |
| - | - | - |
| `403` | `FORBIDDEN` | The API key lacks the `buy_bandwidth` scope |
| `404` | `NOT_FOUND` | No subscription with this ID on your account (or it was already deleted) |

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