Skip to main content
GET
/
session_analysis
/
{record_type}
/
{event_id}
JavaScript
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.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

record_type
string
required

The record type identifier.

event_id
string<uuid>
required

The event identifier (UUID).

Query Parameters

include_children
boolean
default:true

Whether to include child events in the response.

max_depth
integer
default:2

Maximum traversal depth for the event tree.

Required range: 1 <= x <= 5
expand
enum<string>
default:record

Controls what data to expand on each event node.

Available options:
record,
none
date_time
string<date-time>

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).

Response

Session analysis result

session_id
string
required

Identifier for the analyzed session.

cost
object
required
root
object
required
meta
object
required