Skip to main content
POST
/
threads
/
prune
Prune Threads
curl --request POST \
  --url https://api.example.com/threads/prune \
  --header 'Content-Type: application/json' \
  --data '
{
  "thread_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "strategy": "delete"
}
'
{
  "pruned_count": 123
}

Body

application/json

Payload for pruning threads.

thread_ids
string<uuid>[]
required

List of thread IDs to prune.

strategy
enum<string>
default:delete

The prune strategy. 'delete' removes threads entirely. 'keep_latest' prunes old checkpoints but keeps threads and their latest state.

For threads using DeltaChannel, 'keep_latest' retains the minimum set of ancestor checkpoints required to replay and reconstruct the latest delta channel state. These retained checkpoints retain only delta channel blobs, so they can no longer be used directly to fork the thread or time travel to those points.

Available options:
delete,
keep_latest

Response

Success

Response from pruning threads.

pruned_count
integer
required

Number of threads successfully pruned.