Check out our upcoming events and meetups! View events →
Retrieves a full session analysis tree for a given event, including costs, child events, and product linkages.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const sessionAnalysis = await client.sessionAnalysis.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ record_type: 'record_type' },
);
console.log(sessionAnalysis.session_id);{
"session_id": "call-123",
"cost": {
"total": "0.056800",
"currency": "USD"
},
"root": {
"id": "call-123",
"product": "callcontrol-cdrs",
"event_name": "callcontrol-cdrs",
"relationship": null,
"cost": {
"event_cost": "0.001800",
"cumulative_cost": "0.056800",
"currency": "USD"
},
"links": {
"self": "/v2/session_analysis/callcontrol-cdrs/call-123",
"records": "/v2/detail_records?record_type=callcontrol-cdrs&id=call-123"
},
"record": {},
"children": []
},
"meta": {
"event_count": 3,
"products": [
"ai-voice-assistant",
"callcontrol-cdrs",
"inference"
]
}
}Documentation Index
Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The record type identifier.
The event identifier (UUID).
Whether to include child events in the response.
Maximum traversal depth for the event tree.
1 <= x <= 5Controls what data to expand on each event node.
record, none ISO 8601 timestamp or date to narrow index selection for faster lookups. Accepts full datetime (e.g., 2026-03-17T10:00:00Z) or date-only format (e.g., 2026-03-17).
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const sessionAnalysis = await client.sessionAnalysis.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ record_type: 'record_type' },
);
console.log(sessionAnalysis.session_id);{
"session_id": "call-123",
"cost": {
"total": "0.056800",
"currency": "USD"
},
"root": {
"id": "call-123",
"product": "callcontrol-cdrs",
"event_name": "callcontrol-cdrs",
"relationship": null,
"cost": {
"event_cost": "0.001800",
"cumulative_cost": "0.056800",
"currency": "USD"
},
"links": {
"self": "/v2/session_analysis/callcontrol-cdrs/call-123",
"records": "/v2/detail_records?record_type=callcontrol-cdrs&id=call-123"
},
"record": {},
"children": []
},
"meta": {
"event_count": 3,
"products": [
"ai-voice-assistant",
"callcontrol-cdrs",
"inference"
]
}
}