---
type: api
title: Delete a conversation
description: Delete an existing conversation using the conversation ID. This endpoint allows users to permanently delete a conversation.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-deleteconversation
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-deleteconversation
products:
  - Kibana
---

# Delete a conversation

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

## Paths

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

#### Path parameters

- `id` (string · format: nonempty · min length: 1) — required
  The conversation's `id` value.
  Example: `abc123`

## Description

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

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Responses

#### `200`

Indicates a successful call. The conversation was deleted successfully.

`application/json`

- `apiConfig` (object)
  - `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` (object)
  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 · format: nonempty · min length: 1)
  A string that does not contain only whitespace characters.
- `messages` (object[])
  The conversation messages.
  - `content` (string)
    Message content.
  - `id` (string · format: nonempty · min length: 1)
    A string that does not contain only whitespace characters.
  - `isError` (boolean)
    Is error message.
  - `metadata` (object)
    Message metadata
    - `contentReferences` (map string to oneOf)
      A union of all content reference types
    - `interruptResumeValue` (union oneOf)
      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 oneOf)
      Union of the interrupt values
      - **{ options }**
        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)
      - **{ placeholder }**
        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 · format: nonempty · min length: 1)
    A string that represents a timestamp in ISO 8601 format and does not contain only whitespace characters.
  - `traceData` (object)
    Trace Data
    - `traceId` (string)
      Could be any string, not necessarily a UUID
    - `transactionId` (string)
      Could be any string, not necessarily a UUID
  - `user` (object)
    Could be any string, not necessarily a UUID.
    - `id` (string)
      User id.
    - `name` (string)
      User name.
- `namespace` (string)
  Kibana space
- `replacements` (map string to string)
  Replacements object used to anonymize/deanonymize messages
- `timestamp` (string · format: nonempty · min length: 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
}
```

