# Get campaign variation stats

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /campaign/get/variation-stats:
    get:
      summary: Get campaign variation stats
      deprecated: false
      description: >
        Returns variation-level performance statistics for each campaign step.


        This endpoint groups results by `step`, and under each step returns all

        variations that belong to that step. For each variation, the response
        includes

        delivery and engagement metrics such as sent count, open count, reply
        count,

        and positive reply count.


        Date filtering is optional:

        - If `start_date` and `end_date` are provided, stats are calculated only
        for that date range.

        - If `start_date` and `end_date` are omitted, the endpoint returns
        all-time stats.


        Notes:

        - `is_del` indicates whether the variation has been deleted.

        - A deleted variation may still appear in the response if historical
        data exists for it.

        - `is_active` indicates whether the variation is currently active.

        - `open` may be `0` if open tracking is unavailable or disabled.
      operationId: getCampaignVariationStats
      tags:
        - Campaign
        - Campaign Stats
      parameters:
        - name: workspace_id
          in: query
          description: Unique ID of the workspace that owns the campaign.
          required: true
          schema:
            type: string
            examples:
              - 6509f7691205283f2a79f98c
        - name: campaign_id
          in: query
          description: Unique ID of the campaign for which variation stats are requested.
          required: true
          schema:
            type: string
            examples:
              - 689c5190e2fdaa6ed31ec3af
        - name: start_date
          in: query
          description: >
            Start date for filtering stats, in `YYYY-MM-DD` format.


            When provided together with `end_date`, only stats within the
            specified

            date range are returned.


            If omitted, the response includes all-time data.
          required: false
          schema:
            type: string
            format: date
            examples:
              - '2026-03-01'
        - name: end_date
          in: query
          description: >
            End date for filtering stats, in `YYYY-MM-DD` format.


            When provided together with `start_date`, only stats within the
            specified

            date range are returned.


            If omitted, the response includes all-time data.
          required: false
          schema:
            type: string
            format: date
            examples:
              - '2026-03-31'
      responses:
        '200':
          description: Variation stats returned successfully.
          content:
            application/json:
              schema:
                type: array
                description: >-
                  List of campaign steps and their variation performance
                  statistics.
                items:
                  $ref: '#/components/schemas/VariationStepStats'
              examples:
                date_range_example:
                  summary: Example response with date range filter
                  value:
                    - step: 1
                      variations:
                        - variation: A
                          sent: 0
                          open: 0
                          reply: 0
                          pos_reply: 0
                          name: '-'
                          is_active: false
                          is_del: false
                        - variation: B
                          sent: 614
                          open: 0
                          reply: 27
                          pos_reply: 26
                          name: '-'
                          is_active: true
                          is_del: false
                    - step: 2
                      variations:
                        - variation: A
                          sent: 286
                          open: 0
                          reply: 20
                          pos_reply: 17
                          name: '-'
                          is_active: true
                          is_del: false
                        - variation: B
                          sent: 283
                          open: 0
                          reply: 14
                          pos_reply: 11
                          name: '-'
                          is_active: true
                          is_del: false
                    - step: 3
                      variations:
                        - variation: A
                          sent: 540
                          open: 0
                          reply: 9
                          pos_reply: 7
                          name: '-'
                          is_active: true
                          is_del: false
          headers: {}
          x-apidog-name: ''
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    examples:
                      - Invalid campaign_id or workspace_id
                x-apidog-orders:
                  - message
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: ''
      security: []
      x-apidog-folder: Campaign
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/929054/apis/api-32377894-run
components:
  schemas:
    VariationStepStats:
      type: object
      description: Statistics for all variations within a specific campaign step.
      properties:
        step:
          type: integer
          description: Step number in the campaign sequence.
          examples:
            - 1
        variations:
          type: array
          description: List of variations belonging to this step.
          items:
            $ref: '#/components/schemas/VariationStats'
      required:
        - step
        - variations
      x-apidog-orders:
        - step
        - variations
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    VariationStats:
      type: object
      description: Performance metrics for a single variation within a campaign step.
      properties:
        variation:
          type: string
          description: Variation label or identifier.
          examples:
            - A
        sent:
          type: integer
          description: Total number of emails sent for this variation.
          examples:
            - 614
        open:
          type: integer
          description: Total number of opens tracked for this variation.
          examples:
            - 0
        reply:
          type: integer
          description: Total number of replies received for this variation.
          examples:
            - 27
        pos_reply:
          type: integer
          description: Total number of positive replies received for this variation.
          examples:
            - 26
        name:
          type: string
          description: >-
            User-defined name of the variation. May be `-` if no custom name is
            set.
          examples:
            - '-'
        is_active:
          type: boolean
          description: Indicates whether the variation is currently active.
          examples:
            - true
        is_del:
          type: boolean
          description: Indicates whether the variation has been deleted.
          examples:
            - false
      required:
        - variation
        - sent
        - open
        - reply
        - pos_reply
        - name
        - is_active
        - is_del
      x-apidog-orders:
        - variation
        - sent
        - open
        - reply
        - pos_reply
        - name
        - is_active
        - is_del
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    ApiKeyAuth:
      type: apikey
      in: header
      name: x-api-key
      description: |
        API key issued in the PlusVibe dashboard. The server reads it
        from the `x-api-key` header and injects it into the request as
        the `api_key` query parameter, which is why you will see
        `api_key` referenced in validation errors.
    apiKey:
      type: apikey
      in: body
      name: api_key
      description: API key passed in request body
servers:
  - url: https://api.plusvibe.ai/api/v1
    description: Prod Env
security:
  - ApiKeyAuth: []
    x-apidog:
      schemeGroups:
        - id: uS5KiuC4wfZHK42AzOfA_
          schemeIds:
            - ApiKeyAuth
      required: true
      use:
        id: uS5KiuC4wfZHK42AzOfA_
      scopes:
        uS5KiuC4wfZHK42AzOfA_:
          ApiKeyAuth: []

```
