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_traded

POST /api/v1/alerts/

Endpoint

https://app.sahmk.sa/api/v1/alerts/

Parameters

(*) Required

ParameterTypeExample
symbol *string2222
event_type *stringlarge_move
condition *stringpct_change_abs_gte
value *number3.0
webhook_id *number19
once booleanfalse
  • 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

ParameterTypeExample
status stringactive
  • Query: status=active|paused|all
  • Status enum: active, paused, and triggered.
  • Mapping: once maps to stored/returned fire_once.
200 OKapplication/json
{
  "results": [
    {
      "id": 57,
      "symbol": "2222",
      "event_type": "large_move",
      "status": "active",
      "fire_once": false
    }
  ],
  "count": 1
}