---
title: "Delete Thread"
url: "https://docs.yoagent.dev/reference/rest-api/operations/deletethread"
---

# Delete Thread

DELETE

/v0/threads/{thread_id}

```sh
curl -s -X DELETE "https://api.yoagent.dev/v0/threads/thr_01je56wqswfmn9pgbc1wq8tjgq" \
  -H "Authorization: Bearer $YOAGENT_KEY"
```

```js
const response = await fetch("https://api.yoagent.dev/v0/threads/thr_01je56wqswfmn9pgbc1wq8tjgq", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.YOAGENT_KEY}`,
  },
});
if (!response.ok) throw new Error(await response.text());
```

```python
import os

import requests

response = requests.delete(
    "https://api.yoagent.dev/v0/threads/thr_01je56wqswfmn9pgbc1wq8tjgq",
    headers={"Authorization": f"Bearer {os.environ['YOAGENT_KEY']}"},
    timeout=60,
)
response.raise_for_status()
```

- api.yoagent.dev/v0/threads/{thread_id}

Delete a thread with all its messages, for good.

## Authorizations

- **[ApiKey](https://docs.yoagent.dev/reference/rest-api#apikey)**

## Parameters

### Path Parameters

**thread_id**

required

_Thread Id_

string

/^thr\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

## Responses

### 204

Successful Response

### default

An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: [Errors](https://docs.yoagent.dev/reference/conventions#errors).
