Get turn spans
The spans of one turn of a conversation.
GET
/
api
/
v1
/
traces
/
conversations
/
{conversation_id}
/
turns
/
{turn_index}
Get turn spans
curl --request GET \
--url https://api.example.com/api/v1/traces/conversations/{conversation_id}/turns/{turn_index} \
--header 'X-API-KEY: <x-api-key>'import requests
url = "https://api.example.com/api/v1/traces/conversations/{conversation_id}/turns/{turn_index}"
headers = {"X-API-KEY": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<x-api-key>'}};
fetch('https://api.example.com/api/v1/traces/conversations/{conversation_id}/turns/{turn_index}', 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://api.example.com/api/v1/traces/conversations/{conversation_id}/turns/{turn_index}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <x-api-key>"
],
]);
$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://api.example.com/api/v1/traces/conversations/{conversation_id}/turns/{turn_index}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/traces/conversations/{conversation_id}/turns/{turn_index}")
.header("X-API-KEY", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/traces/conversations/{conversation_id}/turns/{turn_index}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"conversation_id": "<string>",
"project_id": "<string>",
"turn_index": 123,
"total": 123,
"spans": [
{}
]
}Returns the spans that belong to a single turn, with the same span shape as get conversation spans. Use it after the timeline has pointed you at a slow or failing turn.
Request
Headers
string
required
Account API key with read access to conversations.
Path parameters
string
required
The conversation.
integer
required
0-based turn.
Query parameters
string
The agent the conversation belongs to. Optional with an account API key.
Response
string
string
integer
integer
Number of spans returned, at most 1,000.
object[]
Same fields as in get conversation spans, ordered by
timestamp ascending.Example
cURL
curl "https://api.us.poly.ai/api/v1/traces/conversations/CA3f2c1e9d6b7a4f8e9c0d1b2a3c4d5e6f/turns/10?project_id=PROJECT-V258TF29" \
-H "X-API-KEY: YOUR_API_KEY"
Errors
| Status | Meaning |
|---|---|
401 | Missing or invalid API key. |
403 | The key cannot read conversations. |
404 | The conversation has no spans for that turn, or belongs to another account. |
502 | The trace backend did not answer. |
Last modified on November 10, 2026
Was this page helpful?
⌘I
Get turn spans
curl --request GET \
--url https://api.example.com/api/v1/traces/conversations/{conversation_id}/turns/{turn_index} \
--header 'X-API-KEY: <x-api-key>'import requests
url = "https://api.example.com/api/v1/traces/conversations/{conversation_id}/turns/{turn_index}"
headers = {"X-API-KEY": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<x-api-key>'}};
fetch('https://api.example.com/api/v1/traces/conversations/{conversation_id}/turns/{turn_index}', 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://api.example.com/api/v1/traces/conversations/{conversation_id}/turns/{turn_index}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <x-api-key>"
],
]);
$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://api.example.com/api/v1/traces/conversations/{conversation_id}/turns/{turn_index}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/traces/conversations/{conversation_id}/turns/{turn_index}")
.header("X-API-KEY", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/traces/conversations/{conversation_id}/turns/{turn_index}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"conversation_id": "<string>",
"project_id": "<string>",
"turn_index": 123,
"total": 123,
"spans": [
{}
]
}
