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

# Get chat analytics for a specific component



## OpenAPI

````yaml /openapi-components.json get /api/v1/chat-analytics/component/{componentId}
openapi: 3.0.0
info:
  title: StudyFetch API
  description: API documentation for StudyFetch
  version: '1.0'
  contact: {}
servers:
  - url: https://studyfetchapi.com
    description: Production API Server
security: []
tags: []
paths:
  /api/v1/chat-analytics/component/{componentId}:
    get:
      tags:
        - Chat Analytics
      summary: Get chat analytics for a specific component
      operationId: getComponentChatAnalytics
      parameters:
        - name: componentId
          required: true
          in: path
          description: Component ID
          schema:
            type: string
        - name: organizationId
          required: false
          in: query
          description: Organization ID to filter by
          schema:
            type: string
        - name: userId
          required: false
          in: query
          description: User ID to filter by
          schema:
            type: string
        - name: groupIds
          required: false
          in: query
          description: Group IDs to filter by
          schema:
            type: array
            items:
              type: string
        - name: startDate
          required: false
          in: query
          description: Start date for analysis
          schema:
            type: string
            format: date-time
        - name: endDate
          required: false
          in: query
          description: End date for analysis
          schema:
            type: string
            format: date-time
        - name: modelKey
          required: false
          in: query
          description: AI model to use for analysis
          schema:
            example: gpt-4o-mini
            type: string
      responses:
        '200':
          description: Component-specific chat analytics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatAnalyticsResponseDto'
      security:
        - x-api-key: []
components:
  schemas:
    ChatAnalyticsResponseDto:
      type: object
      properties:
        summary:
          description: Analytics summary
          allOf:
            - $ref: '#/components/schemas/ChatAnalyticsSummaryDto'
        userStats:
          description: User statistics
          type: array
          items:
            $ref: '#/components/schemas/UserChatStatsDto'
        generatedAt:
          format: date-time
          type: string
          description: Date when analytics were generated
      required:
        - summary
        - userStats
        - generatedAt
    ChatAnalyticsSummaryDto:
      type: object
      properties:
        summary:
          type: string
          description: Natural language summary of chat usage
        totalUsers:
          type: number
          description: Total unique users
        totalSessions:
          type: number
          description: Total chat sessions
        totalMessages:
          type: number
          description: Total messages
        topTopics:
          description: Top topics discussed
          type: array
          items:
            type: string
        averageMessagesPerUser:
          type: number
          description: Average messages per user
        engagement:
          type: object
          description: Engagement metrics
        overallAveragePromptingScore:
          type: number
          description: Overall average prompting score (1-4 scale)
        overallAverageResponsibilityScore:
          type: number
          description: Overall average responsibility score (1-4 scale)
        overallPromptingDistribution:
          type: object
          description: Overall prompting score distribution
        overallResponsibilityDistribution:
          type: object
          description: Overall responsibility score distribution
      required:
        - summary
        - totalUsers
        - totalSessions
        - totalMessages
        - topTopics
        - averageMessagesPerUser
        - engagement
    UserChatStatsDto:
      type: object
      properties:
        userId:
          type: string
          description: User ID
        email:
          type: string
          description: User email
        name:
          type: string
          description: User name
        totalMessages:
          type: number
          description: Total messages sent by user
        totalSessions:
          type: number
          description: Total chat sessions
        averageMessagesPerSession:
          type: number
          description: Average messages per session
        topTopics:
          description: Top topics discussed
          type: array
          items:
            type: string
        lastActive:
          format: date-time
          type: string
          description: Last active date
        firstActive:
          format: date-time
          type: string
          description: First active date
        averageSessionDuration:
          type: number
          description: Average session duration in minutes
        groupIds:
          description: Group IDs associated with the user
          type: array
          items:
            type: string
        averagePromptingScore:
          type: number
          description: Average prompting score (1-4 scale)
        averageResponsibilityScore:
          type: number
          description: Average responsibility score (1-4 scale)
        totalGradedMessages:
          type: number
          description: Total messages graded
        promptingDistribution:
          type: object
          description: Prompting score distribution
        responsibilityDistribution:
          type: object
          description: Responsibility score distribution
      required:
        - userId
        - totalMessages
        - totalSessions
        - averageMessagesPerSession
        - topTopics
        - lastActive
        - firstActive
        - averageSessionDuration
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API Key for server-to-server authentication. Resolves to the owning
        organization.

````