curl --request PATCH \
--url https://app.traceroot.ai/api/v1/public/widgets/{widget_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"display_config": {},
"spec": {
"display": {},
"metric": {},
"view": "spans",
"filters": [
{
"value": "<string>",
"key": "<string>"
}
]
},
"title": "<string>"
}
'import requests
url = "https://app.traceroot.ai/api/v1/public/widgets/{widget_id}"
payload = {
"project_id": "<string>",
"display_config": {},
"spec": {
"display": {},
"metric": {},
"view": "spans",
"filters": [
{
"value": "<string>",
"key": "<string>"
}
]
},
"title": "<string>"
}
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>',
display_config: {},
spec: {
display: {},
metric: {},
view: 'spans',
filters: [{value: '<string>', key: '<string>'}]
},
title: '<string>'
})
};
fetch('https://app.traceroot.ai/api/v1/public/widgets/{widget_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/widgets/{widget_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>',
'display_config' => [
],
'spec' => [
'display' => [
],
'metric' => [
],
'view' => 'spans',
'filters' => [
[
'value' => '<string>',
'key' => '<string>'
]
]
],
'title' => '<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/widgets/{widget_id}"
payload := strings.NewReader("{\n \"project_id\": \"<string>\",\n \"display_config\": {},\n \"spec\": {\n \"display\": {},\n \"metric\": {},\n \"view\": \"spans\",\n \"filters\": [\n {\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n },\n \"title\": \"<string>\"\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/widgets/{widget_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\",\n \"display_config\": {},\n \"spec\": {\n \"display\": {},\n \"metric\": {},\n \"view\": \"spans\",\n \"filters\": [\n {\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n },\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.traceroot.ai/api/v1/public/widgets/{widget_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 \"display_config\": {},\n \"spec\": {\n \"display\": {},\n \"metric\": {},\n \"view\": \"spans\",\n \"filters\": [\n {\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n },\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"changed": [
"<string>"
],
"updated": true,
"widget": {
"dashboard_id": "<string>",
"id": "<string>",
"title": "<string>",
"type": "<string>"
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"detail": "<string>"
}Edit a dashboard widget
Edit a widget’s title, spec, or display config.
Requires MEMBER role or higher in the project’s workspace (the write
service decides). A sent spec replaces the whole spec and is checked
against the widget’s stored type by the service; type 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.
widget_id (str): The widget to edit.
payload (UpdateWidgetRequest): The project and the fields to change.
_live (None): Write-path liveness gate (blocks a revoked JWT session).
Returns: UpdateWidgetResponse: The updated widget and the changed fields.
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/widgets/{widget_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"display_config": {},
"spec": {
"display": {},
"metric": {},
"view": "spans",
"filters": [
{
"value": "<string>",
"key": "<string>"
}
]
},
"title": "<string>"
}
'import requests
url = "https://app.traceroot.ai/api/v1/public/widgets/{widget_id}"
payload = {
"project_id": "<string>",
"display_config": {},
"spec": {
"display": {},
"metric": {},
"view": "spans",
"filters": [
{
"value": "<string>",
"key": "<string>"
}
]
},
"title": "<string>"
}
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>',
display_config: {},
spec: {
display: {},
metric: {},
view: 'spans',
filters: [{value: '<string>', key: '<string>'}]
},
title: '<string>'
})
};
fetch('https://app.traceroot.ai/api/v1/public/widgets/{widget_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/widgets/{widget_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>',
'display_config' => [
],
'spec' => [
'display' => [
],
'metric' => [
],
'view' => 'spans',
'filters' => [
[
'value' => '<string>',
'key' => '<string>'
]
]
],
'title' => '<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/widgets/{widget_id}"
payload := strings.NewReader("{\n \"project_id\": \"<string>\",\n \"display_config\": {},\n \"spec\": {\n \"display\": {},\n \"metric\": {},\n \"view\": \"spans\",\n \"filters\": [\n {\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n },\n \"title\": \"<string>\"\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/widgets/{widget_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\",\n \"display_config\": {},\n \"spec\": {\n \"display\": {},\n \"metric\": {},\n \"view\": \"spans\",\n \"filters\": [\n {\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n },\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.traceroot.ai/api/v1/public/widgets/{widget_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 \"display_config\": {},\n \"spec\": {\n \"display\": {},\n \"metric\": {},\n \"view\": \"spans\",\n \"filters\": [\n {\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n },\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"changed": [
"<string>"
],
"updated": true,
"widget": {
"dashboard_id": "<string>",
"id": "<string>",
"title": "<string>",
"type": "<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 widget; type and dashboard_id are immutable.
Replaces the whole display config; null resets it to {}
Chart spec over the "spans" view; the enums below are the complete field vocabulary for this view.
- WidgetSpec (spans)
- WidgetSpec (traces)
- TraceFeedSpec
Show child attributes
Show child attributes

