curl --request GET \
--url https://app.traceroot.ai/api/v1/public/traces/{trace_id}/export \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.traceroot.ai/api/v1/public/traces/{trace_id}/export"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.traceroot.ai/api/v1/public/traces/{trace_id}/export', 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/traces/{trace_id}/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.traceroot.ai/api/v1/public/traces/{trace_id}/export"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.traceroot.ai/api/v1/public/traces/{trace_id}/export")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.traceroot.ai/api/v1/public/traces/{trace_id}/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"git_context": {
"git_ref": "<string>",
"git_repo": "<string>",
"sources": [
{
"file": "<string>",
"function": "<string>",
"line": 123,
"span_id": "<string>"
}
]
},
"manifest": {
"bundle_version": "<string>",
"files": [
"<string>"
],
"project_id": "<string>",
"trace_id": "<string>"
},
"spans": [
{
"cost": 123,
"input_tokens": 123,
"model_name": "<string>",
"name": "<string>",
"output_tokens": 123,
"parent_span_id": "<string>",
"span_end_time": "2023-11-07T05:31:56Z",
"span_id": "<string>",
"span_kind": "<string>",
"span_start_time": "2023-11-07T05:31:56Z",
"status": "<string>",
"status_message": "<string>",
"total_tokens": 123,
"trace_id": "<string>",
"cost_details": {},
"error_type": "",
"git_source_file": "<string>",
"git_source_function": "<string>",
"git_source_line": 123,
"input": "<string>",
"metadata": "<string>",
"output": "<string>",
"usage_details": {}
}
],
"trace": {
"git_ref": "<string>",
"git_repo": "<string>",
"input": "<string>",
"metadata": "<string>",
"name": "<string>",
"output": "<string>",
"project_id": "<string>",
"session_id": "<string>",
"spans": [
{
"cost": 123,
"input_tokens": 123,
"model_name": "<string>",
"name": "<string>",
"output_tokens": 123,
"parent_span_id": "<string>",
"span_end_time": "2023-11-07T05:31:56Z",
"span_id": "<string>",
"span_kind": "<string>",
"span_start_time": "2023-11-07T05:31:56Z",
"status": "<string>",
"status_message": "<string>",
"total_tokens": 123,
"trace_id": "<string>",
"cost_details": {},
"error_type": "",
"git_source_file": "<string>",
"git_source_function": "<string>",
"git_source_line": 123,
"input": "<string>",
"metadata": "<string>",
"output": "<string>",
"usage_details": {}
}
],
"trace_id": "<string>",
"trace_start_time": "2023-11-07T05:31:56Z",
"trace_url": "<string>",
"user_id": "<string>"
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}Export Trace
Export the V1 bundle (trace + spans + git_context + manifest) for the caller’s project.
Defaults to the full projection — an export is explicit intent to take the
complete trace, so per-span input/output/metadata are included unless the
caller narrows fields. bundle.trace equals the traces get payload at the
same projection.
Rate limited on its own export bucket because it builds and serializes the
full bundle.
Args:
auth (DualStampedAuth): Resolved credential context (API key or user
session token); scopes the read to its project and stamps the
rate-limit identity.
trace_id (str): Trace to export.
fields (str | None): Comma-separated projection groups or an alias
(skeleton/full). None selects the default full
projection.
Returns: PublicTraceExportResponse: The V1 export bundle (manifest, trace, spans, git_context) at the requested projection.
Raises:
HTTPException: 400 if fields is invalid, 404 if the trace is missing
or outside the key’s project, 500 on a reader failure.
curl --request GET \
--url https://app.traceroot.ai/api/v1/public/traces/{trace_id}/export \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.traceroot.ai/api/v1/public/traces/{trace_id}/export"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.traceroot.ai/api/v1/public/traces/{trace_id}/export', 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/traces/{trace_id}/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.traceroot.ai/api/v1/public/traces/{trace_id}/export"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.traceroot.ai/api/v1/public/traces/{trace_id}/export")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.traceroot.ai/api/v1/public/traces/{trace_id}/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"git_context": {
"git_ref": "<string>",
"git_repo": "<string>",
"sources": [
{
"file": "<string>",
"function": "<string>",
"line": 123,
"span_id": "<string>"
}
]
},
"manifest": {
"bundle_version": "<string>",
"files": [
"<string>"
],
"project_id": "<string>",
"trace_id": "<string>"
},
"spans": [
{
"cost": 123,
"input_tokens": 123,
"model_name": "<string>",
"name": "<string>",
"output_tokens": 123,
"parent_span_id": "<string>",
"span_end_time": "2023-11-07T05:31:56Z",
"span_id": "<string>",
"span_kind": "<string>",
"span_start_time": "2023-11-07T05:31:56Z",
"status": "<string>",
"status_message": "<string>",
"total_tokens": 123,
"trace_id": "<string>",
"cost_details": {},
"error_type": "",
"git_source_file": "<string>",
"git_source_function": "<string>",
"git_source_line": 123,
"input": "<string>",
"metadata": "<string>",
"output": "<string>",
"usage_details": {}
}
],
"trace": {
"git_ref": "<string>",
"git_repo": "<string>",
"input": "<string>",
"metadata": "<string>",
"name": "<string>",
"output": "<string>",
"project_id": "<string>",
"session_id": "<string>",
"spans": [
{
"cost": 123,
"input_tokens": 123,
"model_name": "<string>",
"name": "<string>",
"output_tokens": 123,
"parent_span_id": "<string>",
"span_end_time": "2023-11-07T05:31:56Z",
"span_id": "<string>",
"span_kind": "<string>",
"span_start_time": "2023-11-07T05:31:56Z",
"status": "<string>",
"status_message": "<string>",
"total_tokens": 123,
"trace_id": "<string>",
"cost_details": {},
"error_type": "",
"git_source_file": "<string>",
"git_source_function": "<string>",
"git_source_line": 123,
"input": "<string>",
"metadata": "<string>",
"output": "<string>",
"usage_details": {}
}
],
"trace_id": "<string>",
"trace_start_time": "2023-11-07T05:31:56Z",
"trace_url": "<string>",
"user_id": "<string>"
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Comma-separated field groups to include: 'core' (tree/timing/status, always included), 'usage' (tokens/cost), 'io' (per-span input/output), 'metadata' (per-span metadata). Aliases: 'skeleton' (core,usage), 'full' (everything). Unknown groups return 400.
Target project for the request. Required when authenticating with a user session token (a user credential is only meaningful scoped to a project); for an API key it is optional and, if given, must match the key's project.
Response
Successful Response
V1 export bundle: trace (== traces get) + spans + git_context + manifest.
git_context.json: repo/ref + per-span source locations.
Show child attributes
Show child attributes
manifest.json: index of the bundle's parts.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Full trace payload plus a backend-built link to its UI detail view.
Show child attributes
Show child attributes

