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

# Get Agent Call Stats



## OpenAPI

````yaml https://originshq.b-cdn.net/openapi_sayna.json get /api/agents/{agent_id}/call_stats
openapi: 3.1.0
info:
  title: core
  version: 0.1.0
servers: []
security: []
paths:
  /api/agents/{agent_id}/call_stats:
    get:
      summary: Get Agent Call Stats
      operationId: get_agent_call_stats_api_agents__agent_id__call_stats_get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: integer
            title: Agent Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CallStatsInsert'
                title: >-
                  Response Get Agent Call Stats Api Agents  Agent Id  Call Stats
                  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CallStatsInsert:
      properties:
        call_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Call Id
        call_agent_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Call Agent Id
        stt_data:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Stt Data
          default: []
        llm_data:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Llm Data
          default: []
        tts_data:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Tts Data
          default: []
        call_transcription:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Call Transcription
          default: []
        call_recording_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Call Recording Url
        from_number:
          anyOf:
            - type: string
            - type: 'null'
          title: From Number
        to_number:
          anyOf:
            - type: string
            - type: 'null'
          title: To Number
        recording_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Recording Id
        call_context:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Call Context
        call_status:
          anyOf:
            - $ref: '#/components/schemas/CallStatusOptions'
            - type: 'null'
        call_duration:
          anyOf:
            - type: number
            - type: 'null'
          title: Call Duration
        billed_duration:
          anyOf:
            - type: number
            - type: 'null'
          title: Billed Duration
        initiation_time:
          anyOf:
            - type: string
            - type: 'null'
          title: Initiation Time
        answer_time:
          anyOf:
            - type: string
            - type: 'null'
          title: Answer Time
        end_time:
          anyOf:
            - type: string
            - type: 'null'
          title: End Time
        hangup_cause_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Hangup Cause Name
        hangup_source:
          anyOf:
            - type: string
            - type: 'null'
          title: Hangup Source
        call_direction:
          $ref: '#/components/schemas/CallDirectionOptions'
          default: inbound
        task_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Task Id
        call_state_changes:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Call State Changes
          default: []
        call_triggered:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Call Triggered
        call_quality:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Call Quality
        call_insights:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Call Insights
        call_timeline:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Call Timeline
        tool_data:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Tool Data
        audio_config:
          additionalProperties: true
          type: object
          title: Audio Config
        org_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Org Id
      type: object
      title: CallStatsInsert
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CallStatusOptions:
      type: string
      enum:
        - ANSWERED
        - FAILED
        - INITIATED
        - QUEUED
      title: CallStatusOptions
    CallDirectionOptions:
      type: string
      enum:
        - inbound
        - outbound
      title: CallDirectionOptions
    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

````