alerts.v1.PriceAlertService
CancelAlert
CancelAlert cancels an active alert. Cancelling a cancelled alert returns it unchanged. Errors: - INVALID_ARGUMENT: malformed request. - NOT_FOUND: ALERT_NOT_FOUND. - FAILED_PRECONDITION: ALERT_TRIGGERED; the alert already fired. - UNAVAILABLE: SERVICE_UNAVAILABLE; retry. - PERMISSION_DENIED: SUBACCOUNT_KEY_REFUSED. - UNAUTHENTICATED: missing or invalid credentials.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/alerts.v1.PriceAlertService/CancelAlert' \
--header 'Content-Type: application/json' \
--header 'Connect-Protocol-Version: 1' \
--data '{
"alertId": "1"
}'Responses
{
"alert": {
"alertId": "1",
"armed": false,
"channels": [
"IN_APP"
],
"createdAt": "2025-01-01T00:00:00Z",
"direction": "ABOVE",
"priceSource": "LAST_PRICE",
"priceTicks": "61000250000000",
"referencePriceTicks": "61000250000000",
"revision": "1",
"status": "ACTIVE",
"symbolId": 1,
"triggeredAt": "2025-01-01T00:00:00Z",
"triggeredPriceTicks": "61000250000000",
"updatedAt": "2025-01-01T00:00:00Z"
}
}alerts.v1.CancelAlertRequestalerts.v1.CancelAlertResponsePublic alert ID.
Public alert ID.
Numeric spot market identifier; resolve its symbol with GetSpotConfig.
Price crossing the alert waits for.
Price the alert watches.
Alert price in quote units scaled by 1e9.
Price of price_source when the alert was created or last set again, in quote units scaled by 1e9.
True once the price has been seen on the far side of the alert price, so the next crossing fires the alert. False while an alert created past its alert price waits for the price to move back.
Current state of the alert.
Where the alert is delivered when it fires, in ascending enum order.
Revision of the alert, starting at 1. It increases with every change the caller makes; pass it as expected_revision to UpdateAlert.
When the alert was created.
When the caller last changed the alert.
When the alert fired. Omitted unless status is TRIGGERED.
Price that fired the alert, in quote units scaled by 1e9. Zero unless status is TRIGGERED.
| 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. |