Evaluate a rule against demo or historical events
POST
/api/v1/alert-rules:test
const url = 'https://example.com/api/v1/alert-rules:test';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"demoEvents":[{"id":"example","objectId":"example","payload":"example","severity":"example","sourceId":"example","tenantId":"example","ts":"2026-04-15T12:00:00Z","type":"example"}],"from":"2026-04-15T12:00:00Z","rule":{"autoCloseAfter":1,"createdAt":"2026-04-15T12:00:00Z","dedupKey":"example","disabled":true,"escalationPolicy":"example","groupId":"example","heartbeat":{"expectEvery":1,"source":"example"},"id":"example","incident":true,"match":"example","name":"example","pendingFor":1,"resolveOnOk":true,"setLabels":{"additionalProperty":"example"},"severity":"example","tenantId":"example","title":"example","updatedAt":"2026-04-15T12:00:00Z","version":1},"to":"2026-04-15T12:00:00Z"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/alert-rules:test \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "demoEvents": [ { "id": "example", "objectId": "example", "payload": "example", "severity": "example", "sourceId": "example", "tenantId": "example", "ts": "2026-04-15T12:00:00Z", "type": "example" } ], "from": "2026-04-15T12:00:00Z", "rule": { "autoCloseAfter": 1, "createdAt": "2026-04-15T12:00:00Z", "dedupKey": "example", "disabled": true, "escalationPolicy": "example", "groupId": "example", "heartbeat": { "expectEvery": 1, "source": "example" }, "id": "example", "incident": true, "match": "example", "name": "example", "pendingFor": 1, "resolveOnOk": true, "setLabels": { "additionalProperty": "example" }, "severity": "example", "tenantId": "example", "title": "example", "updatedAt": "2026-04-15T12:00:00Z", "version": 1 }, "to": "2026-04-15T12:00:00Z" }'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
demoEvents
Array<object>
object
id
required
string
objectId
string
payload
required
string format: byte
severity
string
sourceId
string
tenantId
required
string
ts
required
string format: date-time
type
required
string
from
string format: date-time
rule
required
object
autoCloseAfter
integer
createdAt
required
string format: date-time
dedupKey
string
disabled
boolean
escalationPolicy
string
groupId
string
heartbeat
object
expectEvery
required
integer
source
required
string
id
required
string
incident
boolean
match
string
name
required
string
pendingFor
integer
resolveOnOk
boolean
setLabels
object
key
additional properties
string
severity
required
string
tenantId
required
string
title
string
updatedAt
required
string format: date-time
version
required
integer
to
string format: date-time
Examplegenerated
{ "demoEvents": [ { "id": "example", "objectId": "example", "payload": "example", "severity": "example", "sourceId": "example", "tenantId": "example", "ts": "2026-04-15T12:00:00Z", "type": "example" } ], "from": "2026-04-15T12:00:00Z", "rule": { "autoCloseAfter": 1, "createdAt": "2026-04-15T12:00:00Z", "dedupKey": "example", "disabled": true, "escalationPolicy": "example", "groupId": "example", "heartbeat": { "expectEvery": 1, "source": "example" }, "id": "example", "incident": true, "match": "example", "name": "example", "pendingFor": 1, "resolveOnOk": true, "setLabels": { "additionalProperty": "example" }, "severity": "example", "tenantId": "example", "title": "example", "updatedAt": "2026-04-15T12:00:00Z", "version": 1 }, "to": "2026-04-15T12:00:00Z"}Responses
Section titled “Responses”OK
default
Section titled “default”Problem Details (RFC 9457)
Media typeapplication/problem+json
object
code
required
string
detail
string
instance
string
status
required
integer
title
required
string
type
required
string
Examplegenerated
{ "code": "example", "detail": "example", "instance": "example", "status": 1, "title": "example", "type": "example"}