---
title: "Compact a conversation into a checkpoint"
method: POST
path: "/conversation/{conversationId}/compact"
tags: ["Conversation"]
---

# Compact a conversation into a checkpoint

`POST /conversation/{conversationId}/compact`

## Request

- Base URL: `https://api.chatbotkit.com/api/v1`
- URL: `https://api.chatbotkit.com/api/v1/conversation/{conversationId}/compact`
- Auth: HTTP bearer

## Path parameters

- `conversationId` string, required: The ID of the conversation to compact

## Response `200`

The conversation was compacted successfully

- object
  - `id` string, required: The ID of the created checkpoint message, or the conversation ID if there was nothing to compact
  - `text` string, required: The compacted text of the messages, or an empty string if there was nothing to compact
  - `usage` Usage, required: Usage information
    - `token` number, required: The tokens used in this exchange

## Other responses

- `default`: An error response

---

[API](https://skmtc.dev/chatbotkit/apis/cbk-api.md) · [All operations](https://skmtc.dev/chatbotkit/apis/cbk-api/llms.txt) · [OpenAPI document](https://skmtc.dev/chatbotkit/apis/cbk-api/revisions/13d250576136?raw)
