← Back to API docs
Viewing: Event Rules
Event Rules
Rules evaluate market conditions and trigger webhook events.
Supported Event Types
price_alertlarge_moveabnormal_volumeunusual_value_tradedPOST /api/v1/alerts/
Endpoint
https://app.sahmk.sa/api/v1/alerts/
Parameters
(*) Required
| Parameter | Type | Example |
|---|---|---|
| symbol * | string | 2222 |
| event_type * | string | large_move |
| condition * | string | pct_change_abs_gte |
| value * | number | 3.0 |
| webhook_id * | number | 19 |
| once | boolean | false |
- Required:
symbol,event_type,condition,value,webhook_id - Optional:
once,config
200 OKapplication/json
{
"id": 57,
"symbol": "2222",
"event_type": "large_move",
"condition": "pct_change_abs_gte",
"value": 3.0,
"webhook_id": 19,
"status": "active"
}GET /api/v1/alerts/
List existing rules and filter by status.
Endpoint
https://app.sahmk.sa/api/v1/alerts/?status=active
Parameters
(*) Required
| Parameter | Type | Example |
|---|---|---|
| status | string | active |
- Query:
status=active|paused|all - Status enum:
active,paused, andtriggered. - Mapping:
oncemaps to stored/returnedfire_once.
200 OKapplication/json
{
"results": [
{
"id": 57,
"symbol": "2222",
"event_type": "large_move",
"status": "active",
"fire_once": false
}
],
"count": 1
}