Alert rules
Create an alert rule
POST
Creates an alert rule for a project or organization.
cookiecookie
better-auth.session_token<token>Dashboard session cookie
application/json- body
projectId*stringLength
1 <= length <= 64name*stringLength
1 <= length <= 120kind*stringValue in
"new_issue""regression""issue_spike""error_count""failure_rate""p95_latency"environments?array<>Items
items <= 50comparison?|nullthreshold?|Range
0 <= value <= 1000000000windowMinutes?|Range
1 <= value <= 1440cooldownMinutes?integerRange
0 <= value <= 1440notifyRecovery?booleanenabled?booleanintegrationIds?array<>Items
items <= 20subscriberIds?array<>Items
items <= 200application/json- response
id*stringname*stringprojectId*stringprojectName*stringkind*stringValue in
"new_issue""regression""issue_spike""error_count""failure_rate""p95_latency"environments*array<string>comparison*|nullthreshold*number|nullwindowMinutes*integer|nullcooldownMinutes*integernotifyRecovery*booleanenabled*booleanmutedUntil*|Format
date-timephase*stringValue in
"ok""firing"lastTriggeredAt*|Format
date-timesubscribed*booleansubscriberCount*integerintegrationIds*array<string>createdBy*|nullcreatedAt*stringFormat
date-timeupdatedAt*stringFormat
date-timecurl -X POST 'https://api.example.com/api/v1/alert-rules' \
-H 'Content-Type: application/json' \
-d '{
"projectId": "string",
"name": "string",
"kind": "new_issue"
}'Example Response
{
"id": "string",
"name": "string",
"projectId": "string",
"projectName": "string",
"kind": "new_issue",
"environments": [
"string"
],
"comparison": "above",
"threshold": 0,
"windowMinutes": 0,
"cooldownMinutes": 0,
"notifyRecovery": true,
"enabled": true,
"mutedUntil": "2019-08-24T14:15:22Z",
"phase": "ok",
"lastTriggeredAt": "2019-08-24T14:15:22Z",
"subscribed": true,
"subscriberCount": 0,
"integrationIds": [
"string"
],
"createdBy": {
"id": "string",
"name": "string"
},
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}