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

# Close a conversation

> Delete a finished thread while keeping what the agent learned from it

## Example use case

A support ticket closes on the inbound support line, a discovery call ends on the sales agent, or an incident review wraps up on the team assistant. You want to clear the conversation from the active thread list while keeping everything the agent learned.

## Setup

Call [DELETE`/v2/agents/{agent_id}/threads/{thread_id}`](https://www.sapientpriors.com/docs/api-reference/v2/threads/delete-thread):

* Priors returns `202` with `"status": "deleted"`.
* The conversation disappears from [GET`/v2/agents/{agent_id}/threads`](https://www.sapientpriors.com/docs/api-reference/v2/threads/list-threads) and any pending unlearned observations queued on that thread are discarded.
* Every memory already learned from the thread and every file uploaded in it stays with the agent.

## Benefit with Priors

* **Clean conversation lists:** archive or remove closed chats without degrading long-term memory.
* **Persistent knowledge:** subsequent threads on the same agent continue answering from facts learned before the closed thread was deleted.

## What goes wrong

> [!WARNING]
>
> Deleting a thread does not make the agent forget what it learned there. If you deleted a thread expecting private or mistaken facts to disappear from future answers, those memories remain active in the agent. Deleting a thread while an `observe` job is still running on it also discards the unlearned portion.

## Recommendation

Delete threads to tidy conversation lists while preserving memory, waiting for any active `observe` job to reach `committed` first if you need those last facts kept. To erase what a thread taught the agent, list its turns via [GET`/v2/agents/{agent_id}/memories?thread_id={thread_id}`](https://www.sapientpriors.com/docs/api-reference/v2/memories/list-memories) and forget each turn before or after deleting the thread.

## Calls used

* Guides: [Threads](https://www.sapientpriors.com/docs/concepts/threads.md), [Memories](https://www.sapientpriors.com/docs/concepts/memories.md), [Your data](https://www.sapientpriors.com/docs/data.md)
* API reference: [Delete thread](https://www.sapientpriors.com/docs/api-reference/v2/threads/delete-thread.md), [List memories](https://www.sapientpriors.com/docs/api-reference/v2/memories/list-memories.md), [Forget a memory](https://www.sapientpriors.com/docs/api-reference/v2/memories/forget-a-memory.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.