> ## 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 agent analytics

> Get agent performance analytics including conversation counts, response times, and messages per conversation



## OpenAPI

````yaml get /api/v2/analytics/agent
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/agent:
    get:
      tags:
        - Analytics
      summary: Get agent analytics
      description: >-
        Get agent performance analytics including conversation counts, response
        times, and messages per conversation
      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: userId
          schema:
            type: string
            example: user_1234567890
          description: Optional specific agent/user ID to filter analytics
        - 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 agent 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: 45
                            description: >-
                              Total number of conversations in the current
                              period
                          closedConversationCount:
                            type: number
                            example: 38
                            description: >-
                              Number of closed conversations in the current
                              period
                          agentResponseTime:
                            type: number
                            example: 1250
                            description: Average agent response time in seconds
                          avarageMessagesPerConversation:
                            type: number
                            example: 8.5
                            description: Average number of messages per conversation
                          averageAgentCSATScore:
                            type: number
                            nullable: true
                            example: 4.2
                            description: >-
                              Average human agent CSAT score (1-5 scale), null
                              if no responses
                          totalAgentCSATResponses:
                            type: number
                            example: 28
                            description: >-
                              Total number of human agent CSAT responses
                              received
                          changes:
                            type: object
                            description: Percentage changes compared to previous period
                            properties:
                              totalConversationCount:
                                type: number
                                example: 12.5
                                description: Percentage change in total conversations
                              closedConversationCount:
                                type: number
                                example: 8.3
                                description: Percentage change in closed conversations
                              agentResponseTime:
                                type: number
                                example: -5.2
                                description: >-
                                  Percentage change in response time (negative
                                  means faster)
                              avarageMessagesPerConversation:
                                type: number
                                nullable: true
                                example: 3.7
                                description: >-
                                  Percentage change in average messages per
                                  conversation
                              averageAgentCSATScore:
                                type: number
                                nullable: true
                                example: 4.1
                                description: Percentage change in average agent CSAT score
                      previousPeriod:
                        type: object
                        description: Previous period data for comparison
                        properties:
                          totalConversationCount:
                            type: number
                            example: 40
                            description: >-
                              Total number of conversations in the previous
                              period
                          closedConversationCount:
                            type: number
                            example: 35
                            description: >-
                              Number of closed conversations in the previous
                              period
                          agentResponseTime:
                            type: number
                            example: 1318
                            description: >-
                              Average agent response time in seconds in the
                              previous period
                          avarageMessagesPerConversation:
                            type: number
                            example: 8.2
                            description: >-
                              Average number of messages per conversation in the
                              previous period
                          averageAgentCSATScore:
                            type: number
                            nullable: true
                            example: 4
                            description: >-
                              Average human agent CSAT score in previous period
                              (1-5 scale), null if no responses
                          totalAgentCSATResponses:
                            type: number
                            example: 25
                            description: >-
                              Total number of human 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

````