Skip to main content
POST
Create an alert

Authorizations

Authorization
string
header
required

An API key that starts with cs_sk_, created under API and MCP, API keys. A key covers every site of its workspace or a chosen list, and carries permissions per resource (Analytics, Revenue and payments, Goals and events, Funnels, Sites, Notes, Alerts) and extras (Visitor details, Raw events export, Team members, Workspace name, See API keys, Manage API keys). A change acts for the key's creator, with their current role. A request outside them answers 403 naming the missing permission.

Path Parameters

siteId
string
required

The site's id, from GET /sites.

Body

application/json
name
string
required
Required string length: 1 - 80
ruleType
enum<string>
required
Available options:
traffic_spike,
traffic_drop,
no_traffic,
error_spike,
new_error,
vitals_regression,
monitor_down,
goal_completed,
revenue_received,
revenue_milestone,
usage_limit
threshold
number | null

Ratio for spikes and drops, a count for errors, minor units for revenue, milliseconds for vitals.

windowMinutes
integer
default:60
Required range: 5 <= x <= 10080
cooldownMinutes
integer
default:60
Required range: 0 <= x <= 10080
config
object

Settings of the rule type.

channelIds
string[]

Notification channels, from GET /sites/{siteId}/alerts (channels). With none, the alert is only logged in its history.

Maximum array length: 20
Minimum string length: 1
enabled
boolean
default:true

Response

Done.

alert
object

The rule.