curl --request POST \
--url https://app.traceroot.ai/api/v1/public/alerts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"measure": "<string>",
"name": "<string>",
"project_id": "<string>",
"renotify": {
"interval_minutes": 123
},
"threshold": 123,
"view": "SPANS",
"filters": [
{
"field": "<string>",
"value": "<string>",
"key": "<string>"
}
]
}
'import requests
url = "https://app.traceroot.ai/api/v1/public/alerts"
payload = {
"measure": "<string>",
"name": "<string>",
"project_id": "<string>",
"renotify": { "interval_minutes": 123 },
"threshold": 123,
"view": "SPANS",
"filters": [
{
"field": "<string>",
"value": "<string>",
"key": "<string>"
}
]
}
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({
measure: '<string>',
name: '<string>',
project_id: '<string>',
renotify: {interval_minutes: 123},
threshold: 123,
view: 'SPANS',
filters: [{field: '<string>', value: '<string>', key: '<string>'}]
})
};
fetch('https://app.traceroot.ai/api/v1/public/alerts', 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://app.traceroot.ai/api/v1/public/alerts",
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([
'measure' => '<string>',
'name' => '<string>',
'project_id' => '<string>',
'renotify' => [
'interval_minutes' => 123
],
'threshold' => 123,
'view' => 'SPANS',
'filters' => [
[
'field' => '<string>',
'value' => '<string>',
'key' => '<string>'
]
]
]),
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://app.traceroot.ai/api/v1/public/alerts"
payload := strings.NewReader("{\n \"measure\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"renotify\": {\n \"interval_minutes\": 123\n },\n \"threshold\": 123,\n \"view\": \"SPANS\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\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://app.traceroot.ai/api/v1/public/alerts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"measure\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"renotify\": {\n \"interval_minutes\": 123\n },\n \"threshold\": 123,\n \"view\": \"SPANS\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.traceroot.ai/api/v1/public/alerts")
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 \"measure\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"renotify\": {\n \"interval_minutes\": 123\n },\n \"threshold\": 123,\n \"view\": \"SPANS\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"alert": {
"aggregation": "<string>",
"alerted_at": "2023-11-07T05:31:56Z",
"create_time": "2023-11-07T05:31:56Z",
"creator": "<string>",
"filters": [
{
"field": "<string>",
"op": "=",
"value": "<string>",
"key": "<string>"
}
],
"id": "<string>",
"last_error": "<string>",
"last_error_at": "2023-11-07T05:31:56Z",
"last_evaluated_at": "2023-11-07T05:31:56Z",
"last_notify_at": "2023-11-07T05:31:56Z",
"last_notify_error": "<string>",
"last_notify_status": "<string>",
"measure": "<string>",
"name": "<string>",
"no_data_mode": "<string>",
"renotify": {
"mode": "OFF",
"interval_minutes": 123
},
"severity": "<string>",
"severity_changed_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"threshold": 123,
"threshold_operator": "<string>",
"update_time": "2023-11-07T05:31:56Z",
"view": "<string>",
"window": "<string>"
},
"created": true
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"detail": "<string>"
}Create an alert
Create a threshold alert in a project the authenticated user can write to.
Requires MEMBER role or higher in the project’s workspace (the write
service decides). Strict create — alerts have no unique name, so every
call inserts and created is always true on success.
Args:
request (Request): Incoming request (rate-limit plumbing).
response (Response): Outgoing response (rate-limit plumbing).
auth (AccountStampedAuth): Account-scope user auth (session token or
CLI access JWT); its resolved user_id becomes the actor.
payload (CreateAlertRequest): The alert rule to create.
_live (None): Write-path liveness gate (blocks a revoked JWT session).
Returns: CreateAlertResponse: The created alert with its full rule.
curl --request POST \
--url https://app.traceroot.ai/api/v1/public/alerts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"measure": "<string>",
"name": "<string>",
"project_id": "<string>",
"renotify": {
"interval_minutes": 123
},
"threshold": 123,
"view": "SPANS",
"filters": [
{
"field": "<string>",
"value": "<string>",
"key": "<string>"
}
]
}
'import requests
url = "https://app.traceroot.ai/api/v1/public/alerts"
payload = {
"measure": "<string>",
"name": "<string>",
"project_id": "<string>",
"renotify": { "interval_minutes": 123 },
"threshold": 123,
"view": "SPANS",
"filters": [
{
"field": "<string>",
"value": "<string>",
"key": "<string>"
}
]
}
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({
measure: '<string>',
name: '<string>',
project_id: '<string>',
renotify: {interval_minutes: 123},
threshold: 123,
view: 'SPANS',
filters: [{field: '<string>', value: '<string>', key: '<string>'}]
})
};
fetch('https://app.traceroot.ai/api/v1/public/alerts', 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://app.traceroot.ai/api/v1/public/alerts",
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([
'measure' => '<string>',
'name' => '<string>',
'project_id' => '<string>',
'renotify' => [
'interval_minutes' => 123
],
'threshold' => 123,
'view' => 'SPANS',
'filters' => [
[
'field' => '<string>',
'value' => '<string>',
'key' => '<string>'
]
]
]),
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://app.traceroot.ai/api/v1/public/alerts"
payload := strings.NewReader("{\n \"measure\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"renotify\": {\n \"interval_minutes\": 123\n },\n \"threshold\": 123,\n \"view\": \"SPANS\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\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://app.traceroot.ai/api/v1/public/alerts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"measure\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"renotify\": {\n \"interval_minutes\": 123\n },\n \"threshold\": 123,\n \"view\": \"SPANS\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.traceroot.ai/api/v1/public/alerts")
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 \"measure\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"renotify\": {\n \"interval_minutes\": 123\n },\n \"threshold\": 123,\n \"view\": \"SPANS\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"alert": {
"aggregation": "<string>",
"alerted_at": "2023-11-07T05:31:56Z",
"create_time": "2023-11-07T05:31:56Z",
"creator": "<string>",
"filters": [
{
"field": "<string>",
"op": "=",
"value": "<string>",
"key": "<string>"
}
],
"id": "<string>",
"last_error": "<string>",
"last_error_at": "2023-11-07T05:31:56Z",
"last_evaluated_at": "2023-11-07T05:31:56Z",
"last_notify_at": "2023-11-07T05:31:56Z",
"last_notify_error": "<string>",
"last_notify_status": "<string>",
"measure": "<string>",
"name": "<string>",
"no_data_mode": "<string>",
"renotify": {
"mode": "OFF",
"interval_minutes": 123
},
"severity": "<string>",
"severity_changed_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"threshold": 123,
"threshold_operator": "<string>",
"update_time": "2023-11-07T05:31:56Z",
"view": "<string>",
"window": "<string>"
},
"created": true
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"detail": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Body for creating a threshold alert in a project.
sum, avg, count, max, min, p50, p75, p90, p95, p99, uniq A measure of the view, e.g. latency, cost, count
How often an alert re-notifies while it stays in the alerting state.
Show child attributes
Show child attributes
>, >=, <, <=, =, != "SPANS"1m, 5m, 10m, 30m, 1h, 2h Row predicates the measure is evaluated over
Show child attributes
Show child attributes
What a window that measured nothing means; column default when omitted
HOLD, ZERO, NOTIFY 
