Viewing: Event Rules

Alerts & Webhooks - Event Rules

Define market conditions and actions that trigger webhook deliveries. You can create rules in Dashboard or programmatically with this API.

Dashboard and event-type reference

You can create and manage alerts from the Developer Dashboard. For the complete event-type and condition reference, see Event Types & Conditions.

POST /api/v1/alerts/

Pro+

Create an alert rule that triggers webhook deliveries when conditions match.

Endpoint

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

Parameters

(*) Required

ParameterTypeAllowed
symbol *string

stock ticker

event_type *string
price_alertlarge_moveabnormal_volumeunusual_value_traded
conditionstring
price_aboveprice_belowpct_changepct_change_abs_gteratio_gte

depends on event type

value *number

comparison value

webhook_idnumber

webhook id

destinationobject

JSON object for the delivery destination

configobject

JSON object with extra rule settings

onceboolean
truefalse

default true

Rule design guidance

  • Start with narrow symbol scope and explicit thresholds.
  • Use cooldown windows to reduce notification noise.
  • Validate in staging before enabling production rules.
  • condition is required for price_alert; other documented event types normalize it automatically.
  • Ratio thresholds must be greater than 1.0. Large-move thresholds are capped at 10% for TASI and 30% for NOMU.
  • once defaults to true, so the rule triggers once. Setting it to false allows another trigger when the conditions are met again, subject to any cooldown. It does not fire on every market update. The examples use false, which is why the response shows fire_once: false.
200 OKapplication/json
{
  "id": 57,
  "workspace_id": null,
  "symbol": "2222",
  "event_type": "large_move",
  "target_scope_type": "single_symbol",
  "target_scope_id": null,
  "symbols": ["2222"],
  "evaluated_symbol_rules": 1,
  "condition": "pct_change_abs_gte",
  "value": "3.0",
  "config": {
    "window": "5m",
    "destination": { "type": "webhook", "webhook_id": 19 }
  },
  "fire_once": false,
  "webhook_id": 19,
  "webhook_url": "https://example.com/hooks/sahmk",
  "destination": { "type": "webhook", "webhook_id": 19 },
  "status": "active",
  "last_triggered_at": null,
  "total_triggers": 0,
  "created_at": "2026-05-08T13:36:45+03:00"
}

GET /api/v1/alerts/

Pro+

List existing rules and optionally filter by status.

Endpoint

https://api.sahmk.sa/api/v1/alerts/?status=active

Parameters

(*) Required

ParameterTypeAllowed
statusstring
activepausedall
  • Query: status=active|paused|all. all is a filter option, not a returned status.
  • Status enum: active, paused, triggered
  • Mapping: once maps to fire_once.
200 OKapplication/json
{
  "alerts": [
    {
      "id": 57,
      "workspace_id": null,
      "symbol": "2222",
      "event_type": "large_move",
      "target_scope_type": "single_symbol",
      "target_scope_id": null,
      "symbols": ["2222"],
      "evaluated_symbol_rules": 1,
      "condition": "pct_change_abs_gte",
      "value": "3.0",
      "config": {
        "window": "5m",
        "destination": { "type": "webhook", "webhook_id": 19 }
      },
      "status": "active",
      "fire_once": false,
      "webhook_id": 19,
      "webhook_url": "https://example.com/hooks/sahmk",
      "destination": { "type": "webhook", "webhook_id": 19 },
      "last_triggered_at": null,
      "total_triggers": 0,
      "created_at": "2026-05-08T13:36:45+03:00"
    }
  ]
}

Last updated on