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

> ## Agent Instructions
> To search or read these docs, connect the Ringg docs MCP server at https://docs.ringg.ai/mcp (no key needed; tools search_ringg_ai and query_docs_filesystem_ringg_ai) instead of browsing pages one by one. Setup for each client: https://docs.ringg.ai/resources/mcp-server/docs-mcp-server/mcp-for-ai-assistants.md
> The dashboard labels agents "Assistants"; these docs say "agent". Both mean the same object, identified by agent_id.
> API base URL: https://prod-api.ringg.ai/ca/api/v0. Send the workspace API key in the X-API-KEY header, from server-side code only.
> Placing a call dials a real phone number and spends credits. Confirm the number with the user before calling.
> To act on a Ringg workspace (place calls, edit agents, read transcripts), use the separate Ringg workspace MCP server at https://mcp.ringg.ai/mcp: https://docs.ringg.ai/resources/mcp-server/workspace-mcp-server/overview.md

> Get web chat and WhatsApp session volume over time, sessions per channel, and engagement, resolution and goal metrics, filtered by date, agent or channel.

# Get Chat Analytics

export const RelatedTopics = ({items}) => <div className="not-prose mt-12">
    <div className="text-sm font-medium text-gray-500 dark:text-zinc-400 mb-3">Related topics</div>
    <div className="flex flex-col gap-2.5">
      {items.map(([title, href]) => <a key={href} href={href} className="flex items-center gap-2.5 text-sm text-gray-700 hover:text-gray-950 dark:text-zinc-300 dark:hover:text-white">
          <Icon icon="file-text" size={16} color="currentColor" />
          {title}
        </a>)}
    </div>
  </div>;

Covers chats only; the other analytics endpoints cover calls. The dashboard's Analytics page doesn't show chats.

## Notes

* `channel` takes chat channels such as `chat` or `whatsapp_meta_chat`, not the call channels.
* `engaged_turns` sets how many user messages make a session `engaged` (default `1`). `resolved` counts completed sessions.
* `goal_rate` uses each session's own version goal.

## Errors

* `401`: `X-API-KEY` is missing or invalid.

<RelatedTopics items={[["Analytics", "/documentation/monitor/analytics"], ["WhatsApp chats in Logs", "/documentation/monitor/logs#whatsapp-chats"]]} />


## OpenAPI

````yaml get /analytics/v4/chat-analytics
openapi: 3.0.0
info:
  title: Ringg AI API Documentation
  description: >-
    The Ringg AI REST API. Base URL https://prod-api.ringg.ai/ca/api/v0; send
    your workspace API key in the X-API-KEY header from server-side code only.
    Requests and responses are JSON.
  version: 2.0.0
  contact:
    name: Ringg AI support
    email: admin@ringg.ai
    url: https://docs.ringg.ai
servers:
  - url: https://prod-api.ringg.ai/ca/api/v0
security:
  - ApiKeyAuth: []
tags:
  - name: workspace
    description: Endpoints for managing your workspace.
  - name: agent
    description: Endpoints for managing agents.
  - name: calling
    description: Endpoints for making and managing calls.
  - name: campaign
    description: Endpoints for managing campaigns.
  - name: analytics
    description: >-
      Analytics v4 endpoints for call, agent, cohort and chat performance
      metrics.
  - name: termination
    description: Endpoints for terminating active calls using different methods.
  - name: knowledgebase
    description: Endpoints for managing knowledge bases.
paths:
  /analytics/v4/chat-analytics:
    get:
      tags:
        - analytics
      summary: Get Chat Analytics
      description: >-
        Returns chat and WhatsApp session volume over time, sessions per
        channel, and outcome metrics.
      operationId: getChatAnalytics
      parameters:
        - name: start_date
          in: query
          description: >-
            Start of the reporting window. Accepts `YYYY-MM-DD` or ISO-8601.
            Omit both dates for all time.
          required: false
          schema:
            type: string
            example: '2026-10-01'
        - name: end_date
          in: query
          description: >-
            End of the reporting window (inclusive). Accepts `YYYY-MM-DD` or
            ISO-8601.
          required: false
          schema:
            type: string
            example: '2026-10-15'
        - name: agent_id
          in: query
          description: Filter by one or more agent IDs (comma-separated).
          required: false
          schema:
            type: string
            example: 00000000-0000-4000-8000-0000000000a1
        - name: agent_version_id
          in: query
          description: Filter by one or more agent version IDs (comma-separated).
          required: false
          schema:
            type: string
            example: 00000000-0000-4000-8000-0000000000d1
        - name: channel
          in: query
          description: >-
            Filter by chat channel (comma-separated), for example `chat` or
            `whatsapp_meta_chat`.
          required: false
          schema:
            type: string
            example: whatsapp_meta_chat
        - name: engaged_turns
          in: query
          description: Minimum user turns for a session to count as engaged.
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: tz
          in: query
          description: >-
            IANA timezone used to bucket the time series (for example
            `Asia/Kolkata`). Bucket labels are returned in this timezone.
            Omitted or invalid values fall back to UTC.
          required: false
          schema:
            type: string
            example: Asia/Kolkata
      responses:
        '200':
          description: Chat analytics retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  volume:
                    type: object
                    properties:
                      total:
                        type: integer
                        description: Chat sessions in scope.
                      by_bucket:
                        type: array
                        items:
                          type: object
                          properties:
                            bucket:
                              type: string
                              description: >-
                                Time bucket label. Granularity is picked from
                                the date range: hour `YYYY-MM-DD HH:00:00`, day
                                `YYYY-MM-DD`, week (Monday) or month (first
                                day).
                            count:
                              type: integer
                              description: Sessions in the bucket.
                  channel_split:
                    type: object
                    description: Sessions per channel.
                    additionalProperties:
                      type: integer
                  outcomes:
                    type: object
                    properties:
                      initiated:
                        type: integer
                        description: Sessions started.
                      engaged:
                        type: integer
                        description: Sessions with at least `engaged_turns` user turns.
                      resolved:
                        type: integer
                        description: Completed sessions.
                      avg_session_seconds:
                        type: number
                        description: Average session length in seconds.
                      avg_turns:
                        type: number
                        description: Average turns (user + agent) per session.
                      goal_rate:
                        type: number
                        description: Goal rate (0-1).
                        nullable: true
                      positive_sentiment_share:
                        type: number
                        description: >-
                          Share of scored sessions with positive sentiment
                          (0-1).
                        nullable: true
              example:
                volume:
                  total: 20
                  by_bucket:
                    - bucket: '2026-10-15'
                      count: 20
                channel_split:
                  whatsapp_meta_chat: 14
                  chat: 6
                outcomes:
                  initiated: 20
                  engaged: 16
                  resolved: 12
                  avg_session_seconds: 184.2
                  avg_turns: 9.4
                  goal_rate: 0.5
                  positive_sentiment_share: 0.6
        '400':
          description: >-
            Bad Request - invalid filter value (for example an unknown `channel`
            or malformed ID).
          content:
            application/json:
              example:
                message: 'invalid channel(s): sms'
        '401':
          description: Unauthorized - Invalid or missing authentication.
        '500':
          description: Internal Server Error.
          content:
            application/json:
              example:
                message: Failed to fetch chat analytics!
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.