Create Topline Alert

Create Topline Alert

posthttps://statsigapi.net/console/v1/alerts

Authorizations

STATSIG-API-KEYstringrequired

apiKey (header)

Body

application/json
namestringrequired

Name of the alert (4-100 characters)

Constraints:min length: 4max length: 100
messagestring

Alert message shown when the alert fires

teamIDstring

ID of the team that owns this alert

formulastring

Formula expression combining the alert metrics

definitionMetricsJsonstring[]

JSON-encoded metric definitions evaluated by the alert. Each entry is a stringified ToplineAlertMExDefinitionOrUnresolved.

groupBysobject[]

Properties to group the alert metrics by

Show child attributes
columnstringrequired

Property column to group by

keystringrequired

Property key to group by

tagsobject[]

Tags to attach to the alert on creation

Show child attributes
idstringrequired

ID of the tag

namestringrequired

Name of the tag

Response

application/json
201· Create Alert success response
messagestringrequired

A simple string explaining the result of the operation.

dataobjectrequired
Show child attributes
idstringrequired

ID of the alert

namestringrequired

Name of the alert

alertTypestringrequired

Type of alert

Allowed values:thresholdchangepct_change
metricsobjectrequired

List of metrics associated with this alert

metricGroupBysobjectrequired

Metric groupbys

formulastring

Formula for the alert

messagestringrequired

Alert message

creatorIDstring
companyIDstringrequired
prioritystringrequired

Priority of this alert

Allowed values:P0P1P2P3P4P5
alertThresholdnumberrequired
Constraints:format: double
warningThresholdnumber
Constraints:format: double
windowMsnumberrequired

How far back and how frequently a metric should be checked, in milliseconds

Constraints:format: double
conditionstringrequired

Condition under which a metric change triggers an alert in milliseconds

Allowed values:greatergreater_or_equallessless_or_equalequalnot_equal
renotificationConditionsstring[]

Condition under which a re-notification is sent

renotificationWindowMsnumber

How long to wait before re-notifying in milliseconds

Constraints:format: double
renotificationMessagestring

Re-notification message

teamstring

Team associated with this alert

Constraints:nullable
ownerobject

Schema for owner data including ID, type, name. Note that if Entity is created by CONSOLE API, owner will be undefined.

Example:{"ownerID":"user123","ownerType":"USER","ownerName":"John Doe","ownerEmail":"owner123@test.com"}
Constraints:nullable
ownerIDstring

ID of the owner

Example:abc123
ownerTypestring

Type of the owner (e.g., SDK_KEY or USER)

Example:USER
ownerNamestring

The name of the owner. This field is optional.

Example:John Doe
ownerEmailstring

The email of the owner. This field is optional.

tagsstring[]required

Tags associated with this alert

statusstringrequired

Current evaluation status of the alert

Allowed values:alertsetup_incompletestablewarn
Constraints:nullable
lastTriggeredTimenumberrequired

Timestamp in milliseconds of the last time this alert triggered

Constraints:format: doublenullable
403· Forbidden resource
statusnumberrequired
Allowed values:403
messagestringrequired
Allowed values:Forbidden resource

Was this helpful?