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

> Get CSAT (Customer Satisfaction) analytics including average scores, total responses, individual feedback entries with pagination, and period-over-period comparison



## OpenAPI

````yaml get /api/v2/analytics/csat
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/csat:
    get:
      tags:
        - Analytics
      summary: Get CSAT analytics
      description: >-
        Get CSAT (Customer Satisfaction) analytics including average scores,
        total responses, individual feedback entries with pagination, and
        period-over-period comparison
      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)
        - in: query
          name: page
          schema:
            type: integer
            default: 1
            minimum: 1
            example: 1
          description: Page number for pagination (starts at 1)
        - in: query
          name: pageSize
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
            example: 10
          description: Number of items per page (max 100)
      responses:
        '200':
          description: Successfully retrieved CSAT analytics data
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      currentPeriod:
                        type: object
                        properties:
                          averageScore:
                            type: number
                            nullable: true
                            example: 4.2
                            description: Average CSAT score (1-5 scale)
                          totalResponses:
                            type: number
                            example: 45
                            description: Total number of CSAT responses
                          scores:
                            type: array
                            description: Paginated list of individual CSAT responses
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                  example: csat_abc123
                                score:
                                  type: number
                                  example: 5
                                  description: CSAT score (1-5)
                                comment:
                                  type: string
                                  nullable: true
                                  example: Great support experience!
                                  description: Optional free text feedback from customer
                                email:
                                  type: string
                                  nullable: true
                                  example: customer@example.com
                                name:
                                  type: string
                                  nullable: true
                                  example: John Doe
                                triggerReason:
                                  type: string
                                  enum:
                                    - AFTER_RESOLUTION
                                    - AFTER_INACTIVITY
                                    - AI_DRIVEN
                                  example: AFTER_RESOLUTION
                                  description: What triggered the CSAT survey
                                createdAt:
                                  type: string
                                  format: date-time
                                  example: '2024-01-15T10:30:00.000Z'
                      previousPeriod:
                        type: object
                        description: >-
                          Previous period data for comparison (same duration as
                          current period)
                        properties:
                          averageScore:
                            type: number
                            nullable: true
                            example: 3.8
                          totalResponses:
                            type: number
                            example: 38
                          scores:
                            type: array
                            items:
                              type: object
                            description: >-
                              Empty array (detailed scores only returned for
                              current period)
                      changes:
                        type: object
                        description: Percentage changes compared to previous period
                        properties:
                          averageScore:
                            type: number
                            nullable: true
                            example: 10.5
                            description: Percentage change in average score
                          totalResponses:
                            type: number
                            nullable: true
                            example: 18.4
                            description: Percentage change in total responses
                      metadata:
                        type: object
                        description: Pagination metadata
                        properties:
                          totalItemCount:
                            type: number
                            example: 45
                          totalPageCount:
                            type: number
                            example: 5
                          currentPage:
                            type: number
                            example: 1
                          prev:
                            type: number
                            nullable: true
                            example: null
                          next:
                            type: number
                            nullable: true
                            example: 2
                          pageSize:
                            type: number
                            example: 10
        '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

````