curl --request PATCH \
--url https://app.traceroot.ai/api/v1/public/detectors/{detector_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"detection_model": "<string>",
"detection_provider": "<string>",
"enable_rca": true,
"enabled": true,
"name": "<string>",
"output_schema": [
"<unknown>"
],
"prompt": "<string>",
"sample_rate": 123,
"trigger_conditions": [
"<unknown>"
]
}
'import requests
url = "https://app.traceroot.ai/api/v1/public/detectors/{detector_id}"
payload = {
"project_id": "<string>",
"detection_model": "<string>",
"detection_provider": "<string>",
"enable_rca": True,
"enabled": True,
"name": "<string>",
"output_schema": ["<unknown>"],
"prompt": "<string>",
"sample_rate": 123,
"trigger_conditions": ["<unknown>"]
}
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>',
detection_model: '<string>',
detection_provider: '<string>',
enable_rca: true,
enabled: true,
name: '<string>',
output_schema: ['<unknown>'],
prompt: '<string>',
sample_rate: 123,
trigger_conditions: ['<unknown>']
})
};
fetch('https://app.traceroot.ai/api/v1/public/detectors/{detector_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/detectors/{detector_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>',
'detection_model' => '<string>',
'detection_provider' => '<string>',
'enable_rca' => true,
'enabled' => true,
'name' => '<string>',
'output_schema' => [
'<unknown>'
],
'prompt' => '<string>',
'sample_rate' => 123,
'trigger_conditions' => [
'<unknown>'
]
]),
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/detectors/{detector_id}"
payload := strings.NewReader("{\n \"project_id\": \"<string>\",\n \"detection_model\": \"<string>\",\n \"detection_provider\": \"<string>\",\n \"enable_rca\": true,\n \"enabled\": true,\n \"name\": \"<string>\",\n \"output_schema\": [\n \"<unknown>\"\n ],\n \"prompt\": \"<string>\",\n \"sample_rate\": 123,\n \"trigger_conditions\": [\n \"<unknown>\"\n ]\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/detectors/{detector_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\",\n \"detection_model\": \"<string>\",\n \"detection_provider\": \"<string>\",\n \"enable_rca\": true,\n \"enabled\": true,\n \"name\": \"<string>\",\n \"output_schema\": [\n \"<unknown>\"\n ],\n \"prompt\": \"<string>\",\n \"sample_rate\": 123,\n \"trigger_conditions\": [\n \"<unknown>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.traceroot.ai/api/v1/public/detectors/{detector_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 \"detection_model\": \"<string>\",\n \"detection_provider\": \"<string>\",\n \"enable_rca\": true,\n \"enabled\": true,\n \"name\": \"<string>\",\n \"output_schema\": [\n \"<unknown>\"\n ],\n \"prompt\": \"<string>\",\n \"sample_rate\": 123,\n \"trigger_conditions\": [\n \"<unknown>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"changed": [
"<string>"
],
"detector": {
"enabled": true,
"id": "<string>",
"name": "<string>",
"project_id": "<string>",
"sample_rate": 123
},
"updated": true
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"detail": "<string>"
}Edit a detector
Edit a detector in a project the authenticated user can write to.
Requires MEMBER role or higher in the project’s workspace (the write
service decides). Only the sent fields change; template is immutable.
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.
detector_id (str): The detector to edit.
payload (UpdateDetectorRequest): The project and the fields to change.
_live (None): Write-path liveness gate (blocks a revoked JWT session).
Returns: UpdateDetectorResponse: The updated detector and the changed fields.
Raises: HTTPException: The write service’s 400/403/404/409 verbatim, or a 503 when its response is ambiguous.
curl --request PATCH \
--url https://app.traceroot.ai/api/v1/public/detectors/{detector_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"detection_model": "<string>",
"detection_provider": "<string>",
"enable_rca": true,
"enabled": true,
"name": "<string>",
"output_schema": [
"<unknown>"
],
"prompt": "<string>",
"sample_rate": 123,
"trigger_conditions": [
"<unknown>"
]
}
'import requests
url = "https://app.traceroot.ai/api/v1/public/detectors/{detector_id}"
payload = {
"project_id": "<string>",
"detection_model": "<string>",
"detection_provider": "<string>",
"enable_rca": True,
"enabled": True,
"name": "<string>",
"output_schema": ["<unknown>"],
"prompt": "<string>",
"sample_rate": 123,
"trigger_conditions": ["<unknown>"]
}
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>',
detection_model: '<string>',
detection_provider: '<string>',
enable_rca: true,
enabled: true,
name: '<string>',
output_schema: ['<unknown>'],
prompt: '<string>',
sample_rate: 123,
trigger_conditions: ['<unknown>']
})
};
fetch('https://app.traceroot.ai/api/v1/public/detectors/{detector_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/detectors/{detector_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>',
'detection_model' => '<string>',
'detection_provider' => '<string>',
'enable_rca' => true,
'enabled' => true,
'name' => '<string>',
'output_schema' => [
'<unknown>'
],
'prompt' => '<string>',
'sample_rate' => 123,
'trigger_conditions' => [
'<unknown>'
]
]),
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/detectors/{detector_id}"
payload := strings.NewReader("{\n \"project_id\": \"<string>\",\n \"detection_model\": \"<string>\",\n \"detection_provider\": \"<string>\",\n \"enable_rca\": true,\n \"enabled\": true,\n \"name\": \"<string>\",\n \"output_schema\": [\n \"<unknown>\"\n ],\n \"prompt\": \"<string>\",\n \"sample_rate\": 123,\n \"trigger_conditions\": [\n \"<unknown>\"\n ]\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/detectors/{detector_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\",\n \"detection_model\": \"<string>\",\n \"detection_provider\": \"<string>\",\n \"enable_rca\": true,\n \"enabled\": true,\n \"name\": \"<string>\",\n \"output_schema\": [\n \"<unknown>\"\n ],\n \"prompt\": \"<string>\",\n \"sample_rate\": 123,\n \"trigger_conditions\": [\n \"<unknown>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.traceroot.ai/api/v1/public/detectors/{detector_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 \"detection_model\": \"<string>\",\n \"detection_provider\": \"<string>\",\n \"enable_rca\": true,\n \"enabled\": true,\n \"name\": \"<string>\",\n \"output_schema\": [\n \"<unknown>\"\n ],\n \"prompt\": \"<string>\",\n \"sample_rate\": 123,\n \"trigger_conditions\": [\n \"<unknown>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"changed": [
"<string>"
],
"detector": {
"enabled": true,
"id": "<string>",
"name": "<string>",
"project_id": "<string>",
"sample_rate": 123
},
"updated": 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.
Path Parameters
Body
Body for editing a detector; template is immutable and not accepted.
system, byok The pause switch. Detection is ingestion-triggered, so enabling starts nothing retroactively.
Replaces the whole output schema array
Detector instructions, stored verbatim. There is no reset to a template's default on update: send the canonical text to restore it.
Replaces the whole trigger array; [] removes the trigger so every completed trace is evaluated. Each condition is {field, op, value} (metadata also takes key): model_name/environment take =, !=; cost/total_tokens/duration_ms/errors take >, >=, <, <=, =; metadata takes =, contains.

