Fetch all call-level metrics for a specific call, including both system-generated and custom metrics. Only returns successfully computed metrics.
import Roark from '@roarkanalytics/sdk';
const client = new Roark({
bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted
});
const response = await client.call.getMetrics('callId');
console.log(response.data);{
"data": [
{
"metricDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metricId": "<string>",
"name": "<string>",
"description": "<string>",
"type": "COUNT",
"scope": "GLOBAL",
"values": [
{
"value": 123,
"context": "CALL",
"confidence": 0.5,
"computedAt": "2023-11-07T05:31:56Z",
"participantRole": "agent",
"valueReasoning": "<string>",
"segment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"startOffsetMs": 123,
"endOffsetMs": 123
},
"fromSegment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"startOffsetMs": 123,
"endOffsetMs": 123
},
"toSegment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"startOffsetMs": 123,
"endOffsetMs": 123
}
}
],
"unit": {
"name": "<string>",
"symbol": "<string>"
}
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Whether to return a flat list instead of grouped by metric definition (default: false)
Call-level metrics for a specific call
Call metrics response payload grouped by metric definition
Show child attributes
Unique identifier for the metric definition
Stable metric identifier
Name of the metric
Description of what the metric measures
Type of value this metric produces
COUNT, NUMERIC, BOOLEAN, SCALE, TEXT, CLASSIFICATION, OFFSET Whether metric is global or per-participant
GLOBAL, PER_PARTICIPANT Array of metric values (multiple for PER_PARTICIPANT metrics, or multiple segments/turns)
Show child attributes
The metric value (type depends on outputType)
Context level: CALL (entire call), SEGMENT (single segment), SEGMENT_RANGE (between/across segments)
CALL, SEGMENT, SEGMENT_RANGE Confidence score (0-1) for the computed value. Defaults to 1.0 for deterministic metrics.
0 <= x <= 1ISO 8601 timestamp when the metric was computed
Role of participant (only for PER_PARTICIPANT metrics)
agent, customer Explanation for the metric value (especially useful for AI-computed metrics)
Segment information (for SEGMENT context metrics)
Starting segment information (for SEGMENT_RANGE context metrics)
Show child attributes
Starting segment ID
Starting segment text content
Start time offset in milliseconds
End time offset in milliseconds
Ending segment information (for SEGMENT_RANGE context metrics)
Show child attributes
import Roark from '@roarkanalytics/sdk';
const client = new Roark({
bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted
});
const response = await client.call.getMetrics('callId');
console.log(response.data);{
"data": [
{
"metricDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metricId": "<string>",
"name": "<string>",
"description": "<string>",
"type": "COUNT",
"scope": "GLOBAL",
"values": [
{
"value": 123,
"context": "CALL",
"confidence": 0.5,
"computedAt": "2023-11-07T05:31:56Z",
"participantRole": "agent",
"valueReasoning": "<string>",
"segment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"startOffsetMs": 123,
"endOffsetMs": 123
},
"fromSegment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"startOffsetMs": 123,
"endOffsetMs": 123
},
"toSegment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"startOffsetMs": 123,
"endOffsetMs": 123
}
}
],
"unit": {
"name": "<string>",
"symbol": "<string>"
}
}
]
}