Skip to main content
POST
Create Bandwidth Rule

Create Bandwidth Rule

Creates an Auto Refill rule for one address. From the next check on, whenever the address has less available bandwidth than threshold_bandwidth, we buy add_volume bandwidth for the chosen duration and charge your balance. See the overview for how checks, cost and statuses work. The request only creates the rule — it does not buy anything itself. Requires the buy_bandwidth scope. To see the price of one refill first, use Bandwidth Refill Quote.
Available bandwidth counts everything the address can pay for a transaction with: the free 600 a day plus any staked or delegated bandwidth. A threshold of 600 or less is met by the free allowance alone until the address has spent it.

Request body

string
required
TRON address to keep supplied (T… format, 34 characters). Contract addresses are rejected.
number
required
Buy when the address has less available bandwidth than this. From 1 to 1,000,000.
number
required
Bandwidth to buy per refill. From 350 to 100,000. Keep it at or above threshold_bandwidth — see the warning in the overview.
string
default:"1h"
Rental duration of each refill: "1h" or "1d".
string
Your own name for the rule, up to 100 characters. Optional.

Response

The new rule — the same fields as in List Bandwidth Rules — plus two fields about the address right now:
number | null
Bandwidth available on the address at the moment the rule was created, free bandwidth included. null if it could not be read; the rule is created either way.
boolean
true if current_bandwidth is already below the threshold, so the next check — usually within a minute — will buy. false if the address has enough, or if the level could not be read.

Example

Response

Errors

A validation error comes in the framework’s format, with detail as an array:
Retrying a create after a timeout is safe. If the first request went through, the retry returns 409 AUTOREFILL_ADDRESS_TAKEN instead of making a second rule; list your rules to get its id.