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

# Rollback a test session



## OpenAPI

````yaml https://megastream25-api.closebot.com/swagger/v1/swagger.json post /bot/{botId}/testSession/{leadId}/rollback
openapi: 3.0.1
info:
  title: CloseBot API
  version: v1
servers:
  - url: https://api.closebot.com
    description: CloseBot API Endpoint
security:
  - Key: []
paths:
  /bot/{botId}/testSession/{leadId}/rollback:
    post:
      tags:
        - BotTesting
      summary: Rollback a test session
      parameters:
        - name: leadId
          in: path
          description: ''
          required: true
          style: simple
          schema:
            type: string
        - name: botId
          in: path
          required: true
          style: simple
          schema:
            type: string
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BotTestingRollbackInput'
          text/json:
            schema:
              $ref: '#/components/schemas/BotTestingRollbackInput'
          application/*+json:
            schema:
              $ref: '#/components/schemas/BotTestingRollbackInput'
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/BotTestingRollbackOutput'
            application/json:
              schema:
                $ref: '#/components/schemas/BotTestingRollbackOutput'
            text/json:
              schema:
                $ref: '#/components/schemas/BotTestingRollbackOutput'
components:
  schemas:
    BotTestingRollbackInput:
      type: object
      properties:
        messageId:
          type: string
          description: >-
            The ID of the first message to delete. All subsequent messages will
            also be deleted.
          nullable: true
      additionalProperties: false
    BotTestingRollbackOutput:
      type: object
      properties:
        deletedMessageIds:
          type: array
          items:
            type: string
          description: The IDs of the deleted messages
          nullable: true
        deletedActionIds:
          type: array
          items:
            type: string
          description: The IDs of the deleted actions
          nullable: true
      additionalProperties: false
  securitySchemes:
    Key:
      type: apiKey
      description: CloseBot API Key Authorization
      name: X-CB-KEY
      in: header

````