List an execution's trace spans
curl --request GET \
--url https://app.crewai.com/api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.crewai.com/api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.crewai.com/api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans', 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.crewai.com/api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans",
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.crewai.com/api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans"
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.crewai.com/api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.crewai.com/api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans")
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{
"data": [
{
"id": "a1b2c3d4e5f60718",
"parent_id": "0f1e2d3c4b5a6978",
"name": "call llm",
"type": "llm_call",
"status": "ok",
"started_at": "2026-07-07T00:00:01.250000Z",
"finished_at": "2026-07-07T00:00:03.500000Z",
"duration_ms": 2250,
"input_tokens": 812,
"output_tokens": 164
}
],
"meta": {
"total_size": 1,
"next_page_token": null,
"complete": true
}
}{
"errors": [
{
"type": "https://docs-platform.crewai.com/api/problems/unauthorized",
"code": "unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "Missing or invalid bearer token."
}
]
}{
"errors": [
{
"type": "https://docs-platform.crewai.com/api/problems/not_found",
"code": "not_found",
"title": "Not found",
"status": 404,
"detail": "The requested resource could not be found."
}
]
}{
"errors": [
{
"type": "https://docs-platform.crewai.com/api/problems/validation_error",
"code": "validation_error",
"title": "Validation error",
"status": 422,
"detail": "page_token is not valid."
}
]
}Automations
List an execution's trace spans
Returns the spans of an Automation execution’s trace as a flat list, ordered by start time, then id.
Rebuild the tree from parent_id.
Spans in this list leave out their attributes, which hold prompts, completions and tool arguments and can be large. Get one span to read them.
GET
/
api
/
v1
/
automations
/
{automation_id}
/
executions
/
{execution_id}
/
trace
/
spans
List an execution's trace spans
curl --request GET \
--url https://app.crewai.com/api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.crewai.com/api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.crewai.com/api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans', 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.crewai.com/api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans",
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.crewai.com/api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans"
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.crewai.com/api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.crewai.com/api/v1/automations/{automation_id}/executions/{execution_id}/trace/spans")
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{
"data": [
{
"id": "a1b2c3d4e5f60718",
"parent_id": "0f1e2d3c4b5a6978",
"name": "call llm",
"type": "llm_call",
"status": "ok",
"started_at": "2026-07-07T00:00:01.250000Z",
"finished_at": "2026-07-07T00:00:03.500000Z",
"duration_ms": 2250,
"input_tokens": 812,
"output_tokens": 164
}
],
"meta": {
"total_size": 1,
"next_page_token": null,
"complete": true
}
}{
"errors": [
{
"type": "https://docs-platform.crewai.com/api/problems/unauthorized",
"code": "unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "Missing or invalid bearer token."
}
]
}{
"errors": [
{
"type": "https://docs-platform.crewai.com/api/problems/not_found",
"code": "not_found",
"title": "Not found",
"status": 404,
"detail": "The requested resource could not be found."
}
]
}{
"errors": [
{
"type": "https://docs-platform.crewai.com/api/problems/validation_error",
"code": "validation_error",
"title": "Validation error",
"status": 422,
"detail": "page_token is not valid."
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Example:
"4f6d0d9a-7b78-4c6a-b64f-2e2e3d2c8f9a"
Example:
"4f6d0d9a-7b78-4c6a-b64f-2e2e3d2c8f9a"
Query Parameters
Maximum number of spans to return. Defaults to 100; values above 1000 are reduced to 1000.
Required range:
x >= 1Continues after the last span of a previous page. Pass meta.next_page_token from that response.
