Skip to main content
GET
/
analytics
Get analytics
curl --request GET \
  --url https://app2.freyavoice.ai/api/v2/analytics \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "data": {
    "message": "<string>",
    "result": {
      "workspaceId": "<string>",
      "timeRange": {
        "start": "<string>",
        "end": "<string>"
      },
      "granularity": "hour",
      "generatedAt": "<string>",
      "summary": {
        "totalCalls": 123,
        "answeredCalls": 123,
        "voicemailCalls": 123,
        "totalDurationSec": 123,
        "averageDurationSec": 123,
        "answerRate": 123
      },
      "timeSeries": [
        {
          "date": "<string>",
          "totalCalls": 123,
          "answeredCalls": 123,
          "averageDurationSec": 123,
          "sentimentCounts": {
            "very-unhappy": 123,
            "unhappy": 123,
            "neutral": 123,
            "happy": 123,
            "very-happy": 123
          }
        }
      ],
      "endedReasons": [
        {
          "reason": "<string>",
          "count": 123
        }
      ],
      "topLocations": [
        {
          "locale": "<string>",
          "callCount": 123
        }
      ],
      "topCalls": [
        {
          "callId": "<string>",
          "customerNumber": "<string>",
          "durationSec": 123,
          "startedAt": "<string>",
          "status": "<string>",
          "endedReason": "<string>"
        }
      ],
      "geoDistribution": {
        "countries": [
          {
            "countryCode": "<string>",
            "countryName": "<string>",
            "callCount": 123
          }
        ],
        "states": [
          {
            "countryCode": "<string>",
            "countryName": "<string>",
            "stateCode": "<string>",
            "stateName": "<string>",
            "callCount": 123
          }
        ]
      },
      "callThemes": [
        {
          "theme": "<string>",
          "count": 123
        }
      ],
      "sentimentDistribution": [
        {
          "bucket": "very-unhappy",
          "count": 123
        }
      ]
    }
  }
}

Authorizations

Authorization
string
header
required

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

Query Parameters

workspaceId
string<uuid>
required

Workspace ID

Minimum string length: 1
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
enum<string>

Time series granularity: hour, day, or month

Available options:
hour,
day,
month
metrics
enum<string>[]

Specific metrics to return (JSON array)

Available options:
summary,
timeSeries,
endedReasons,
topLocations,
topCalls,
geoDistribution,
callThemes,
sentimentDistribution
timezone
string

IANA timezone for date calculations

Required string length: 2 - 64
status
string[]

Filter by call status (JSON array)

Minimum string length: 1
callType
string[]

Filter by call type: inbound, outbound, web (JSON array)

Minimum string length: 1

Response

Analytics data

success
enum<boolean>
required
Available options:
true,
false
data
object
required