---
title: "Get analytics"
method: GET
path: "/analytics"
tags: ["Analytics"]
---

# Get analytics

`GET /analytics`

## Request

- Base URL: `https://app.freyavoice.ai/api/v2`
- URL: `https://app.freyavoice.ai/api/v2/analytics`
- Auth: HTTP bearer

Returns call analytics for a workspace including summary statistics, time series data, ended reasons, top locations, sentiment distribution, and more.

**Available Metrics:**
- `summary`: Total calls, answered calls, voicemail, durations, answer rate
- `timeSeries`: Call volume over time with configurable granularity
- `endedReasons`: Distribution of call end reasons
- `topLocations`: Most common caller locations
- `topCalls`: Longest or most recent calls
- `geoDistribution`: Geographic distribution by country and state
- `callThemes`: Common topics from call analysis
- `sentimentDistribution`: Customer sentiment breakdown

## Query parameters

- `workspaceId` string, uuid, required: Workspace ID
- `startDate` string: Start date for analytics period (ISO format)
- `endDate` string: End date for analytics period (ISO format)
- `phoneNumberId` string, uuid: Filter by phone number ID
- `assistantId` string: Filter by assistant/agent ID (bigint as string)
- `assistantIds` string[]: Filter by multiple assistant IDs (JSON array)
- `granularity` 'hour' | 'day' | 'month': Time series granularity: hour, day, or month
- `metrics` string[]: Specific metrics to return (JSON array)
- `timezone` string: IANA timezone for date calculations
- `status` string[]: Filter by call status (JSON array)
- `callType` string[]: Filter by call type: inbound, outbound, web (JSON array)

## Response `200`

Analytics data

- object
  - `success` true, required
  - `data` object, required
    - `message` string, required
    - `result` object, required
      - `workspaceId` string, required
      - `timeRange` object, required
        - `start` string, required
        - `end` string, required
      - `granularity` 'hour' | 'day' | 'month', required
      - `summary` object
        - `totalCalls` number, required
        - `answeredCalls` number, required
        - `voicemailCalls` number, required
        - `totalDurationSec` number, required
        - `averageDurationSec` number, required
        - `answerRate` number, required
      - `timeSeries` object[]
        - `date` string, required
        - `totalCalls` number, required
        - `answeredCalls` number, required
        - `averageDurationSec` number, required
        - `sentimentCounts` object
          - `very-unhappy` number, required
          - `unhappy` number, required
          - `neutral` number, required
          - `happy` number, required
          - `very-happy` number, required
      - `endedReasons` object[]
        - `reason` string, required
        - `count` number, required
      - `topLocations` object[]
        - `locale` string, required
        - `callCount` number, required
      - `topCalls` object[]
        - `callId` string, required
        - `customerNumber` string, nullable, required
        - `durationSec` number, required
        - `startedAt` string, required
        - `status` string, nullable, required
        - `endedReason` string, nullable, required
      - `geoDistribution` object
        - `countries` object[], required
          - `countryCode` string, required
          - `countryName` string, required
          - `callCount` number, required
        - `states` object[], required
          - `countryCode` string, required
          - `countryName` string, required
          - `stateCode` string, required
          - `stateName` string, required
          - `callCount` number, required
      - `callThemes` object[]
        - `theme` string, required
        - `count` number, required
      - `sentimentDistribution` object[]
        - `bucket` 'very-unhappy' | 'unhappy' | 'neutral' | 'happy' | 'very-happy', required
        - `count` number, required
      - `generatedAt` string, required

## Other responses

- `400`: Validation error
- `401`: Missing or invalid token
- `500`: Server error

---

[API](https://skmtc.dev/freyavoice/apis/freyavoice-api.md) - [All operations](https://skmtc.dev/freyavoice/apis/freyavoice-api/llms.txt) - [OpenAPI document](https://skmtc.dev/freyavoice/apis/freyavoice-api/revisions/153d120f0c73?raw)
