Skip to content

Create an auto-renewal rule (energy)

POST
/api/v1/automations/renewal
curl --request POST \
--url https://trongas.ai/api/v1/automations/renewal \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <X-Api-Key>' \
--data '{ "targetAddress": "example", "volume": 1, "autoResume": false }'

Required API-key scope: purchase

Renew a fixed volume of energy on an address once a day, regardless of how much is left — unlike auto-refill, which reacts to a threshold.

Each renewal is charged to your TRX balance at your price. Creating the rule requires enough free balance for at least one renewal, otherwise 402 wallet.insufficient_balance. Free balance is your TRX balance minus what your other active rules already hold for their next firing, so one balance can’t fund several new rules at once. If the balance can no longer cover the next one the rule is paused; set autoResume to have it come back by itself once you top up.

Energy only.

503 pricing.unavailable — the price is temporarily unknown; no rule was created, retry shortly.

object
targetAddress
required
string
volume
required
integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
autoResume
boolean

OK

object
id
required
string format: uuid
type
required
string
resource
required
string
targetAddress
required
string
minimal
required
null | integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
volume
required
null | integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
duration
required
null | string
spentTrx
required
string
status
required
string
pauseReason
required
null | string
autoResume
required
boolean
createdAt
required
string format: date-time
updatedAt
required
string format: date-time

Payment Required

object
type
null | string
title
null | string
status
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
detail
null | string
instance
null | string
code

Machine-readable error code, e.g. wallet.insufficient_balance. Branch on this, not on title. Always present: validation_failed for request validation (400, with per-field errors), unauthorized for 401, domain codes otherwise.

null | string

Service Unavailable