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

# Get Test Results

> Returns detailed performance results for each variant in the A/B test,
including conversation counts, qualification rates, and statistical
significance indicators. Requires `ab_testing:view` permission.




## OpenAPI

````yaml GET /api/ab-tests/{id}/results
openapi: 3.1.0
info:
  title: Naturalead A/B Testing API
  version: 1.0.0
  description: >
    API for managing A/B tests in the Naturalead platform. A/B tests allow you

    to compare multiple AI agent configurations by splitting lead traffic across

    variants with configurable weights. 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:
  - BearerAuth: []
tags:
  - name: A/B Testing
    description: A/B test CRUD, status management, and results
paths:
  /api/ab-tests/{id}/results:
    get:
      tags:
        - A/B Testing
      summary: Get A/B test results
      description: |
        Returns detailed performance results for each variant in the A/B test,
        including conversation counts, qualification rates, and statistical
        significance indicators. Requires `ab_testing:view` permission.
      operationId: getAbTestResults
      parameters:
        - $ref: '#/components/parameters/AbTestId'
      responses:
        '200':
          description: A/B test results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AbTestResults'
        '404':
          description: A/B test not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: A/B test not found
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    AbTestId:
      name: id
      in: path
      required: true
      description: A/B test ID (MongoDB ObjectId)
      schema:
        type: string
        example: 665a1b2c3d4e5f6a7b8c9d0e
  schemas:
    AbTestResults:
      type: object
      description: Aggregated results for an A/B test.
      properties:
        testId:
          type: string
          description: A/B test identifier
        status:
          type: string
          enum:
            - draft
            - running
            - paused
            - completed
        totalConversations:
          type: integer
          description: Total conversations across all variants
        variants:
          type: array
          items:
            $ref: '#/components/schemas/VariantResult'
        winner:
          type: string
          nullable: true
          description: |
            Agent configuration ID of the winning variant, or null if no
            statistically significant winner has been determined
        confidenceLevel:
          type: number
          format: float
          nullable: true
          description: |
            Statistical confidence level (0-1) for the winner determination,
            or null if not yet computed
      required:
        - testId
        - status
        - totalConversations
        - variants
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    VariantResult:
      type: object
      description: Performance results for a single variant.
      properties:
        agentConfigId:
          type: string
          description: Agent configuration ID for this variant
        agentConfigName:
          type: string
          description: Agent configuration display name
        weight:
          type: number
          description: Traffic weight assigned to this variant
        totalConversations:
          type: integer
          description: Total conversations assigned to this variant
        qualified:
          type: integer
          description: Conversations resulting in qualification
        disqualified:
          type: integer
          description: Conversations resulting in disqualification
        qualificationRate:
          type: number
          format: float
          description: Percentage of conversations resulting in qualification
        avgMessagesPerConversation:
          type: number
          format: float
          description: Average messages exchanged per conversation
        avgConversationDuration:
          type: number
          format: float
          description: Average conversation duration in minutes
      required:
        - agentConfigId
        - weight
        - totalConversations
        - qualified
        - disqualified
        - qualificationRate
        - avgMessagesPerConversation
  responses:
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Failed to process request
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        Bearer token using an API key (format: nl_live_* or nl_test_*).

````