curl --request POST \
--url https://app.traceroot.ai/api/v1/public/widgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dashboard_id": "<string>",
"project_id": "<string>",
"spec": {
"display": {},
"metric": {},
"view": "spans",
"filters": [
{
"value": "<string>",
"key": "<string>"
}
]
},
"title": "<string>",
"type": "<string>",
"display_config": {}
}
'import requests
url = "https://app.traceroot.ai/api/v1/public/widgets"
payload = {
"dashboard_id": "<string>",
"project_id": "<string>",
"spec": {
"display": {},
"metric": {},
"view": "spans",
"filters": [
{
"value": "<string>",
"key": "<string>"
}
]
},
"title": "<string>",
"type": "<string>",
"display_config": {}
}
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({
dashboard_id: '<string>',
project_id: '<string>',
spec: {
display: {},
metric: {},
view: 'spans',
filters: [{value: '<string>', key: '<string>'}]
},
title: '<string>',
type: '<string>',
display_config: {}
})
};
fetch('https://app.traceroot.ai/api/v1/public/widgets', 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",
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([
'dashboard_id' => '<string>',
'project_id' => '<string>',
'spec' => [
'display' => [
],
'metric' => [
],
'view' => 'spans',
'filters' => [
[
'value' => '<string>',
'key' => '<string>'
]
]
],
'title' => '<string>',
'type' => '<string>',
'display_config' => [
]
]),
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"
payload := strings.NewReader("{\n \"dashboard_id\": \"<string>\",\n \"project_id\": \"<string>\",\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 \"type\": \"<string>\",\n \"display_config\": {}\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/widgets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dashboard_id\": \"<string>\",\n \"project_id\": \"<string>\",\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 \"type\": \"<string>\",\n \"display_config\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.traceroot.ai/api/v1/public/widgets")
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 \"dashboard_id\": \"<string>\",\n \"project_id\": \"<string>\",\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 \"type\": \"<string>\",\n \"display_config\": {}\n}"
response = http.request(request)
puts response.read_body{
"created": true,
"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>"
}Create a dashboard widget
Create a widget on a dashboard the authenticated user can write to.
Requires MEMBER role or higher in the project’s workspace (the write
service decides). Strict create — never idempotent, 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 (CreateWidgetRequest): The widget to create.
_live (None): Write-path liveness gate (blocks a revoked JWT session).
Returns: CreateWidgetResponse: The created widget.
curl --request POST \
--url https://app.traceroot.ai/api/v1/public/widgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dashboard_id": "<string>",
"project_id": "<string>",
"spec": {
"display": {},
"metric": {},
"view": "spans",
"filters": [
{
"value": "<string>",
"key": "<string>"
}
]
},
"title": "<string>",
"type": "<string>",
"display_config": {}
}
'import requests
url = "https://app.traceroot.ai/api/v1/public/widgets"
payload = {
"dashboard_id": "<string>",
"project_id": "<string>",
"spec": {
"display": {},
"metric": {},
"view": "spans",
"filters": [
{
"value": "<string>",
"key": "<string>"
}
]
},
"title": "<string>",
"type": "<string>",
"display_config": {}
}
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({
dashboard_id: '<string>',
project_id: '<string>',
spec: {
display: {},
metric: {},
view: 'spans',
filters: [{value: '<string>', key: '<string>'}]
},
title: '<string>',
type: '<string>',
display_config: {}
})
};
fetch('https://app.traceroot.ai/api/v1/public/widgets', 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",
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([
'dashboard_id' => '<string>',
'project_id' => '<string>',
'spec' => [
'display' => [
],
'metric' => [
],
'view' => 'spans',
'filters' => [
[
'value' => '<string>',
'key' => '<string>'
]
]
],
'title' => '<string>',
'type' => '<string>',
'display_config' => [
]
]),
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"
payload := strings.NewReader("{\n \"dashboard_id\": \"<string>\",\n \"project_id\": \"<string>\",\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 \"type\": \"<string>\",\n \"display_config\": {}\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/widgets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dashboard_id\": \"<string>\",\n \"project_id\": \"<string>\",\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 \"type\": \"<string>\",\n \"display_config\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.traceroot.ai/api/v1/public/widgets")
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 \"dashboard_id\": \"<string>\",\n \"project_id\": \"<string>\",\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 \"type\": \"<string>\",\n \"display_config\": {}\n}"
response = http.request(request)
puts response.read_body{
"created": true,
"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.
Body
Body for creating a widget on a dashboard.
Unlike the other create bodies, spec is deep-validated here: it is a
structured contract the agent/CLI must compose (a wrong shape only
surfaces at render time otherwise), and the union below is what generated
tool schemas show the model.
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

