auto_write

Create a metric-threshold automation that fires an alert when a KPI crosses a boundary. Supported metrics: roas, convers

Create a metric-threshold automation that fires an alert when a KPI crosses a boundary. Supported metrics: roas, conversion_rate, sessions, margin. The worker checks enabled automations hourly. Alert delivery is switched on per store; until it is, a check records whether it would have fired and sends nothing. Repeat the summary as given.

post/api/v1/tools/create_alert

Request

  • Base URL: https://app.magistry.io
  • URL: https://app.magistry.io/api/v1/tools/create_alert
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://app.magistry.io/api/oauth/authorize, token URL https://app.magistry.io/api/oauth/token, scopes: automation:write)

Request body

namestring required

Short human-readable name for the alert rule.

trigger_metric'roas' | 'conversion_rate' | 'sessions' | 'margin' required

KPI to monitor.

operator'<' | '>' | '<=' | '>=' required

Comparison operator applied to the threshold.

thresholdnumber required

Numeric threshold value (e.g. 2.0 for ROAS, 0.03 for CR).

scope'product' | 'store' required

"store" evaluates the aggregate metric; "product" fires per-product.

min_sessionsinteger

Optional minimum session count required before the alert can fire.

notify_via'email' | 'in_app'

Notification channel (default: in_app).

Response

Tool result

okboolean required
resultunknown required

Changes

No recorded changes to this operation across all 2 revisions of this API.