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

# Get Interaction Analytics

> Understand what happened in a specific conversation with AI-powered analysis. See sentiment shifts, detect frustration, identify commercial intent, and get actionable insights.

**⚠️ Requires Growth+ plan or higher**

**Two modes available:**

- **simple mode**: Get just the numbers—sentiment scores, frustration levels, and key metrics. Perfect for dashboards and quick checks. No rate limiting.
- **insights mode** (default): Dive deeper with detailed keywords, insights, and AI-generated suggestions for improvement. Rate limited based on your plan's `maxAnalysesPerHour`.

Returns 404 if the conversation doesn't exist or hasn't been analyzed yet.



## OpenAPI

````yaml https://www.greenflash.ai/api/openapi get /interactions/{interactionId}/analytics
openapi: 3.1.0
info:
  title: Greenflash API Reference
  version: 1.0.0
  description: >-
    Greenflash endpoints for capturing interactions, managing prompts, and
    identifying users.
servers:
  - url: https://www.greenflash.ai/api/v1
    description: Greenflash API v1
security: []
tags:
  - name: Interactions
    description: Capture interactions between users and AI
  - name: Business Events
    description: Capture business events
  - name: Analytics
    description: Understand chat and agentic interactions analyses
  - name: Inbox
    description: Review flagged conversations
  - name: Segments
    description: Manage user segments
  - name: Prompts
    description: Manage prompts
  - name: Chat
    description: Stream chat and agentic conversations
  - name: Models
    description: Manage AI models
  - name: Products
    description: Manage products
  - name: Users
    description: Manage users
  - name: Organizations
    description: Manage organizations
paths:
  /interactions/{interactionId}/analytics:
    get:
      tags:
        - Analytics
        - Interactions
      summary: Get Interaction Analytics
      description: >-
        Understand what happened in a specific conversation with AI-powered
        analysis. See sentiment shifts, detect frustration, identify commercial
        intent, and get actionable insights.


        **⚠️ Requires Growth+ plan or higher**


        **Two modes available:**


        - **simple mode**: Get just the numbers—sentiment scores, frustration
        levels, and key metrics. Perfect for dashboards and quick checks. No
        rate limiting.

        - **insights mode** (default): Dive deeper with detailed keywords,
        insights, and AI-generated suggestions for improvement. Rate limited
        based on your plan's `maxAnalysesPerHour`.


        Returns 404 if the conversation doesn't exist or hasn't been analyzed
        yet.
      parameters:
        - schema:
            type: string
            format: uuid
            description: The interaction ID to get analytics for
          required: true
          description: The interaction ID to get analytics for
          name: interactionId
          in: path
        - schema:
            type: string
            enum:
              - simple
              - insights
            default: insights
            description: >-
              Analysis mode: "simple" returns only numeric aggregates (no rate
              limiting), "insights" includes topics, keywords, and
              recommendations (rate limited per tenant plan).
          required: false
          description: >-
            Analysis mode: "simple" returns only numeric aggregates (no rate
            limiting), "insights" includes topics, keywords, and recommendations
            (rate limited per tenant plan).
          name: mode
          in: query
      responses:
        '200':
          description: Interaction analytics retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetInteractionAnalysisResponse'
        '404':
          description: Interaction not found or not analyzed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for get interaction analytics operations.
        '429':
          description: Rate limit exceeded (insights mode only)
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for get interaction analytics operations.
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for get interaction analytics operations.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Greenflash from 'greenflash';


            const client = new Greenflash({
              apiKey: process.env['GREENFLASH_API_KEY'], // This is the default and can be omitted
            });


            const getInteractionAnalyticsResponse = await
            client.interactions.getInteractionAnalytics(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            );


            console.log(getInteractionAnalyticsResponse.averageUserSentiment);
        - lang: Python
          source: >-
            import os

            from greenflash import Greenflash


            client = Greenflash(
                api_key=os.environ.get("GREENFLASH_API_KEY"),  # This is the default and can be omitted
            )

            get_interaction_analytics_response =
            client.interactions.get_interaction_analytics(
                interaction_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )

            print(get_interaction_analytics_response.average_user_sentiment)
components:
  schemas:
    GetInteractionAnalysisResponse:
      type: object
      properties:
        messageCount:
          type: number
          description: Number of messages in the interaction.
        summary:
          type: string
          description: Summary of the interaction.
        topic:
          type: string
          description: Main topic discussed.
        conversationQualityIndex:
          type:
            - number
            - 'null'
          description: Quality index score for the interaction.
        averageUserSentiment:
          type: object
          properties:
            label:
              type: string
            score:
              type: number
          required:
            - label
            - score
          description: Average sentiment across user messages.
        changeInUserSentiment:
          type: object
          properties:
            label:
              type: string
            score:
              type: number
          required:
            - label
            - score
          description: How sentiment changed during the interaction.
        mostCommonUserEmotion:
          type: string
          description: Most common emotion expressed by user.
        frustration:
          type: object
          properties:
            score:
              type: number
            label:
              type: string
          required:
            - score
            - label
          description: Frustration level detected.
        struggle:
          type: object
          properties:
            score:
              type: number
            label:
              type: string
          required:
            - score
            - label
          description: Struggle level detected.
        commercialIntent:
          type: object
          properties:
            score:
              type: number
            primarySignal:
              type: string
          required:
            - score
            - primarySignal
          description: Commercial intent detected.
        rating:
          type:
            - number
            - 'null'
          description: User rating for this interaction.
        keywords:
          type: array
          items:
            type: string
          description: Keywords extracted (insights mode only).
      required:
        - messageCount
        - summary
        - topic
        - conversationQualityIndex
        - averageUserSentiment
        - changeInUserSentiment
        - mostCommonUserEmotion
        - frustration
        - struggle
        - commercialIntent
        - rating
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````