Skip to Content
OpenPerf

Alert rules

Create an alert rule

POST
/api/v1/alert-rules

Creates an alert rule for a project or organization.

Authorization

cookie
cookiebetter-auth.session_token<token>

Dashboard session cookie

Request Body

application/json
  1. body
projectId*string
Length1 <= length <= 64
name*string
Length1 <= length <= 120
kind*string
Value in"new_issue""regression""issue_spike""error_count""failure_rate""p95_latency"
environments?array<>
Itemsitems <= 50
comparison?|null
threshold?|
Range0 <= value <= 1000000000
windowMinutes?|
Range1 <= value <= 1440
cooldownMinutes?integer
Range0 <= value <= 1440
notifyRecovery?boolean
enabled?boolean
integrationIds?array<>
Itemsitems <= 20
subscriberIds?array<>
Itemsitems <= 200

Response Body

application/json
  1. response
id*string
name*string
projectId*string
projectName*string
kind*string
Value in"new_issue""regression""issue_spike""error_count""failure_rate""p95_latency"
environments*array<string>
comparison*|null
threshold*number|null
windowMinutes*integer|null
cooldownMinutes*integer
notifyRecovery*boolean
enabled*boolean
mutedUntil*|
Formatdate-time
phase*string
Value in"ok""firing"
lastTriggeredAt*|
Formatdate-time
subscribed*boolean
subscriberCount*integer
integrationIds*array<string>
createdBy*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
curl -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"
}