---
type: api
title: Update a conversation
description: Update an existing conversation using the conversation ID. This endpoint allows users to modify the details of an existing conversation.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-updateconversation
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-updateconversation
products:
  - Kibana
---

# Update a conversation

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

## Paths

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

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

#### Path Parameters

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

## Description

Update an existing conversation using the conversation ID. This endpoint allows users to modify the details of an existing conversation.

## Request Body

`application/json`

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

## Responses

#### `200`

Indicates a successful call. The conversation was updated 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.
  Same fields as `messages`
- `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 PUT 'http://localhost:5601/api/security_ai_assistant/current_user/conversations/abc123' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"title":"Updated Security Discussion","category":"insights","messages":[{"content":"Resolved.","role":"assistant","timestamp":"2023-10-31T12:30:00Z"}],"apiConfig":{"connectorId":"54321","actionTypeId":"09876"},"replacements":{},"excludeFromLastConversationStorage":true}'
```

## Request Examples

#### Update conversation

```json
{
  "apiConfig": {
    "actionTypeId": "09876",
    "connectorId": "54321"
  },
  "category": "insights",
  "excludeFromLastConversationStorage": true,
  "messages": [
    {
      "content": "The issue was resolved.",
      "role": "assistant",
      "timestamp": "2023-10-31T12:30:00Z"
    }
  ],
  "replacements": {},
  "title": "Updated Security Discussion"
}
```

## Response Examples

#### Update conversation response200

```json
{
  "apiConfig": {
    "actionTypeId": "09876",
    "connectorId": "54321"
  },
  "category": "insights",
  "createdAt": "2023-10-31T12:01:00Z",
  "createdBy": {
    "id": "user1",
    "name": "John Doe"
  },
  "excludeFromLastConversationStorage": true,
  "id": "abc123",
  "messages": [
    {
      "content": "The issue was resolved.",
      "role": "assistant",
      "timestamp": "2023-10-31T12:30:00Z"
    }
  ],
  "namespace": "default",
  "replacements": {},
  "title": "Updated Security Discussion",
  "updatedAt": "2023-10-31T12:31:00Z",
  "users": [
    {
      "id": "user1",
      "name": "John Doe"
    }
  ]
}
```

#### Update conversation response400

```json
{
  "error": "Bad Request",
  "message": "Missing required field: title",
  "statusCode": 400
}
```

