Skip to main content
GET
/
v1
/
call
/
{callId}
/
metrics
JavaScript
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>"
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Path Parameters

callId
string
required

Query Parameters

flatten
string

Whether to return a flat list instead of grouped by metric definition (default: false)

Response

Call-level metrics for a specific call

data
object[]
required

Call metrics response payload grouped by metric definition