> ## 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.

# Campaign Performance

> Returns performance statistics for all campaigns in the current account,
including send rates, reply rates, and qualification outcomes.
Requires `analytics:view` permission.




## OpenAPI

````yaml GET /api/analytics/campaigns
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/campaigns:
    get:
      tags:
        - Analytics
      summary: Campaign performance
      description: |
        Returns performance statistics for all campaigns in the current account,
        including send rates, reply rates, and qualification outcomes.
        Requires `analytics:view` permission.
      operationId: getCampaignPerformance
      responses:
        '200':
          description: Campaign performance stats
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CampaignPerformance'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    CampaignPerformance:
      type: object
      description: Performance statistics for a single campaign.
      properties:
        campaignId:
          type: string
          description: Campaign identifier
        campaignName:
          type: string
          description: Campaign display name
        channel:
          type: string
          enum:
            - whatsapp
            - telegram
            - email
          description: Messaging channel used
        status:
          type: string
          enum:
            - draft
            - scheduled
            - running
            - paused
            - completed
          description: Current campaign status
        totalLeads:
          type: integer
          description: Total leads targeted
        sent:
          type: integer
          description: Messages successfully sent
        replied:
          type: integer
          description: Leads that replied
        qualified:
          type: integer
          description: Leads that were qualified
        disqualified:
          type: integer
          description: Leads that were disqualified
        failed:
          type: integer
          description: Leads where outreach failed
        replyRate:
          type: number
          format: float
          description: Percentage of sent messages that received a reply
        qualificationRate:
          type: number
          format: float
          description: Percentage of replied leads that were qualified
      required:
        - campaignId
        - campaignName
        - channel
        - status
        - totalLeads
        - sent
        - replied
        - qualified
        - disqualified
        - failed
        - replyRate
        - qualificationRate
    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_*).

````