Auto Refill
Create Energy Rule
Top up energy on an address whenever it falls below a threshold
POST
Create Energy Rule
Create Energy Rule
Creates an Auto Refill rule for one address. From the next check on, whenever the address has less available energy thanthreshold_energy, we buy add_volume energy for one hour 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_energy scope. To see the price of one refill first, use Energy Refill Quote.
Request body
TRON address to keep supplied (T… format, 34 characters). Contract addresses are rejected.
Energy to buy per refill. From 1 to 5,000,000. Keep it at or above
threshold_energy — see the warning in the overview.Rental duration of each refill. Only
"1h" is accepted; any other value returns 422.Response
The new rule — the same fields as in List Energy Rules — plus two fields about the address right now:Energy available on the address at the moment the rule was created.
null if it could not be read; the rule is created either way.true if current_energy 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
detail as an array: