Write

Create or update an alert rule

Upserts on (type, scope_app_id). Omit threshold for the per-type default; omit scope_app_id for an org-wide rule. Requires the Indie plan and a write-scope API key.

post/api/v1/alerts

Request

  • Base URL: https://api.trysonar.app
  • URL: https://api.trysonar.app/api/v1/alerts
  • Auth: HTTP bearer

Request body

type'rank_drop' | 'rank_gain' | 'entered_top10' | 'left_top10' | 'new_ranking' | 'rating_drop' | 'review_spike' | 'competitor_change' | 'top_chart' | 'new_review' required
scope_app_idstring nullable

App UUID to scope to; null/omitted = all tracked apps

thresholdinteger nullable

null/omitted = per-type default. For top_chart: the rank cutoff (1-200, default 200). For new_review: the highest star rating that alerts (1-5, default 5 = every review)

countriesstring[] nullable

top_chart only: storefronts to watch (ISO 3166-1 alpha-2). Omit to keep the stored list; null/[] = the countries the org tracks keywords in

cadence'instant' | 'hourly' | 'daily' | 'null' nullable

new_review only: email timing — instant (within ~5-10 minutes), hourly (at most one email per hour) or daily (the 08:30 UTC digest). Omit to keep the stored value (daily on create); sent with any other type → 400

enabledboolean

Response

The created/updated alert rule

dataobject required

Result payload — full field reference at https://trysonar.app/docs/api

Changes

No recorded changes to this operation across all 1 revision of this API.