---
type: api
title: Delete a conversation
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-deleteconversation
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-deleteconversation
products:
  - Kibana
---

# Delete a conversation

- Server: `https://{kibana_url}`

## Paths

- `DELETE` `/api/security_ai_assistant/current_user/conversations/{id}`
- `DELETE` `/s/{space_id}/api/security_ai_assistant/current_user/conversations/{id}`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/authentication#basicauth)

#### Path Parameters

- `id` (string · min: 1)
  The conversation's `id` value.

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Delete an existing conversation using the conversation ID. This endpoint allows users to permanently delete a conversation.

## Responses

#### `200`

Indicates a successful call. The conversation was deleted successfully.

`application/json`

- `apiConfig` ({})
  - `actionTypeId` (string)
    Action type ID
  - `connectorId` (string)
    Connector ID
  - `defaultSystemPromptId` (string)
    Default system prompt ID
  - `model` (string)
    Model
  - `provider` (enum)
    Provider
    Values: `OpenAI`, `Azure OpenAI`, `Other`
- `category` (enum)
  The conversation category.
  Values: `assistant`, `insights`
- `createdAt` (string)
  The time conversation was created.
- `createdBy` ({})
  Could be any string, not necessarily a UUID.
  - `id` (string)
    User id.
  - `name` (string)
    User name.
- `excludeFromLastConversationStorage` (boolean)
  Exclude from last conversation storage.
- `id` (string · min: 1)
  A string that does not contain only whitespace characters.
- `messages` ([] object)
  The conversation messages.
  - `content` (string)
    Message content.
  - `id` (string · min: 1)
    A string that does not contain only whitespace characters.
  - `isError` (boolean)
    Is error message.
  - `metadata` ({})
    Message metadata
    - `contentReferences` (object)
      A union of all content reference types
    - `interruptResumeValue` (union)
      Union of the interrupt resume values
      - **SelectOptionInterruptResumeValue**
        A request approval resume schema
        - `type` (enum)
          The type of interrupt
          Values: `SELECT_OPTION`, `INPUT_TEXT`
        - `value` (string)
          The value of the selected option to resume the graph execution with
      - **InputTextInterruptResumeValue**
        A resume value for input text
        - `type` (enum)
          The type of interrupt
          Values: `SELECT_OPTION`, `INPUT_TEXT`
        - `value` (string)
          Text value used to resume the graph execution with.
    - `interruptValue` (union)
      Union of the interrupt values
      - **SelectOptionInterruptValue**
        Interrupt that requests user to select one of the provided options
        - `expired` (boolean)
          Whether the interrupt has expired and can no longer be resumed.
        - `threadId` (string)
          Thread ID of the graph execution that produced this message.
        - `type` (enum)
          The type of interrupt
          Values: `SELECT_OPTION`, `INPUT_TEXT`
        - `description` (string)
          Description of action required
        - `options` ([] object)
          List of actions to choose from
          - `buttonColor` (enum)
            Values: `text`, `accent`, `accentSecondary`, `primary`, `success`, `warning`, `danger`, `neutral`, `risk`
          - `label` (string)
          - `value` (string)
      - **InputTextInterruptValue**
        Interrupt that requests user to provide text input
        - `expired` (boolean)
          Whether the interrupt has expired and can no longer be resumed.
        - `threadId` (string)
          Thread ID of the graph execution that produced this message.
        - `type` (enum)
          The type of interrupt
          Values: `SELECT_OPTION`, `INPUT_TEXT`
        - `description` (string)
          Description of action required
        - `placeholder` (string)
          Placeholder text for the input field
  - `reader` (object)
  - `refusal` (string)
    Refusal reason returned by the model when content is filtered.
  - `role` (enum)
    Message role.
    Values: `system`, `user`, `assistant`
  - `timestamp` (string · min: 1)
    A string that represents a timestamp in ISO 8601 format and does not contain only whitespace characters.
  - `traceData` ({})
    Trace Data
    - `traceId` (string)
      Could be any string, not necessarily a UUID
    - `transactionId` (string)
      Could be any string, not necessarily a UUID
  - `user` ({})
    Could be any string, not necessarily a UUID.
    - `id` (string)
      User id.
    - `name` (string)
      User name.
- `namespace` (string)
  Kibana space
- `replacements` (object)
  Replacements object used to anonymize/deanonymize messages
- `timestamp` (string · min: 1)
  A string that represents a timestamp in ISO 8601 format and does not contain only whitespace characters.
- `title` (string)
  The conversation title.
- `updatedAt` (string)
  The last time conversation was updated.
- `users` ([] object)
  - `id` (string)
    User id.
  - `name` (string)
    User name.
#### `400`

Bad Request response.

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (number)
## Code Examples

#### curl

```curl
curl \
 --request DELETE 'http://localhost:5601/api/security_ai_assistant/current_user/conversations/abc123' \
 --header "Authorization: $API_KEY"
```

## Response Examples

#### Delete conversation response200

```json
{
  "apiConfig": {
    "actionTypeId": "67890",
    "connectorId": "12345"
  },
  "category": "assistant",
  "createdAt": "2023-10-31T12:01:00Z",
  "createdBy": {
    "id": "user1",
    "name": "John Doe"
  },
  "excludeFromLastConversationStorage": false,
  "id": "abc123",
  "messages": [
    {
      "content": "The conversation has been deleted.",
      "role": "system",
      "timestamp": "2023-10-31T12:35:00Z"
    }
  ],
  "namespace": "default",
  "replacements": {},
  "title": "Deleted Security Discussion",
  "updatedAt": "2023-10-31T12:01:00Z",
  "users": [
    {
      "id": "user1",
      "name": "John Doe"
    }
  ]
}
```

#### Delete conversation response400

```json
{
  "error": "Bad Request",
  "message": "Invalid conversation ID",
  "statusCode": 400
}
```

