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

# Get main analytics

> Get main analytics data for a chatbot including conversations, resolutions, responses, and daily breakdown



## OpenAPI

````yaml get /api/v2/analytics
openapi: 3.0.1
info:
  title: LiveChatAI API v2
  description: >-
    LiveChatAI API v2 - Build powerful AI-powered customer support experiences.
    This API follows REST principles with predictable, resource-oriented URLs,
    JSON responses, and standard HTTP methods.
  version: 2.0.0
servers:
  - url: https://app.livechatai.com
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/v2/analytics:
    get:
      tags:
        - Analytics
      summary: Get main analytics
      description: >-
        Get main analytics data for a chatbot including conversations,
        resolutions, responses, and daily breakdown
      parameters:
        - in: query
          name: agentId
          required: true
          schema:
            type: string
            example: clx1234567890abcdef
          description: The ID of the agent/chatbot
        - in: query
          name: startDate
          required: true
          schema:
            type: string
            format: date
            example: '2024-01-01'
          description: Start date for analytics (ISO 8601 format)
        - in: query
          name: endDate
          required: true
          schema:
            type: string
            format: date
            example: '2024-01-31'
          description: End date for analytics (ISO 8601 format)
        - in: query
          name: timezone
          schema:
            type: string
            example: America/New_York
          description: Timezone for date calculations (defaults to system timezone)
      responses:
        '200':
          description: Successfully retrieved analytics data
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      currentPeriod:
                        type: object
                        properties:
                          totalConversationCount:
                            type: number
                            example: 150
                            description: Total number of conversations
                          openConversationCount:
                            type: number
                            example: 25
                            description: Number of open conversations
                          closedConversationCount:
                            type: number
                            example: 125
                            description: Number of closed conversations
                          totalResolutionCount:
                            type: number
                            example: 120
                            description: Total number of resolutions
                          agentJoinedConversationRate:
                            type: number
                            example: 15
                            description: Percentage of conversations where an agent joined
                          averageResolutionRate:
                            type: number
                            example: 80
                            description: Average resolution rate percentage
                          totalGoodResponse:
                            type: number
                            example: 95
                            description: Total number of positive responses
                          totalBadResponse:
                            type: number
                            example: 25
                            description: Total number of negative responses
                          goodResponseRate:
                            type: number
                            example: 79
                            description: Percentage of positive responses
                          badResponseRate:
                            type: number
                            example: 21
                            description: Percentage of negative responses
                          totalContactsCapture:
                            type: number
                            example: 45
                            description: Total number of contacts captured
                          averageChatDuration:
                            type: number
                            example: 325
                            description: Average chat duration in seconds
                          humanizedAverageChatDuration:
                            type: string
                            example: 5m 25s
                            description: Human-readable average chat duration
                          averageAIAgentCSATScore:
                            type: number
                            nullable: true
                            example: 4.5
                            description: >-
                              Average AI Agent CSAT score (1-5 scale), null if
                              no responses
                          totalAIAgentCSATResponses:
                            type: number
                            example: 32
                            description: Total number of AI Agent CSAT responses received
                          dailyData:
                            type: array
                            items:
                              type: object
                              properties:
                                date:
                                  type: string
                                  example: '2024-01-15'
                                  description: Date of the data point
                                total:
                                  type: number
                                  example: 10
                                  description: Total conversations for this day
                                aiResolved:
                                  type: number
                                  example: 8
                                  description: Number of AI-resolved conversations
                                humanInvolved:
                                  type: number
                                  example: 2
                                  description: >-
                                    Number of conversations with human
                                    involvement
                            description: Daily breakdown of conversation data
                          changes:
                            type: object
                            description: Percentage changes compared to previous period
                            properties:
                              totalConversationCount:
                                type: number
                                example: 10.5
                                description: Percentage change in total conversations
                              closedConversationCount:
                                type: number
                                nullable: true
                                example: 12.3
                                description: Percentage change in closed conversations
                              totalResolutionCount:
                                type: number
                                nullable: true
                                example: 8.3
                                description: Percentage change in resolutions
                              agentJoinedConversationRate:
                                type: number
                                nullable: true
                                example: -12.5
                                description: >-
                                  Percentage change in agent joined conversation
                                  rate
                              averageResolutionRate:
                                type: number
                                example: 5.2
                                description: Percentage change in resolution rate
                              goodResponseRate:
                                type: number
                                nullable: true
                                example: 8.7
                                description: Percentage change in positive response rate
                              badResponseRate:
                                type: number
                                nullable: true
                                example: -3.1
                                description: Percentage change in bad response rate
                              totalContactsCapture:
                                type: number
                                example: 15.8
                                description: Percentage change in contacts captured
                              averageChatDuration:
                                type: number
                                nullable: true
                                example: -3.5
                                description: Percentage change in average chat duration
                              averageAIAgentCSATScore:
                                type: number
                                nullable: true
                                example: 3.2
                                description: >-
                                  Percentage change in average AI Agent CSAT
                                  score
                      previousPeriod:
                        type: object
                        description: Previous period data for comparison
                        properties:
                          totalConversationCount:
                            type: number
                            example: 136
                            description: Total conversations in previous period
                          openConversationCount:
                            type: number
                            example: 20
                            description: Number of open conversations in previous period
                          closedConversationCount:
                            type: number
                            example: 111
                            description: Closed conversations in previous period
                          totalResolutionCount:
                            type: number
                            example: 105
                            description: Total number of resolutions in previous period
                          agentJoinedConversationRate:
                            type: number
                            example: 13
                            description: >-
                              Percentage of conversations where an agent joined
                              in previous period
                          averageResolutionRate:
                            type: number
                            example: 76
                            description: Resolution rate in previous period
                          totalGoodResponse:
                            type: number
                            example: 82
                            description: >-
                              Total number of positive responses in previous
                              period
                          totalBadResponse:
                            type: number
                            example: 30
                            description: >-
                              Total number of negative responses in previous
                              period
                          goodResponseRate:
                            type: number
                            example: 73
                            description: Positive response rate in previous period
                          badResponseRate:
                            type: number
                            example: 27
                            description: >-
                              Percentage of negative responses in previous
                              period
                          totalContactsCapture:
                            type: number
                            example: 39
                            description: >-
                              Total number of contacts captured in previous
                              period
                          averageChatDuration:
                            type: number
                            example: 337
                            description: >-
                              Average chat duration in seconds in previous
                              period
                          humanizedAverageChatDuration:
                            type: string
                            example: 5m 37s
                            description: >-
                              Human-readable average chat duration in previous
                              period
                          averageAIAgentCSATScore:
                            type: number
                            nullable: true
                            example: 4.3
                            description: >-
                              Average AI Agent CSAT score in previous period
                              (1-5 scale), null if no responses
                          totalAIAgentCSATResponses:
                            type: number
                            example: 28
                            description: >-
                              Total number of AI Agent CSAT responses in
                              previous period
        '400':
          description: Bad request - Missing or invalid parameters
        '401':
          description: Unauthorized - Invalid API token
        '403':
          description: Forbidden - API access not available for plan
        '404':
          description: Chatbot not found or access denied
        '500':
          description: Internal server error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````