AutoWithdrawService
Get Auto-Withdraw Rule
Read the latest version of the account's auto-withdraw rule. The rule is absent when the account never had one.
Request
curl --request GET \ \ --url 'https://api.testnet.polyester.com/v1/auto-withdraw/rule?subaccountId=45LUmqjT' \ --header 'Accept: */*' \ --header 'X-API-KEY-ID: YOUR_API_KEY_ID' \ --header 'X-API-TIMESTAMP: YOUR_API_TIMESTAMP' \ --header 'X-API-SIGNATURE: YOUR_API_SIGNATURE'
Responses
{
"rule": {
"createdAt": "2025-01-01T00:00:00Z",
"createdByAccountId": "4Rh4iXdT",
"destinations": [
{
"assetId": 100,
"destinationAddress": "0x3333333333333333333333333333333333333333",
"destinationChainId": "1",
"maxAmount": "18.446744073709551617",
"minAmount": "18.446744073709551617",
"minFloor": "18.446744073709551617"
}
],
"enabled": false,
"minUsdValue": "18.446744073709551617",
"pause": {
"assetId": 100,
"pausedAt": "2025-01-01T00:00:00Z",
"reason": "value"
},
"schedule": {
"anchorDate": "",
"cadence": "DAILY",
"dayOfMonth": 0,
"minuteOfDay": 840,
"minuteOfHour": 0,
"weekday": "MONDAY"
},
"subaccountId": "45LUmqjT",
"version": 1
}
}Public subaccount ID; omit for the caller's root account. Public ID, as a base58 string.
When this version was created.
2025-01-01T00:00:00ZPublic account ID of the person who created this version. Public ID, as a base58 string.
4Rh4iXdTLedger asset paid. At most one destination per asset.
100Destination address on destination_chain_id. It must be on the account's external withdraw whitelist when the rule is written and whenever a run pays it. Responses carry its canonical form.
0x3333333333333333333333333333333333333333External destination chain identifier.
1The most one run pays the asset, as a decimal string in whole units of the asset.
18.446744073709551617A run pays the asset only from this amount, as a decimal string in whole units of the asset, for example '0.5'.
18.446744073709551617The least amount one payout to this destination can pay now, as a decimal string in whole units of the asset: the route's withdrawal minimum, and more than its current network fee. It follows the network fee, so it can change between reads. Absent when the route or its network fee is not known now.
18.446744073709551617Whether the rule runs. A paused version (enabled false) keeps its schedule and destinations, so it resumes to the same destinations. The rule runs only while enabled and without a pause.
falseLeast USD value one payout pays, as a decimal string in whole USD, for example '25'; '0' means no USD minimum.
18.446744073709551617Asset whose payout paused the rule; zero when no payout did.
100When the rule was paused.
2025-01-01T00:00:00ZMachine-readable reason: destination_not_whitelisted when the destination left the account's external withdraw whitelist, destination_invalid when it is no longer a valid destination, or authority_revoked when the person who set the rule may no longer change it or withdraw from the account. On a broker vault the rule pauses with authority_revoked as soon as its author's broker role changes in any way: removed, demoted, or promoted (for example Finance to Owner), and also when the author is removed and added back. An Owner or Finance member resumes it with a fresh step-up.
valueA UTC date (YYYY-MM-DD) in a week a BIWEEKLY rule runs; weeks start on Monday. Responses return the Monday that starts that week.
How often the rule runs.
DAILYRun day of a MONTHLY rule, 1 to 31; see MONTHLY for shorter months.
0Minute after 00:00 UTC the run starts, 0 to 1439, for every cadence but HOURLY; must be 0 for an hourly rule.
840Minute past every hour an HOURLY rule is checked, 0 to 59.
0Run day of a weekly or biweekly rule.
MONDAYPublic subaccount ID the rule belongs to; zero for the root account. Public ID, as a base58 string.
45LUmqjTRule version, starting at 1.
1| Key | HTTP status | Connect code | Error | When |
|---|---|---|---|---|
| unauthenticated | 401 | unauthenticated | Unauthenticated | Authentication required. |
| permission-denied | 403 | permission_denied | Permission Denied | Permission denied. |
| invalid-argument | 400 | invalid_argument | Invalid Argument | Invalid argument. |
| not-found | 404 | not_found | Not Found | Not found. |
| unavailable | 503 | unavailable | Unavailable | Service unavailable. |