Update conversation

edit

Update an existing Elastic AI Assistant conversation by conversation ID.

Request URL

edit

PUT <kibana host>:<port>/api/security_ai_assistant/current_user/conversations/{id}

Request body

edit
Name Type Description Required

id

String

Conversation ID to update.

Yes

title

String

Conversation title. If you set it to "New chat", the AI will generate a title.

No

apiConfig

apiConfig object

Conversation configuration.

No

messages

messages object

Array of conversation messages.

No

replacements

Key, Value(String, String)

List of the fields with anonymization.

No

apiConfig object

edit
Name Type Description Required

connectorId

String

Kibana connector ID.

No

actionTypeId

String

Kibana connector action type ID.

No

defaultSystemPromptId

String

Default system prompt ID.

No

model

String

LLM specific model.

No

messages object

edit
Name Type Description Required

role

String

Message role. Can be "user", "assistant", or "system".

Yes

content

String

Message content to send to LLM.

Yes

isError

Boolean

Define if the message is an error message instead of an LLM response.

No

timestamp

String

Timestamp when the message was sent.

No

Example requests

edit

Example 1

Updates an existing Elastic AI Assistant conversation with an id value of a696901d-efff-4871-acbe-8123af841932

PUT api/security_ai_assistant/current_user/conversations/a696901d-efff-4871-acbe-8123af841932
{
  "id": "a696901d-efff-4871-acbe-8123af841932",
  "title": "The conversation title.",
  "messages": [
    {
      "content": "test content",
      "role": "user",
      "isError": false,
      "timestamp": "2019-12-13T16:40:33.400Z"
    }
  ],
  "apiConfig": {
    "actionTypeId": ".gen-ai",
    "connectorId": "86ab-471c-a00b-25b7e20c2d12",
    "defaultSystemPromptId": "Default",
    "model": "gpt-4o"
  }
}

Response code

edit

200 Indicates a successful call.

Response payload

edit

A JSON conversation object with a unique id.

Example 1

Conversation response payload:

{
  "timestamp": "2024-08-02T07:19:08.124Z",
  "createdAt": "2024-08-02T07:19:08.124Z",
  "users": [
    {
      "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0",
      "name": "elastic"
    }
  ],
  "title": "The conversation title.",
  "category": "assistant",
  "apiConfig": {
    "connectorId": "86ab-471c-a00b-25b7e20c2d12",
    "actionTypeId": ".gen-ai",
    "defaultSystemPromptId": "Default",
    "model": "gpt-4o"
  },
  "isDefault": true,
  "messages": [
    {
      "timestamp": "2019-12-13T16:40:33.400Z",
      "content": "test content",
      "role": "user"
    }
  ],
  "updatedAt": "2024-08-02T07:39:45.129Z",
  "replacements": {},
  "namespace": "default",
  "id": "a696901d-efff-4871-acbe-8123af841932"
}