Skip to content
StudyFetch API

Usage Analyst

Get all chat messages from sessions for user or group

OpenAPI specification
GET/api/v1/usage-analyst/chat-messages

Authentication

x-api-key

Request

curl --globoff --request GET \
  --url 'https://api.example.com/api/v1/usage-analyst/chat-messages' \
  --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

userIdquery · string

User ID to get chat messages for

groupIdsquery · array

Array of group IDs to filter

Responses

200Chat messages retrieved successfully
{
  "type": "object",
  "properties": {
    "messages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "componentId": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant",
              "system"
            ]
          },
          "content": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "metadata": {
            "type": "object"
          }
        }
      }
    },
    "total": {
      "type": "number"
    },
    "sessionCount": {
      "type": "number"
    }
  }
}