Skip to content

Update Low Balance Settings

PUT https://api.echovalue.dev/token/settings

Configures low-balance notifications.

Headers:

HeaderDescription
x-tokenYour API token
Content-TypeMust be application/json

Body (application/json):

FieldTypeDescriptionRequired
low_balance_thresholdintegerBalance threshold that triggers notifications. Set to 0 to disable.No
low_balance_webhookobjectWebhook configurationNo
low_balance_emailstringEmail address to receive notificationsNo

Webhook configuration object:

FieldTypeDescriptionRequired
urlstringHTTPS URL to receive the notificationYes
headersobjectCustom headers to include in the webhook requestNo
formatstringNative payload format: slack, discord, teams, telegram, pagerduty, customNo
templateobjectJSON template when format is custom. Supports {{wallet}}, {{threshold}}, {{token_hash}} placeholdersNo
optionsobjectFormat-specific options such as chat_id or routing_keyNo

Notifications are sent at most once per low-balance incident. The cooldown resets after the balance rises back above the threshold.

200 OK

OK

Response headers:

HeaderDescription
x-balanceWallet balance after this call
x-costCredits consumed

See Response Headers for details.

StatusMeaning
200Settings updated
400Invalid webhook URL or invalid threshold
401Invalid token
402Insufficient credits
  • Set low_balance_threshold to 0 to disable notifications.
  • low_balance_webhook.url must be HTTPS.
Terminal window
curl 'https://api.echovalue.dev/token/settings' \
-X PUT \
-H 'x-token: mytoken' \
-H 'Content-Type: application/json' \
-d '{
"low_balance_threshold": 10,
"low_balance_webhook": {
"url": "https://yourdomain.com/alert",
"format": "slack"
},
"low_balance_email": "alerts@example.com"
}'