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

# Get Call Statistics

> Get call statistics for a time period.

Statistics include:
- Total calls
- Success rate
- Average duration
- Failed calls

Can be filtered by specific agent.



## OpenAPI

````yaml https://api.mrassistant.ai/openapi.json get /analytics/tenants/{tenant_id}/calls
openapi: 3.1.0
info:
  title: Backend - Multilingual Voice Agent System
  description: FastAPI backend for multilingual voice agents with tool use
  version: 1.0.0
servers: []
security: []
paths:
  /analytics/tenants/{tenant_id}/calls:
    get:
      tags:
        - analytics
      summary: Get Call Statistics
      description: |-
        Get call statistics for a time period.

        Statistics include:
        - Total calls
        - Success rate
        - Average duration
        - Failed calls

        Can be filtered by specific agent.
      operationId: get_call_statistics_analytics_tenants__tenant_id__calls_get
      parameters:
        - name: tenant_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Tenant Id
        - name: hours
          in: query
          required: false
          schema:
            type: integer
            maximum: 168
            minimum: 1
            description: Time period in hours (1-168)
            default: 24
            title: Hours
          description: Time period in hours (1-168)
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: Filter by specific agent
            title: Agent Id
          description: Filter by specific agent
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallStatistics'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CallStatistics:
      properties:
        tenant_id:
          type: string
          title: Tenant Id
        period:
          additionalProperties: true
          type: object
          title: Period
        total_calls:
          type: integer
          title: Total Calls
        completed_calls:
          type: integer
          title: Completed Calls
        failed_calls:
          type: integer
          title: Failed Calls
        success_rate:
          type: number
          title: Success Rate
        avg_duration_seconds:
          type: number
          title: Avg Duration Seconds
        total_duration_minutes:
          type: number
          title: Total Duration Minutes
        quota:
          anyOf:
            - $ref: '#/components/schemas/QuotaInfo'
            - type: 'null'
          description: Quota and remaining calls info
      type: object
      required:
        - tenant_id
        - period
        - total_calls
        - completed_calls
        - failed_calls
        - success_rate
        - avg_duration_seconds
        - total_duration_minutes
      title: CallStatistics
      description: Call statistics for a period.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    QuotaInfo:
      properties:
        tenant_id:
          type: string
          title: Tenant Id
        monthly_call_limit:
          type: integer
          title: Monthly Call Limit
          description: Maximum calls allowed per month
        calls_used_this_month:
          type: integer
          title: Calls Used This Month
          description: Calls made this month
        calls_remaining:
          type: integer
          title: Calls Remaining
          description: Calls remaining this month
        calls_usage_percentage:
          type: number
          title: Calls Usage Percentage
          description: Percentage of monthly call quota used
        max_concurrent_calls:
          type: integer
          title: Max Concurrent Calls
          description: Maximum concurrent calls allowed
        current_active_calls:
          type: integer
          title: Current Active Calls
          description: Currently active calls
        concurrent_calls_remaining:
          type: integer
          title: Concurrent Calls Remaining
          description: Available concurrent call slots
        concurrent_usage_percentage:
          type: number
          title: Concurrent Usage Percentage
          description: Percentage of concurrent capacity used
        total_minutes_used:
          type: number
          title: Total Minutes Used
          description: Total minutes used all-time
        quota_exceeded:
          type: boolean
          title: Quota Exceeded
          description: Whether quota has been exceeded
        status:
          type: string
          title: Status
          description: Tenant status (active, blocked, etc.)
      type: object
      required:
        - tenant_id
        - monthly_call_limit
        - calls_used_this_month
        - calls_remaining
        - calls_usage_percentage
        - max_concurrent_calls
        - current_active_calls
        - concurrent_calls_remaining
        - concurrent_usage_percentage
        - total_minutes_used
        - quota_exceeded
        - status
      title: QuotaInfo
      description: Tenant quota and usage information.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````