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

# Workflow campaign A/B tests API

> Compare the agent versions of each A/B-tested agent node in a campaign: calls, completed calls, call time and journey outcomes per version.

> [!NOTE]
>
> Results are raw counts, worked out each time you call the endpoint. `journeys` counts finished journeys only, and is `null` for a node whose `sticky` is `false`, because one journey can then use several versions. See [A/B test agent versions](https://www.bolna.ai/docs/workflows/ab-testing.md#compare-the-versions) for how each number is counted.


## OpenAPI

````yaml GET /workflow-campaigns/{campaign_id}/ab-tests
openapi: 3.1.0
info:
  title: Bolna API
  description: >-
    Use and leverage Bolna Voice AI using APIs through HTTP requests from any
    language in your applications and workflows.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.bolna.ai
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: SIP trunks
    description: >-
      Bring-your-own-carrier SIP trunks, their gateways, carrier IPs and
      numbers.
paths:
  /workflow-campaigns/{campaign_id}/ab-tests:
    get:
      description: >-
        Compares the agent versions of every agent node with an A/B test
        (`config.version_split`) in the campaign's workflow version — calls,
        completed calls, call time and journey outcomes per version. Worked out
        on each request; all values are counts.
      parameters:
        - in: path
          name: campaign_id
          required: true
          schema:
            type: string
            format: uuid
          description: The unique `id` of the campaign
      responses:
        '200':
          description: Per-version results for each A/B-tested agent node
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowCampaignAbTests'
        '404':
          description: Campaign not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowError'
components:
  schemas:
    WorkflowCampaignAbTests:
      type: object
      required:
        - nodes
      properties:
        nodes:
          type: array
          description: >-
            Every agent node with an A/B test in the campaign's workflow
            version, in definition order. Empty when there are none.
          items:
            type: object
            properties:
              node_id:
                type: string
                example: n_call
              node_name:
                type: string
                description: Empty when the node has no name.
                example: Qualification call
              agent_id:
                type: string
                format: uuid
              sticky:
                type: boolean
                description: >-
                  The node's `version_split.sticky` setting. When `false`,
                  `journeys` is `null` on every result.
              arms:
                type: array
                description: >-
                  The configured split, in order. The first arm is A, the second
                  B, and so on.
                items:
                  type: object
                  properties:
                    agent_version_id:
                      type: string
                      description: The version id configured on the arm.
                    weight:
                      type: integer
                      description: The arm's share of calls, in percent.
              results:
                type: array
                description: >-
                  One row per arm and name of the version that ran. A deleted
                  version's calls run on the live version, so they appear as a
                  second row for the same arm under the live version's name.
                items:
                  type: object
                  properties:
                    agent_version_id:
                      type: string
                      description: >-
                        The arm's configured version id, matching an entry in
                        `arms`.
                    agent_version_name:
                      type: string
                      description: The name of the version that ran.
                    calls:
                      type: integer
                      description: Calls placed.
                    completed:
                      type: integer
                      description: Calls whose `call.status` is `completed`.
                    duration_s:
                      type: number
                      description: >-
                        Total time of the completed calls, in seconds. The
                        average call is `duration_s / completed`.
                    journeys:
                      type: object
                      nullable: true
                      description: >-
                        Journeys credited to the version of each contact's first
                        visit to this node, counted once each journey has
                        finished. A contact whose first visit placed no call,
                        for example a rejected dial, isn't counted, even if a
                        later visit called. A journey that stopped without
                        reaching an end node is settled with no outcome. `null`
                        when `sticky` is `false`.
                      properties:
                        settled:
                          type: integer
                          description: Journeys that have finished.
                        success:
                          type: integer
                        failure:
                          type: integer
                        neutral:
                          type: integer
      example:
        nodes:
          - node_id: n_call
            node_name: Qualification call
            agent_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
            sticky: true
            arms:
              - agent_version_id: 0b6e2c1a-7f3d-4e8a-9c21-5d4f6a7b8c90
                weight: 50
              - agent_version_id: 5e8f9a0b-1c2d-4e3f-8a4b-6c7d8e9f0a1b
                weight: 50
            results:
              - agent_version_id: 0b6e2c1a-7f3d-4e8a-9c21-5d4f6a7b8c90
                agent_version_name: v1
                calls: 1204
                completed: 731
                duration_s: 143280
                journeys:
                  settled: 1010
                  success: 286
                  failure: 552
                  neutral: 160
              - agent_version_id: 5e8f9a0b-1c2d-4e3f-8a4b-6c7d8e9f0a1b
                agent_version_name: v2-short-greeting
                calls: 1188
                completed: 779
                duration_s: 131040
                journeys:
                  settled: 996
                  success: 331
                  failure: 509
                  neutral: 149
    WorkflowError:
      type: object
      description: >-
        Error envelope returned by every workflow endpoint. `detail.code` is a
        stable machine-readable code; extra keys (such as `current_revision` on
        `revision_conflict`, `execution_id` on `duplicate_run`, or `issues` on
        `invalid_definition`) ride alongside it.
      required:
        - detail
      properties:
        detail:
          type: object
          additionalProperties: true
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code.
              example: revision_conflict
            message:
              type: string
              description: Human-readable explanation.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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