> ## Documentation Index
> Fetch the complete documentation index at: https://docs.telzino.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Metrics

> Returns usage metrics including call volume, resolution rates, hourly distribution, and per-agent performance

## Query Parameters

<ParamField query="startDate" type="string" required>
  Start of the date range in ISO 8601 format (e.g., `2025-01-01T00:00:00.000Z`)
</ParamField>

<ParamField query="endDate" type="string" required>
  End of the date range in ISO 8601 format (e.g., `2025-12-31T23:59:59.000Z`)
</ParamField>

<ParamField query="organizationId" type="string">
  Filter metrics by organization ID (UUID format). If omitted, returns metrics across all accessible organizations.
</ParamField>

<ParamField query="resellerId" type="string">
  Filter metrics by reseller ID (UUID format). Returns the same metrics fields, structure, and data types as the organization response, aggregated across all organizations under that reseller.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.telzino.com/v1/metrics?startDate=2025-01-01T00:00:00.000Z&endDate=2025-12-31T23:59:59.000Z" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

  # Filter by organization
  curl "https://api.telzino.com/v1/metrics?startDate=2025-01-01T00:00:00.000Z&endDate=2025-12-31T23:59:59.000Z&organizationId=123e4567-e89b-12d3-a456-426614174000" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

  # Filter by reseller
  curl "https://api.telzino.com/v1/metrics?startDate=2025-01-01T00:00:00.000Z&endDate=2025-12-31T23:59:59.000Z&resellerId=123e4567-e89b-12d3-a456-426614174999" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    startDate: '2025-01-01T00:00:00.000Z',
    endDate: '2025-12-31T23:59:59.000Z',
    resellerId: '123e4567-e89b-12d3-a456-426614174999'
  });

  const response = await fetch(`https://api.telzino.com/v1/metrics?${params}`, {
    headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN' }
  });

  const { data } = await response.json();
  console.log(data.metrics.totalCalls);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.telzino.com/v1/metrics',
      params={
          'startDate': '2025-01-01T00:00:00.000Z',
          'endDate': '2025-12-31T23:59:59.000Z',
          'resellerId': '123e4567-e89b-12d3-a456-426614174999'
      },
      headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}
  )

  metrics = response.json()['data']
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": {
      "metrics": {
        "totalCalls": 1250,
        "totalMinutes": 3420.5,
        "resolutionRate": 78,
        "avgDuration": 164,
        "activeAgents": 12,
        "responseTime": 842,
        "sentimentPercent": 71,
        "escalationRate": 12
      },
      "dailyVolume": [
        { "date": "2024-01-01", "totalCalls": 45, "resolvedCalls": 35 }
      ],
      "resolutionBreakdown": {
        "resolved": 975,
        "transferred": 150,
        "abandoned": 75,
        "other": 50
      },
      "hourlyDistribution": [
        { "hour": "09:00", "calls": 120, "minutes": 320 }
      ],
      "agentPerformance": [
        {
          "agentId": "123e4567-e89b-12d3-a456-426614174000",
          "agentName": "Customer Support Agent",
          "totalCalls": 450,
          "resolved": 360,
          "transferred": 50,
          "abandoned": 25,
          "other": 15,
          "resolvedPercent": 80,
          "transferredPercent": 11,
          "abandonedPercent": 6,
          "otherPercent": 3,
          "avgDuration": 158,
          "sentimentPercent": 74,
          "status": "active"
        }
      ],
      "aiInsights": {
        "intentAccuracy": 87,
        "contextRetention": 62,
        "speechRecognition": 94,
        "entityExtraction": 91,
        "responseLatency": 842,
        "trainingSessions": 1250
      },
      "escalationReasons": [
        {
          "reason": "billing dispute",
          "count": 45,
          "percentOfTotal": 30,
          "avgTimeBeforeEscalation": 124
        },
        {
          "reason": "technical issue requiring specialist",
          "count": 38,
          "percentOfTotal": 25,
          "avgTimeBeforeEscalation": 98
        }
      ]
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": "invalid_token",
    "error_description": "Missing or invalid authorization token"
  }
  ```
</ResponseExample>

## Response Fields

### `metrics`

| Field              | Type           | Description                                                                              |
| ------------------ | -------------- | ---------------------------------------------------------------------------------------- |
| `totalCalls`       | number         | Total number of calls in the date range                                                  |
| `totalMinutes`     | number         | Total call minutes                                                                       |
| `resolutionRate`   | number         | Percentage of calls resolved (0–100)                                                     |
| `avgDuration`      | number         | Average call duration in seconds                                                         |
| `activeAgents`     | number         | Number of agents that handled calls                                                      |
| `responseTime`     | number \| null | Average LLM time-to-first-token in milliseconds. `null` if telemetry data is unavailable |
| `sentimentPercent` | number \| null | Percentage of calls with Positive sentiment (0–100). `null` if no sentiment data         |
| `escalationRate`   | number \| null | Percentage of calls transferred or escalated (0–100)                                     |

### `dailyVolume`

Array of daily call counts:

| Field           | Type   | Description                 |
| --------------- | ------ | --------------------------- |
| `date`          | string | Date in `YYYY-MM-DD` format |
| `totalCalls`    | number | Total calls on this date    |
| `resolvedCalls` | number | Calls resolved on this date |

### `hourlyDistribution`

Array of 24 entries (one per hour of the day):

| Field     | Type   | Description                              |
| --------- | ------ | ---------------------------------------- |
| `hour`    | string | Hour in `HH:00` format (e.g., `"09:00"`) |
| `calls`   | number | Number of calls during this hour         |
| `minutes` | number | Total minutes during this hour           |

### `resolutionBreakdown`

| Field         | Type   | Description                              |
| ------------- | ------ | ---------------------------------------- |
| `resolved`    | number | Calls successfully resolved by the agent |
| `transferred` | number | Calls transferred to a human             |
| `abandoned`   | number | Calls abandoned by the caller            |
| `other`       | number | Calls with other outcomes                |

### `agentPerformance`

Array of per-agent metrics:

| Field                | Type           | Description                                                                                     |
| -------------------- | -------------- | ----------------------------------------------------------------------------------------------- |
| `agentId`            | string         | Agent UUID                                                                                      |
| `agentName`          | string         | Agent display name                                                                              |
| `totalCalls`         | number         | Total calls handled                                                                             |
| `resolved`           | number         | Calls resolved                                                                                  |
| `transferred`        | number         | Calls transferred                                                                               |
| `abandoned`          | number         | Calls abandoned                                                                                 |
| `other`              | number         | Other outcomes                                                                                  |
| `resolvedPercent`    | number         | Percentage resolved                                                                             |
| `transferredPercent` | number         | Percentage transferred                                                                          |
| `abandonedPercent`   | number         | Percentage abandoned                                                                            |
| `otherPercent`       | number         | Percentage other                                                                                |
| `avgDuration`        | number         | Average call duration in seconds for this agent                                                 |
| `sentimentPercent`   | number \| null | Percentage of positive-sentiment calls for this agent. `null` if no sentiment data              |
| `status`             | string         | Agent status: `active`, `inactive`, `cancelled`, `pending`, or `deleted` (hard-deleted from DB) |

### `aiInsights`

AI model quality and operational metrics for the period:

| Field               | Type           | Description                                                                                                                                                              |
| ------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `intentAccuracy`    | number \| null | Percentage of calls where the agent required zero user corrections (0–100). `null` if no correction data                                                                 |
| `contextRetention`  | number \| null | Average ratio of cached LLM tokens to total tokens, as a percentage (0–100). Measures how effectively conversation context is preserved. `null` if telemetry unavailable |
| `speechRecognition` | number \| null | Average STT transcript confidence score as a percentage (0–100). `null` if telemetry unavailable                                                                         |
| `entityExtraction`  | number \| null | Percentage of AI function tool calls that completed without error (0–100). `null` if telemetry unavailable                                                               |
| `responseLatency`   | number \| null | Average LLM time-to-first-token in milliseconds. Same source as `metrics.responseTime`. `null` if telemetry unavailable                                                  |
| `trainingSessions`  | number         | Total number of call sessions in the date range                                                                                                                          |

### `escalationReasons`

Array of reasons why calls were transferred or escalated, sorted by count descending. Empty array if no escalated calls have a recorded reason.

| Field                     | Type   | Description                                                                                      |
| ------------------------- | ------ | ------------------------------------------------------------------------------------------------ |
| `reason`                  | string | AI-extracted reason phrase (e.g., `"billing dispute"`, `"technical issue requiring specialist"`) |
| `count`                   | number | Number of calls with this reason                                                                 |
| `percentOfTotal`          | number | Percentage of all escalated calls with this reason (0–100)                                       |
| `avgTimeBeforeEscalation` | number | Average call duration in seconds before escalation occurred                                      |
