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

# Overview Stats

> Returns high-level analytics overview for the current account, including
total leads, conversations, qualification rates, and channel breakdowns.
Requires `analytics:view` permission.




## OpenAPI

````yaml GET /api/analytics/overview
openapi: 3.1.0
info:
  title: Naturalead Analytics API
  version: 1.0.0
  description: |
    API for retrieving analytics and reporting data in the Naturalead platform.
    Provides overview stats, funnel analysis, campaign performance, and daily
    breakdowns. All endpoints require API key authentication
    and are scoped to the caller's account.
servers:
  - url: '{baseUrl}'
    description: API server
    variables:
      baseUrl:
        default: http://localhost:3001
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Analytics
    description: Analytics and reporting endpoints
paths:
  /api/analytics/overview:
    get:
      tags:
        - Analytics
      summary: Overview stats
      description: |
        Returns high-level analytics overview for the current account, including
        total leads, conversations, qualification rates, and channel breakdowns.
        Requires `analytics:view` permission.
      operationId: getAnalyticsOverview
      parameters:
        - $ref: '#/components/parameters/Range'
      responses:
        '200':
          description: Analytics overview
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverviewStats'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    Range:
      name: range
      in: query
      required: false
      description: Time range for analytics data
      schema:
        type: string
        enum:
          - 7d
          - 30d
          - 90d
        default: 30d
  schemas:
    OverviewStats:
      type: object
      description: High-level analytics overview for the account.
      properties:
        totalLeads:
          type: integer
          description: Total number of leads in the account
        newLeads:
          type: integer
          description: Leads created within the selected range
        totalConversations:
          type: integer
          description: Total conversations started within the range
        activeConversations:
          type: integer
          description: Currently active conversations
        qualifiedLeads:
          type: integer
          description: Leads qualified within the range
        disqualifiedLeads:
          type: integer
          description: Leads disqualified within the range
        qualificationRate:
          type: number
          format: float
          description: Percentage of completed conversations resulting in qualification
        avgMessagesPerConversation:
          type: number
          format: float
          description: Average number of messages per conversation
        channelBreakdown:
          type: object
          description: Conversation counts by channel
          properties:
            whatsapp:
              type: integer
            telegram:
              type: integer
            email:
              type: integer
            sms:
              type: integer
      required:
        - totalLeads
        - newLeads
        - totalConversations
        - activeConversations
        - qualifiedLeads
        - disqualifiedLeads
        - qualificationRate
        - avgMessagesPerConversation
        - channelBreakdown
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  responses:
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Failed to process request
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: |
        API key for programmatic access. Keys use the format `nl_live_<64 hex>`
        or `nl_test_<64 hex>` and are scoped to an account's RBAC permissions.
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        Bearer token using an API key (format: nl_live_* or nl_test_*).

````