Update Low Balance Settings
PUT https://api.echovalue.dev/token/settings
Configures low-balance notifications.
Request
Section titled “Request”Headers:
| Header | Description |
|---|---|
x-token | Your API token |
Content-Type | Must be application/json |
Body (application/json):
| Field | Type | Description | Required |
|---|---|---|---|
low_balance_threshold | integer | Balance threshold that triggers notifications. Set to 0 to disable. | No |
low_balance_webhook | object | Webhook configuration | No |
low_balance_email | string | Email address to receive notifications | No |
Webhook configuration object:
| Field | Type | Description | Required |
|---|---|---|---|
url | string | HTTPS URL to receive the notification | Yes |
headers | object | Custom headers to include in the webhook request | No |
format | string | Native payload format: slack, discord, teams, telegram, pagerduty, custom | No |
template | object | JSON template when format is custom. Supports {{wallet}}, {{threshold}}, {{token_hash}} placeholders | No |
options | object | Format-specific options such as chat_id or routing_key | No |
Notifications are sent at most once per low-balance incident. The cooldown resets after the balance rises back above the threshold.
Response
Section titled “Response”200 OK
OKResponse headers:
| Header | Description |
|---|---|
x-balance | Wallet balance after this call |
x-cost | Credits consumed |
See Response Headers for details.
Status Codes
Section titled “Status Codes”| Status | Meaning |
|---|---|
200 | Settings updated |
400 | Invalid webhook URL or invalid threshold |
401 | Invalid token |
402 | Insufficient credits |
- Set
low_balance_thresholdto0to disable notifications. low_balance_webhook.urlmust be HTTPS.
Examples
Section titled “Examples”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" }'