Skip to content
StudyFetch API

Chat Analytics

Get chat analytics for a specific component

OpenAPI specification
GET/api/v1/chat-analytics/component/{componentId}

Authentication

x-api-key

Request

curl --globoff --request GET \
  --url 'https://api.example.com/api/v1/chat-analytics/component/%3CcomponentId%3E' \
  --header 'x-api-key: <API_KEY>'

Replace credential and <field> placeholders with your own values. URL placeholders appear as %3Cfield%3E. Review the example values before sending your request.

Replace https://api.example.com with the API server URL.

Parameters

componentIdpath · string · required

Component ID

organizationIdquery · string

Organization ID to filter by

userIdquery · string

User ID to filter by

groupIdsquery · array

Group IDs to filter by

startDatequery · string

Start date for analysis

endDatequery · string

End date for analysis

modelKeyquery · string

AI model to use for analysis

Responses

200Component-specific chat analytics
{
  "type": "object",
  "properties": {
    "summary": {
      "description": "Analytics summary",
      "allOf": [
        {
          "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"
          ]
        }
      ]
    },
    "userStats": {
      "description": "User statistics",
      "type": "array",
      "items": {
        "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"
        ]
      }
    },
    "generatedAt": {
      "format": "date-time",
      "type": "string",
      "description": "Date when analytics were generated"
    }
  },
  "required": [
    "summary",
    "userStats",
    "generatedAt"
  ]
}