Create conversation
editCreate conversation
editCreate a new Elastic AI Assistant conversation.
Request URL
editPOST <kibana host>:<port>/api/security_ai_assistant/current_user/conversations
Request body
editName | Type | Description | Required |
---|---|---|---|
|
String |
Conversation title. If you set it to "New chat", the AI will generate a title. |
Yes |
|
String |
Can be "assistant", "insights", or not defined. |
No |
|
Boolean |
Define if conversation is a system conversation which cannot be deleted. Defaults to false. |
No |
|
Boolean |
Defines if conversation can appear as the latest conversation. |
No |
|
Conversation configuration. |
No |
|
|
Array of conversation messages. |
No |
|
|
Key, Value(String, String) |
List of the fields with anonymization. |
No |
apiConfig
object
editName | Type | Description | Required |
---|---|---|---|
|
String |
Kibana connector ID. |
Yes |
|
String |
Kibana connector action type ID. |
Yes |
|
String |
Default system prompt ID. |
Yes |
|
String |
Specific LLM name. |
No |
messages
object
editName | Type | Description | Required |
---|---|---|---|
|
String |
Message role. Can be "user", "assistant", or "system". |
Yes |
|
String |
Message content to send to LLM. |
Yes |
|
Boolean |
Define if the message is an error message instead of an LLM response. |
No |
|
String |
Timestamp when the message was sent. |
No |
Example requests
editExample 1
Creates a new conversation.
POST api/security_ai_assistant/current_user/conversations { "title": "The conversation title.", "category": "assistant", "messages": [ { "content": "test content", "role": "user", "isError": false, "timestamp": "2019-12-13T16:40:33.400Z", "traceData": { "traceId": "1234", "transactionId": "2" } } ], "apiConfig": { "actionTypeId": ".gen-ai", "connectorId": "86ab-471c-a00b-25b7e20c2d12", "defaultSystemPromptId": "Default", "model": "gpt-4o" }, "isDefault": false, "excludeFromLastConversationStorage": true, "replacements": { "field1": "914beb92-86ab-471c-a00b" } }
Response code
edit200
Indicates a successful call.
Response payload
editA JSON conversation object with a unique id
.
Example 1
Conversation response payload:
{ "id": "07805df2-6462-451a-b534-78da47873c42", "title": "The conversation title.", "category": "assistant", "timestamp": "2024-07-29T06:58:15.670Z", "updatedAt": "2024-07-29T06:58:15.670Z", "createdAt": "2024-07-29T06:58:15.670Z", "replacements": { "field1": "914beb92-86ab-471c-a00b" }, "users": [ { "name": "elastic" } ], "messages": [ { "content": "test content", "role": "user", "timestamp": "2019-12-13T16:40:33.400Z", "traceData": { "transactionId": "2", "traceId": "1234" } } ], "apiConfig": { "connectorId": "86ab-471c-a00b-25b7e20c2d12", "actionTypeId": ".gen-ai", "defaultSystemPromptId": "Default", "model": "gpt-4o" }, "isDefault": false, "excludeFromLastConversationStorage": true, "namespace": "default" }