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

# End a persona split test

> Ends the bot's current persona split test immediately, snapshots
performance results, and promotes the winning persona to the bot default.
Idempotent if the test has already been finalized.



## OpenAPI

````yaml https://megastream25-api.closebot.com/swagger/v1/swagger.json post /bot/{id}/persona-split-test/end
openapi: 3.0.4
info:
  title: CloseBot API
  version: v1
servers:
  - url: https://api.closebot.com
    description: CloseBot API Endpoint
security:
  - Key: []
tags:
  - name: Account
  - name: AccountNotification
  - name: Agency
  - name: Analytics
  - name: Billing
  - name: Bot
  - name: BotMetric
  - name: BotSourceVariable
  - name: BotTemplate
  - name: BotTesting
  - name: Dashboard
  - name: Hierarchy
  - name: Lead
  - name: Leaderboard
  - name: Library
  - name: LiveDemo
  - name: Notification
  - name: Persona
  - name: Report
  - name: SmartFAQ
  - name: Source
  - name: SourceChannel
  - name: Webhook
paths:
  /bot/{id}/persona-split-test/end:
    post:
      tags:
        - Bot
      summary: End a persona split test
      description: >-
        Ends the bot's current persona split test immediately, snapshots

        performance results, and promotes the winning persona to the bot
        default.

        Idempotent if the test has already been finalized.
      parameters:
        - name: id
          in: path
          description: The bot ID.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/BotDto'
            application/json:
              schema:
                $ref: '#/components/schemas/BotDto'
            text/json:
              schema:
                $ref: '#/components/schemas/BotDto'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/EndPersonaSplitTestErrorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/EndPersonaSplitTestErrorResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/EndPersonaSplitTestErrorResponse'
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/EndPersonaSplitTestErrorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/EndPersonaSplitTestErrorResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/EndPersonaSplitTestErrorResponse'
components:
  schemas:
    BotDto:
      type: object
      properties:
        id:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        modifiedAt:
          type: string
          nullable: true
        modifiedBy:
          type: string
          nullable: true
        versions:
          type: array
          items:
            $ref: '#/components/schemas/BotVersionDto'
          nullable: true
        sources:
          type: array
          items:
            $ref: '#/components/schemas/BotSourceDto'
          nullable: true
        personaIds:
          type: array
          items:
            type: string
          nullable: true
        personaWeights:
          type: object
          additionalProperties:
            type: integer
            format: int32
          nullable: true
        favorited:
          type: boolean
        locked:
          type: boolean
        reschedulingEnabled:
          type: boolean
        category:
          type: string
          nullable: true
        folderId:
          type: string
          nullable: true
        followUpActive:
          type: boolean
        followUpSequences:
          type: array
          items:
            $ref: '#/components/schemas/FollowUpSequenceDto'
          nullable: true
        smartFollowUp:
          type: boolean
        followUpRepeat:
          type: boolean
        followUpVarianceMinutes:
          type: integer
          format: int32
        followUpExtraPrompt:
          type: string
          nullable: true
        personaSplitTest:
          $ref: '#/components/schemas/PersonaSplitTestDto'
        tools:
          type: array
          items:
            $ref: '#/components/schemas/BotToolDto'
          nullable: true
        followUpStates:
          type: array
          items:
            $ref: '#/components/schemas/FollowUpStateDto'
          nullable: true
        availableSplitTestMetrics:
          type: array
          items:
            $ref: '#/components/schemas/PersonaSplitTestMetricOptionDto'
          nullable: true
      additionalProperties: false
    EndPersonaSplitTestErrorResponse:
      required:
        - message
      type: object
      properties:
        message:
          type: string
          nullable: true
      additionalProperties: false
    BotVersionDto:
      type: object
      properties:
        version:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        published:
          type: boolean
        modifiedAt:
          type: string
          format: date-time
        modifiedBy:
          type: string
          nullable: true
      additionalProperties: false
    BotSourceDto:
      type: object
      properties:
        id:
          type: string
          nullable: true
        category:
          type: string
          nullable: true
        key:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        tags:
          type: array
          items:
            $ref: '#/components/schemas/ContactTag'
          nullable: true
        tagFilterConfig:
          $ref: '#/components/schemas/TagFilterConfig'
        channelList:
          type: array
          items:
            type: string
          nullable: true
        channelRules:
          $ref: '#/components/schemas/ChannelRulesConfig'
        personaNameOverride:
          type: string
          nullable: true
        enabled:
          type: boolean
        flowVariableValues:
          type: object
          additionalProperties:
            type: string
          nullable: true
      additionalProperties: false
    FollowUpSequenceDto:
      type: object
      properties:
        order:
          type: integer
          format: int32
        duration:
          type: integer
          format: int32
        unit:
          type: string
          nullable: true
      additionalProperties: false
    PersonaSplitTestDto:
      type: object
      properties:
        startedAt:
          type: string
          format: date-time
          nullable: true
        endedAt:
          type: string
          format: date-time
          nullable: true
        personas:
          type: array
          items:
            $ref: '#/components/schemas/PersonaSplitTestPersonaDto'
          nullable: true
        id:
          type: string
          nullable: true
        isActive:
          type: boolean
        metric:
          type: string
          nullable: true
      additionalProperties: false
    BotToolDto:
      type: object
      properties:
        id:
          type: string
          nullable: true
        type:
          type: string
          nullable: true
        enabled:
          type: boolean
        options:
          $ref: '#/components/schemas/BotToolOptions'
      additionalProperties: false
    FollowUpStateDto:
      type: object
      properties:
        id:
          type: integer
          format: int32
        name:
          type: string
          nullable: true
        isDefault:
          type: boolean
        sequences:
          type: array
          items:
            $ref: '#/components/schemas/FollowUpSequenceDto'
          nullable: true
        repeatFinal:
          type: boolean
        extraPrompt:
          type: string
          nullable: true
        order:
          type: integer
          format: int32
      additionalProperties: false
    PersonaSplitTestMetricOptionDto:
      type: object
      properties:
        id:
          type: string
          nullable: true
        label:
          type: string
          nullable: true
        shortLabel:
          type: string
          nullable: true
      additionalProperties: false
    ContactTag:
      type: object
      properties:
        name:
          type: string
          nullable: true
        approveDeny:
          type: boolean
        id:
          type: string
          nullable: true
      additionalProperties: false
    TagFilterConfig:
      type: object
      properties:
        operator:
          type: string
          nullable: true
        groups:
          type: array
          items:
            $ref: '#/components/schemas/TagFilterGroup'
          nullable: true
      additionalProperties: false
    ChannelRulesConfig:
      type: object
      properties:
        channels:
          type: array
          items:
            $ref: '#/components/schemas/ChannelRuleSet'
          nullable: true
      additionalProperties: false
    PersonaSplitTestPersonaDto:
      type: object
      properties:
        personaId:
          type: string
          nullable: true
        weight:
          type: integer
          format: int32
        order:
          type: integer
          format: int32
        results:
          $ref: '#/components/schemas/BotPersonaSplitTestPersonaResults'
      additionalProperties: false
    BotToolOptions:
      type: object
      additionalProperties: false
    TagFilterGroup:
      type: object
      properties:
        operator:
          type: string
          nullable: true
        rules:
          type: array
          items:
            $ref: '#/components/schemas/TagFilterRule'
          nullable: true
      additionalProperties: false
    ChannelRuleSet:
      type: object
      properties:
        channel:
          type: string
          nullable: true
        type:
          type: string
          nullable: true
        rules:
          type: array
          items:
            $ref: '#/components/schemas/ChannelRule'
          nullable: true
      additionalProperties: false
    BotPersonaSplitTestPersonaResults:
      type: object
      properties:
        personaId:
          type: string
          nullable: true
        personaName:
          type: string
          nullable: true
        splitWeight:
          type: integer
          format: int32
        totalInstances:
          type: integer
          format: int32
        responseCount:
          type: integer
          format: int32
        averageMetric:
          type: number
          format: double
        sources:
          type: array
          items:
            $ref: '#/components/schemas/BotPersonaSplitTestPersonaSourceResult'
          nullable: true
        computedAt:
          type: string
          format: date-time
      additionalProperties: false
    TagFilterRule:
      type: object
      properties:
        tagName:
          type: string
          nullable: true
        tagId:
          type: string
          nullable: true
        condition:
          type: string
          nullable: true
      additionalProperties: false
    ChannelRule:
      type: object
      properties:
        operator:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
      additionalProperties: false
    BotPersonaSplitTestPersonaSourceResult:
      type: object
      properties:
        sourceId:
          type: string
          nullable: true
        sourceName:
          type: string
          nullable: true
        totalInstances:
          type: integer
          format: int32
        responseCount:
          type: integer
          format: int32
        averageMetric:
          type: number
          format: double
      additionalProperties: false
  securitySchemes:
    Key:
      type: apiKey
      description: CloseBot API Key Authorization
      name: X-CB-KEY
      in: header

````