Alerts
Add Alert
Request
POST /alerts
Parameters
Name | Type | Description |
---|
name | string | Required -- Name of Alert |
up | bool | Alert when status changes to Up |
degraded | bool | Alert when status changes to Degraded |
disrupted | bool | Alert when status changes to Disrrupted |
down | bool | Alert when status changes to Down |
maintenance | bool | Alert when status changes to Maintenance |
recipients | AlertRecipient[] | Array of AlertRecipient (See AlertRecipient parameters) |
AlertRecipient Parameters
Name | Type | Description |
---|
type | string | A string between email | sms | call | slack | discord | webhook |
target | string | Destination where the alert will be sent |
Request Payload Example
{
"name": "Alert Name",
"up": true,
"degraded": true,
"disrupted": true,
"down": true,
"maintenance": true,
"recipients":[
{
"type":"email",
"target":"[email protected]"
}
]
}
Request Curl Example
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer d3d6763224e8f54ee5aeb08202b7eb101d97081876819cb48833d9f892185917" \
-d \
'{
"name":"Alert Name",
"up":true,
"degraded":true,
"disrupted":true,
"down":true,
"maintenance":true,
"recipients":[
{
"type":"email",
"target":"[email protected]"
}
]
}' \
"https://api.statsignal.dev/v1/alerts"
Response Example
Status: 201 Created
{
"alert": {
"uuid": "134309rf82n454198142w20s27814s3h70",
"name": "Example Alert",
"up": true,
"degraded": true,
"disrupted": true,
"down": true,
"maintenance": true,
"recipients": [
{
"uuid": "290354ae8c364025824a96e5659d4c11",
"type": "email",
"target": "[email protected]",
"createdAt": "2023-03-05T16:59:21.146847938-05:00",
"updatedAt": "2023-03-05T16:59:21.146847938-05:00"
}
],
"createdAt": "2023-03-05T16:59:21.146847938-05:00"
}
}