Skip to content

Create an auto-refill rule (energy)

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

Required API-key scope: trade

Keep an address topped up: whenever its energy falls below minimal, volume energy is delivered for duration.

Each delivery is charged to your TRX balance at your price — there is no prepaid budget. If the balance can no longer cover the next delivery the rule is paused automatically; set autoResume to have it come back by itself once you top up.

Energy only — bandwidth has no automations.

object
targetAddress
required
string
minimal
required
integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
volume
required
integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
duration
required
string
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
feeSaverOrderId
required
null | integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
createdAt
required
string format: date-time
updatedAt
required
string format: date-time