Read the trace of a finalized Call as OTLP JSON
GET /v1/calls/{call_id}/trace/otlp
| Property | Value |
|---|---|
| Operation | get_call_trace_otlp |
| Group | Call trace and analytics |
| Scope | calls:read |
| Route class | read |
| Idempotency | No Idempotency-Key |
| Audit | Not audited: A metadata read; the OTLP form carries no content class. |
| Released in | 1.57.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
The same trace as GET /v1/calls/{call_id}/trace in the OTLP JSON encoding (1.57.0), an ExportTraceServiceRequest the customer's own collector accepts: a root span call.session, one span per segment and one span event per mark. Metadata and stage traces only, never a content class; turns limits the segments as on the trace read. The trace id is the one of the traceparent POST /v1/calls carried, else one derived from the Call id.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the calls:read scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl "$VOCAL_API/v1/calls/call_.../trace/otlp" \
-H "Authorization: Bearer $VOCAL_API_KEY"const response = await fetch(`${process.env.VOCAL_API}/v1/calls/call_.../trace/otlp`, {
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
},
});
console.log(response.status, await response.text());import os
import requests
response = requests.get(
f"{os.environ['VOCAL_API']}/v1/calls/call_.../trace/otlp",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
call_id | path | CallId | yes | The id of a Call: call_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
turns | query | string | no | Only the turn segments whose Turn seq is in this range, both ends inclusive, as 3-7 or 4 (1.57.0); the setup and end segments, the envelopes and the content classes are limited to the same Turns. Absent: the whole trace. |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | OtlpTraceExport | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden |
404 | application/json | ErrorEnvelope | not_found |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is OtlpTraceExport.
| Field | Type | Required | Description |
|---|---|---|---|
resourceSpans | array of OtlpResourceSpans | yes |