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

ParameterTypeExample
symbol *string2222
event_type *stringlarge_move
condition stringpct_change_abs_gte
value *number3.0
webhook_id number19
destination object{ "type": "webhook", "webhook_id": 19 }
config object{ "window": "15m" }
once booleantrue (default)

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. The examples set it to false explicitly to create recurring rules, which is why their responses show 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

ParameterTypeExample
status stringactive
  • Query: status=active|paused|all
  • 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