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

# Add Token Contract

> Add a TRC-20 token of your own for Auto Bandwidth

## Add Token Contract

Adds a TRC-20 contract to your token list, so that a subscription can use it with `token: "CUSTOM"` or `"OWN"`. We ask the network whether the address is a TRC-20 token whose transfers go through, and read its symbol, name, decimals and how much bandwidth one transfer takes. Requires the `buy_bandwidth` scope.

Adding a contract that is already in your list returns it again, without a new check and without counting towards the request limit.

### Request body

**address** `string` *required*

Address of the TRC-20 contract (T... format, 34 characters). USDT and USDD are rejected — choose them with `token`.

### Response

The contract, with the same fields as in [List Token Contracts](https://docs.tronrental.com/api-reference/auto-bandwidth/list-contracts.md). Use `bandwidth` as a guide for the subscription `volume`, with a small margin.

### Example

```bash cURL theme={null}
curl -X POST https://api.tronrental.com/v1/bandwidth/auto/contracts \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"address": "TYourTokenContract1234567890abcdef"}'
```

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

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

```javascript JavaScript theme={null}
const resp = await fetch("https://api.tronrental.com/v1/bandwidth/auto/contracts", {
  method: "POST",
  headers: { "X-API-Key": "your_api_key", "Content-Type": "application/json" },
  body: JSON.stringify({ address: "TYourTokenContract1234567890abcdef" }),
});
console.log(await resp.json());
```

```json Response theme={null}
{
  "address": "TYourTokenContract1234567890abcdef",
  "symbol": "MTK",
  "name": "My Token",
  "decimals": 6,
  "bandwidth": 345
}
```

### Errors

| Status | Code | When |
| - | - | - |
| `400` | `INVALID_ADDRESS` | `address` is not a valid TRON address |
| `400` | `AUTO_BW_NOT_A_CONTRACT` | There is no smart contract at this address |
| `400` | `AUTO_BW_NOT_A_TOKEN` | The contract is not a TRC-20 token |
| `400` | `AUTO_BW_TRANSFER_REVERTS` | A transfer of this token fails in simulation — for example, the token is paused |
| `403` | `FORBIDDEN` | The API key lacks the `buy_bandwidth` scope |
| `409` | `AUTO_BW_CONTRACT_LISTED` | This is USDT or USDD — choose it with `token`; the token is in `error.token` |
| `409` | `AUTO_BW_CONTRACT_LIMIT` | Your list already has 20 contracts — remove one first |
| `429` | `RATE_LIMIT_EXCEEDED` | Too many new contracts — see [Rate Limits](https://docs.tronrental.com/resources/rate-limits.md) |
| `503` | `AUTO_BW_DISABLED` | Auto Bandwidth is temporarily switched off — try again later |
| `503` | `TEMPORARILY_UNAVAILABLE` | The network could not be read right now; nothing was saved — retry after the `Retry-After` seconds |

```json theme={null}
{
  "detail": {
    "error": {
      "code": "AUTO_BW_CONTRACT_LISTED",
      "message": "This is USDT; pick it in the token list",
      "token": "USDT"
    }
  }
}
```


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