---
title: "Rollback a test session"
method: POST
path: "/bot/{botId}/testSession/{leadId}/rollback"
tags: ["BotTesting"]
---

# Rollback a test session

`POST /bot/{botId}/testSession/{leadId}/rollback`

## Path parameters

- `leadId` string, required
- `botId` string, required

## Request body

- BotTestingRollbackInput
  - `messageId` string, nullable — The ID of the first message to delete. All subsequent messages will also be deleted.

## Response `200`

Success

- BotTestingRollbackOutput
  - `deletedMessageIds` string[], nullable — The IDs of the deleted messages
  - `deletedActionIds` string[], nullable — The IDs of the deleted actions

---

[API](https://skmtc.dev/closebot/apis/closebot-api.md) · [All operations](https://skmtc.dev/closebot/apis/closebot-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/closebot/closebot-api/revisions/da5f5fb58534/schema)
