OrdersService
Cancel All After (Dead-Man Switch)
Set or disable a dead-man switch timeout for automatic cancel-all. Supports optional symbol and side scope with idempotent heartbeat refresh.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/v1/orders/cancel-all-after' \
--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' \
--header 'Content-Type: application/json' \
--data '{
"requestId": "request_01J0EXAMPLE",
"side": "BUY",
"subaccountId": "45LUmqjT",
"symbol": "BTC-USDT",
"timeoutSec": 60
}'Responses
{
"effectiveScope": {
"accountId": "4Rh4iXdT",
"side": "BUY",
"symbolId": 1
},
"effectiveTimeoutSec": 60,
"expiresAtTsNs": "1735689600000000000",
"status": "ARMED",
"ts": "2025-01-01T00:00:00Z",
"tsNs": "1735689600000000000"
}Idempotency/trace key from caller (required).
Optional side filter for cancel-on-expiry.
Optional public subaccount ID. When omitted, subaccount-scoped API keys use their bound subaccount; other callers use their authenticated root account.
Optional trading pair symbol, e.g. BTC-USDT.
Heartbeat timeout in seconds. - 0 disables the dead-man switch for this account. - 10..120 arms or refreshes the switch.
Public ID of the account or sub-account whose orders are canceled.
4Rh4iXdTOrder side that is canceled. Not set means both sides; JSON and REST responses then omit it.
BUYSymbol ID whose orders are canceled. Zero or omitted means all symbols.
1Effective timeout in seconds (0 when disabled).
60Expiry timestamp in epoch nanoseconds (0 when disabled).
1735689600000000000Dead-man switch state after applying the request.
ARMEDServer timestamp.
2025-01-01T00:00:00ZServer timestamp as epoch nanoseconds (for bots).
1735689600000000000| 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. |