curl --request PATCH \
--url https://app.traceroot.ai/api/v1/public/alerts/{alert_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"filters": [
{
"field": "<string>",
"value": "<string>",
"key": "<string>"
}
],
"measure": "<string>",
"name": "<string>",
"threshold": 123,
"view": "SPANS"
}
'import requests
url = "https://app.traceroot.ai/api/v1/public/alerts/{alert_id}"
payload = {
"project_id": "<string>",
"filters": [
{
"field": "<string>",
"value": "<string>",
"key": "<string>"
}
],
"measure": "<string>",
"name": "<string>",
"threshold": 123,
"view": "SPANS"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: '<string>',
filters: [{field: '<string>', value: '<string>', key: '<string>'}],
measure: '<string>',
name: '<string>',
threshold: 123,
view: 'SPANS'
})
};
fetch('https://app.traceroot.ai/api/v1/public/alerts/{alert_id}', 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/{alert_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => '<string>',
'filters' => [
[
'field' => '<string>',
'value' => '<string>',
'key' => '<string>'
]
],
'measure' => '<string>',
'name' => '<string>',
'threshold' => 123,
'view' => 'SPANS'
]),
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/{alert_id}"
payload := strings.NewReader("{\n \"project_id\": \"<string>\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ],\n \"measure\": \"<string>\",\n \"name\": \"<string>\",\n \"threshold\": 123,\n \"view\": \"SPANS\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.traceroot.ai/api/v1/public/alerts/{alert_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ],\n \"measure\": \"<string>\",\n \"name\": \"<string>\",\n \"threshold\": 123,\n \"view\": \"SPANS\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.traceroot.ai/api/v1/public/alerts/{alert_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"<string>\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ],\n \"measure\": \"<string>\",\n \"name\": \"<string>\",\n \"threshold\": 123,\n \"view\": \"SPANS\"\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>"
},
"changed": [
"<string>"
],
"updated": true,
"page_cleared": false,
"state_reset": false
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"detail": "<string>"
}Edit an alert rule
Edit an alert’s rule in a project the authenticated user can write to.
Requires MEMBER role or higher in the project’s workspace (the write service decides). The patch is validated merged with the stored rule; an edit to any evaluated field resets the evaluation state, clears an open page, and re-arms a parked alert — the response reports the first two.
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.
alert_id (str): The alert to edit.
payload (UpdateAlertRequest): The project and the rule fields to change.
_live (None): Write-path liveness gate (blocks a revoked JWT session).
Returns: UpdateAlertResponse: The updated alert, the changed fields, and the state flags.
Raises: HTTPException: The write service’s 400/403/404 verbatim, or a 503 when its response is ambiguous.
curl --request PATCH \
--url https://app.traceroot.ai/api/v1/public/alerts/{alert_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"filters": [
{
"field": "<string>",
"value": "<string>",
"key": "<string>"
}
],
"measure": "<string>",
"name": "<string>",
"threshold": 123,
"view": "SPANS"
}
'import requests
url = "https://app.traceroot.ai/api/v1/public/alerts/{alert_id}"
payload = {
"project_id": "<string>",
"filters": [
{
"field": "<string>",
"value": "<string>",
"key": "<string>"
}
],
"measure": "<string>",
"name": "<string>",
"threshold": 123,
"view": "SPANS"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: '<string>',
filters: [{field: '<string>', value: '<string>', key: '<string>'}],
measure: '<string>',
name: '<string>',
threshold: 123,
view: 'SPANS'
})
};
fetch('https://app.traceroot.ai/api/v1/public/alerts/{alert_id}', 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/{alert_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => '<string>',
'filters' => [
[
'field' => '<string>',
'value' => '<string>',
'key' => '<string>'
]
],
'measure' => '<string>',
'name' => '<string>',
'threshold' => 123,
'view' => 'SPANS'
]),
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/{alert_id}"
payload := strings.NewReader("{\n \"project_id\": \"<string>\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ],\n \"measure\": \"<string>\",\n \"name\": \"<string>\",\n \"threshold\": 123,\n \"view\": \"SPANS\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.traceroot.ai/api/v1/public/alerts/{alert_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ],\n \"measure\": \"<string>\",\n \"name\": \"<string>\",\n \"threshold\": 123,\n \"view\": \"SPANS\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.traceroot.ai/api/v1/public/alerts/{alert_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"<string>\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ],\n \"measure\": \"<string>\",\n \"name\": \"<string>\",\n \"threshold\": 123,\n \"view\": \"SPANS\"\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>"
},
"changed": [
"<string>"
],
"updated": true,
"page_cleared": false,
"state_reset": false
}{
"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.
Path Parameters
Body
Body for editing an alert rule (the ten rule fields, all optional).
The write service validates the patch merged with the stored rule; an edit to any evaluated field resets the evaluation state (and clears an open page), which the response reports. Status has its own route.
sum, avg, count, max, min, p50, p75, p90, p95, p99, uniq Row predicates the measure is evaluated over
Show child attributes
Show child attributes
A measure of the view, e.g. latency, cost, count
What a window that measured nothing means
HOLD, ZERO, NOTIFY 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 Response
Successful Response
The updated alert with its full rule, plus what the edit did to its state.
One alert with its full rule: the summary plus filters and gap handling.
Show child attributes
Show child attributes
True when the alert was firing and the edit discarded that page
True when the edit voided the evaluation state and made the rule due now (any evaluated field changed, or the alert was resumed)

