Skip to content

Create an alert rule

POST
/alerts/rules
curl --request POST \
--url https://your-server.example/api/alerts/rules \
--header 'Content-Type: application/json' \
--cookie session=<session> \
--data '{ "id": 1, "name": "example", "scope": "example", "target": "example", "metric": "example", "operator": ">", "threshold": 1, "duration_seconds": 1, "webhook_ids": [ 1 ], "enabled": true }'
Media typeapplication/json
object
id
integer format: int64
name
string
scope

System, app, or webhook

string
target

App slug or “*”.

string
metric
string
operator
string
Allowed values: > < >= <= == !=
threshold
number
duration_seconds
integer
webhook_ids
Array<integer>
enabled
boolean

Created.

Media typeapplication/json
object
id
integer format: int64
name
string
scope

System, app, or webhook

string
target

App slug or “*”.

string
metric
string
operator
string
Allowed values: > < >= <= == !=
threshold
number
duration_seconds
integer
webhook_ids
Array<integer>
enabled
boolean

Example

{
"operator": ">"
}