# Delete a conversation

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Delete a local conversation. The conversation and its items can no longer be accessed through these endpoints.

```text
DELETE https://token.moi.matrixorigin.cn/v1/conversations/{conversation_id}
```

## Before you begin

1. Prepare a [personal access token](../../../../guides/billing/credentials.md#personal-access-token) with Genesis access.
2. Use the credential used to [Create a conversation](create-conversation.md), and choose a local conversation that has not been deleted or bound to an upstream model.

## Request example

Replace `$GENESIS_ACCESS_TOKEN` and `$CONVERSATION_ID` with your personal access token and the selected conversation ID.

```bash
curl -X DELETE "https://token.moi.matrixorigin.cn/v1/conversations/$CONVERSATION_ID" \
  -H "Authorization: Bearer $GENESIS_ACCESS_TOKEN"
```

## Path parameters

::::{div} mo-api-parameter-table

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `conversation_id` | string | Yes | The `id` returned when creating the conversation. |

::::

## Successful response

A successful request confirms deletion; the conversation and its items are no longer accessible.

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "id": "$CONVERSATION_ID",
  "object": "conversation.deleted",
  "deleted": true
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | Identifier of the deleted resource. |
| `object` | string | Deletion result type. |
| `deleted` | boolean | `true` when deletion succeeds. |

:::::
::::::
:::::::

## Error response

The request returns `404` when the resource is missing, deleted, or inaccessible to the current credential.

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "error": {
    "message": "conversation not found",
    "type": "conversation_not_found",
    "code": "conversation_not_found"
  }
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `error` | object | Error details. |
| `error.message` | string | Error description. |
| `error.type` | string | Error type. |
| `error.code` | string | Error code. |

:::::
::::::
:::::::
