Create an alert
Creates an alert or a scheduled report (weekly_summary, monthly_summary). Email recipients must be members of the website; without channels.email.recipientUserIds the email goes to the token owner. Needs the editor role.
Related: Recent alert firings and List alerts in Alerts.
Request
Path parameters
websitestringrequiredWebsite id or domain, e.g. example.com
1–253 characters
Headers
AuthorizationstringrequiredBearer followed by an account token or an OAuth access token with the alerts:write scope.
Content-TypestringrequiredSend the body as JSON.
One of: application/json
Body fields
typestringrequiredOne of: traffic_spike, traffic_drop, new_payment, revenue_threshold, goal_threshold, new_referrer, weekly_summary, monthly_summary
namestringoptional1–80 characters
messagestring | nulloptionalUp to 2000 characters
enabledbooleanoptionalconditionobjectoptionalcondition.thresholdnumber | nulloptional0 to 1000000000000
condition.percentChangenumber | nulloptional1 to 10000
condition.windowMinutesinteger | nulloptional5 to 10080
condition.goalstring | nulloptionalUp to 100 characters
channelsobjectoptionalchannels.emailobjectoptionalchannels.email.enabledbooleanoptionalchannels.email.recipientUserIdsstring[]optionalUp to 50 items
channels.slackobjectoptionalchannels.slack.enabledbooleanoptionalchannels.slack.webhookUrlstring (uri) | nulloptionalUp to 500 characters
channels.discordobjectoptionalchannels.discord.enabledbooleanoptionalchannels.discord.webhookUrlstring (uri) | nulloptionalUp to 500 characters
Response
The alert.
{
"status": "string",
"data": {
"id": "string",
"siteId": "string",
"type": "traffic_spike",
"name": "string",
"enabled": true,
"condition": {
"threshold": "string",
"percentChange": "string",
"windowMinutes": "string",
"goal": "string"
},
"channels": {
"email": {
"enabled": true,
"recipientUserIds": []
},
"slack": {
"enabled": true,
"configured": true
},
"discord": {
"enabled": true,
"configured": true
}
},
"message": "string",
"lastTriggeredAt": "2026-01-01T00:00:00.000Z",
"createdBy": "string",
"createdAt": "2026-01-01T00:00:00.000Z"
}
}Response fields
| Field | Type | Description |
|---|---|---|
| status | "ok" | |
| data | object | |
| data.id | string | |
| data.siteId | string | |
| data.type | string | |
| data.name | string | |
| data.enabled | boolean | |
| data.condition | object | |
| data.condition.threshold | number | null | null | |
| data.condition.percentChange | number | null | null | |
| data.condition.windowMinutes | integer | null | null | |
| data.condition.goal | string | null | null | |
| data.channels | object | |
| data.channels.email | object | |
| data.channels.email.enabled | boolean | |
| data.channels.email.recipientUserIds | string[] | |
| data.channels.slack | object | |
| data.channels.slack.enabled | boolean | |
| data.channels.slack.configured | boolean | |
| data.channels.discord | object | |
| data.channels.discord.enabled | boolean | |
| data.channels.discord.configured | boolean | |
| data.message | string | null | null | |
| data.lastTriggeredAt | string (date-time) | null | null | |
| data.createdBy | string | |
| data.createdAt | string (date-time) |