Skip to main content
PATCH
Update Energy Rule

Update Energy Rule

Changes the threshold, volume or label of a rule, or pauses and resumes it. Send only the fields you want to change; the others stay as they are. Changes apply from the next check. Requires the buy_energy scope. The address and the duration of a rule cannot be changed. To move a rule to another address, delete it and create a new one.

Path parameters

number
required
Rule ID — the id from Create or List Energy Rules

Request body

number
New threshold. From 1 to 50,000,000.
number
New energy amount per refill. From 1 to 5,000,000.
string
New label, up to 100 characters. An empty string removes the label.
string
"paused" to pause the rule, "active" to resume it. Resuming also clears stopped_reason and resets consecutive_failures to 0. A rule stopped for balance resumes on its own after a deposit, so you do not have to; if you resume it while the balance is still short, it stops again at the next check. stopped_insufficient_balance cannot be set directly.

Response

The updated rule, with the same fields as in List Energy Rules.

Example

Response

Errors