Create alert rule
curl --request POST \
--url https://cp.xenovia.io/api/v1/alert-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"kind": "event",
"threshold": 123,
"severity": "warning",
"cooldown_seconds": 300,
"aggregation": "<string>",
"min_samples": 0,
"filters": {},
"channels": [],
"proxy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": true
}
'import requests
url = "https://cp.xenovia.io/api/v1/alert-rules"
payload = {
"name": "<string>",
"kind": "event",
"threshold": 123,
"severity": "warning",
"cooldown_seconds": 300,
"aggregation": "<string>",
"min_samples": 0,
"filters": {},
"channels": [],
"proxy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
kind: 'event',
threshold: 123,
severity: 'warning',
cooldown_seconds: 300,
aggregation: '<string>',
min_samples: 0,
filters: {},
channels: [],
proxy_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
enabled: true
})
};
fetch('https://cp.xenovia.io/api/v1/alert-rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cp.xenovia.io/api/v1/alert-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'kind' => 'event',
'threshold' => 123,
'severity' => 'warning',
'cooldown_seconds' => 300,
'aggregation' => '<string>',
'min_samples' => 0,
'filters' => [
],
'channels' => [
],
'proxy_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cp.xenovia.io/api/v1/alert-rules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"kind\": \"event\",\n \"threshold\": 123,\n \"severity\": \"warning\",\n \"cooldown_seconds\": 300,\n \"aggregation\": \"<string>\",\n \"min_samples\": 0,\n \"filters\": {},\n \"channels\": [],\n \"proxy_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cp.xenovia.io/api/v1/alert-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"kind\": \"event\",\n \"threshold\": 123,\n \"severity\": \"warning\",\n \"cooldown_seconds\": 300,\n \"aggregation\": \"<string>\",\n \"min_samples\": 0,\n \"filters\": {},\n \"channels\": [],\n \"proxy_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cp.xenovia.io/api/v1/alert-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"kind\": \"event\",\n \"threshold\": 123,\n \"severity\": \"warning\",\n \"cooldown_seconds\": 300,\n \"aggregation\": \"<string>\",\n \"min_samples\": 0,\n \"filters\": {},\n \"channels\": [],\n \"proxy_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"proxy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "<string>",
"trigger_type": "<string>",
"threshold": 123,
"severity": "<string>",
"cooldown_seconds": 123,
"metric": "<string>",
"aggregation": "<string>",
"operator": "<string>",
"window_seconds": 123,
"group_by": "<string>",
"min_samples": 123,
"filters": {},
"channels": [
"<string>"
],
"enabled": true,
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Alerts
Create alert rule
Auth: signed-in organization admin only. Organization API keys are rejected with 403.
Event rules fire per matching telemetry event; metric rules evaluate a windowed aggregate. At most 25 enabled rules per organization (400).
POST
/
api
/
v1
/
alert-rules
Create alert rule
curl --request POST \
--url https://cp.xenovia.io/api/v1/alert-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"kind": "event",
"threshold": 123,
"severity": "warning",
"cooldown_seconds": 300,
"aggregation": "<string>",
"min_samples": 0,
"filters": {},
"channels": [],
"proxy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": true
}
'import requests
url = "https://cp.xenovia.io/api/v1/alert-rules"
payload = {
"name": "<string>",
"kind": "event",
"threshold": 123,
"severity": "warning",
"cooldown_seconds": 300,
"aggregation": "<string>",
"min_samples": 0,
"filters": {},
"channels": [],
"proxy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
kind: 'event',
threshold: 123,
severity: 'warning',
cooldown_seconds: 300,
aggregation: '<string>',
min_samples: 0,
filters: {},
channels: [],
proxy_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
enabled: true
})
};
fetch('https://cp.xenovia.io/api/v1/alert-rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cp.xenovia.io/api/v1/alert-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'kind' => 'event',
'threshold' => 123,
'severity' => 'warning',
'cooldown_seconds' => 300,
'aggregation' => '<string>',
'min_samples' => 0,
'filters' => [
],
'channels' => [
],
'proxy_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cp.xenovia.io/api/v1/alert-rules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"kind\": \"event\",\n \"threshold\": 123,\n \"severity\": \"warning\",\n \"cooldown_seconds\": 300,\n \"aggregation\": \"<string>\",\n \"min_samples\": 0,\n \"filters\": {},\n \"channels\": [],\n \"proxy_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cp.xenovia.io/api/v1/alert-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"kind\": \"event\",\n \"threshold\": 123,\n \"severity\": \"warning\",\n \"cooldown_seconds\": 300,\n \"aggregation\": \"<string>\",\n \"min_samples\": 0,\n \"filters\": {},\n \"channels\": [],\n \"proxy_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cp.xenovia.io/api/v1/alert-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"kind\": \"event\",\n \"threshold\": 123,\n \"severity\": \"warning\",\n \"cooldown_seconds\": 300,\n \"aggregation\": \"<string>\",\n \"min_samples\": 0,\n \"filters\": {},\n \"channels\": [],\n \"proxy_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"proxy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "<string>",
"trigger_type": "<string>",
"threshold": 123,
"severity": "<string>",
"cooldown_seconds": 123,
"metric": "<string>",
"aggregation": "<string>",
"operator": "<string>",
"window_seconds": 123,
"group_by": "<string>",
"min_samples": 123,
"filters": {},
"channels": [
"<string>"
],
"enabled": true,
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer token: an organization API key (ak_…) created under Settings → API Keys, or a dashboard user session token. Proxy keys (xe_…) are not accepted here. Endpoints marked as user-only in their description reject organization keys with 403.
Body
application/json
Required string length:
1 - 255Available options:
event, metric Available options:
policy_block, policy_redact, policy_escalate, guardrail_escalate, guardrail_block, high_latency, high_intent_score, run_error, turn_blocked, turn_escalated, turn_error Available options:
info, warning, critical Required range:
60 <= x <= 86400Available options:
turn_error_rate, turn_blocked_rate, escalation_count, turn_count, no_traffic, token_usage, llm_latency_p95_ms, ttft_p95_ms, llm_cost_usd, guardrail_score_avg, guardrail_block_count, policy_block_rate Available options:
gt, gte, lt, lte Available options:
300, 900, 3600, 86400 Available options:
proxy_id, policy_rule, guardrail_name Required range:
0 <= x <= 100000Show child attributes
Show child attributes
Available options:
in_app, email, slack Response
Successful Response
Show child attributes
Show child attributes