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

# Get Call Analytics

> Get detailed call analytics for your organization.

Returns comprehensive metrics and trends for the specified period.

<section aria-labelledby="call-analytics-overview">
  <h2 id="call-analytics-overview">Call Analytics Summary</h2>

  <p>
    Use this endpoint to monitor call volume, completion rate, failure rate, duration, and top-performing assistants across a selected reporting period.
  </p>

  <ul>
    <li>Power dashboards for operations, support, and revenue teams.</li>
    <li>Compare daily call trends across <code>1d</code>, <code>7d</code>, <code>30d</code>, and <code>90d</code> windows.</li>
    <li>Identify assistants that drive the most call volume or need quality review.</li>
  </ul>
</section>

<section aria-labelledby="call-analytics-api-behavior">
  <h2 id="call-analytics-api-behavior">How this endpoint behaves</h2>

  <p>
    Analytics aggregate calls for your organization over the selected <code>period</code>. Metrics include totals, completion and failure counts, duration, daily rollups, and top assistants.
  </p>

  <p>
    Pair this endpoint with list and detail call APIs when you need to drill down from a dashboard summary into individual call records.
  </p>
</section>

### Query Parameters

* `period` (string, optional, default: `7d`): The time period for the analysis.
  * Allowed values: `1d`, `7d`, `30d`, `90d`.

### Response

The response is a JSON object containing a comprehensive breakdown of call metrics.

```json Response theme={null}
{
  "total_calls": 150,
  "completed_calls": 135,
  "failed_calls": 10,
  "ongoing_calls": 5,
  "total_duration": 40500,
  "avg_duration": 300,
  "success_rate": 90,
  "daily_stats": {
    "2023-10-29": {
      "total": 70,
      "completed": 65,
      "failed": 5
    },
    "2023-10-30": {
      "total": 80,
      "completed": 70,
      "failed": 5
    }
  },
  "top_assistants": [
    {
      "assistant_id": 123,
      "assistant_name": "Support Bot",
      "calls": 100,
      "duration": 30000
    },
    {
      "assistant_id": 456,
      "assistant_name": "Sales Rep",
      "calls": 50,
      "duration": 10500
    }
  ]
}
```


## OpenAPI

````yaml GET /api/v1/calls/analytics
openapi: 3.1.0
info:
  title: Burki
  description: A system that uses AI to answer customer Calls.
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/calls/analytics:
    get:
      tags:
        - calls
      summary: Get Call Analytics
      description: |-
        Get detailed call analytics for your organization.

        Returns comprehensive metrics and trends for the specified period.
      operationId: get_call_analytics_api_v1_calls_analytics_get
      parameters:
        - name: period
          in: query
          required: false
          schema:
            type: string
            pattern: ^(1d|7d|30d|90d)$
            description: Analysis period
            default: 7d
            title: Period
          description: Analysis period
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallAnalyticsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CallAnalyticsResponse:
      properties:
        total_calls:
          type: integer
          title: Total Calls
        completed_calls:
          type: integer
          title: Completed Calls
        failed_calls:
          type: integer
          title: Failed Calls
        ongoing_calls:
          type: integer
          title: Ongoing Calls
        total_duration:
          type: number
          title: Total Duration
        avg_duration:
          type: number
          title: Avg Duration
        success_rate:
          type: number
          title: Success Rate
        daily_stats:
          additionalProperties:
            $ref: '#/components/schemas/DailyStat'
          type: object
          title: Daily Stats
        top_assistants:
          items:
            $ref: '#/components/schemas/AssistantStat'
          type: array
          title: Top Assistants
      type: object
      required:
        - total_calls
        - completed_calls
        - failed_calls
        - ongoing_calls
        - total_duration
        - avg_duration
        - success_rate
        - daily_stats
        - top_assistants
      title: CallAnalyticsResponse
      description: Response model for call analytics.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DailyStat:
      properties:
        total:
          type: integer
          title: Total
        completed:
          type: integer
          title: Completed
        failed:
          type: integer
          title: Failed
      type: object
      required:
        - total
        - completed
        - failed
      title: DailyStat
      description: Statistics for a single day.
    AssistantStat:
      properties:
        assistant_id:
          type: integer
          title: Assistant Id
        assistant_name:
          type: string
          title: Assistant Name
        calls:
          type: integer
          title: Calls
        duration:
          type: number
          title: Duration
      type: object
      required:
        - assistant_id
        - assistant_name
        - calls
        - duration
      title: AssistantStat
      description: Statistics for a single assistant.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````