Find conversations

edit

Retrieve a list of Elastic AI Assistant conversations for the current user.

Request URL

edit

GET <kibana host>:<port>/api/security_ai_assistant/current_user/conversations/_find

URL query parameters

edit
Name Type Description Required

page

Number

The page number to return. Defaults to 1.

No

per_page

Number

The number of items to return per page. Defaults to 10.

No

filter

String

The filter query to apply on the request.

No

sort_field

String

The field to sort the results by. Valid values are:

  • title
  • description
  • updated
  • created

No

sort_order

String

The order to sort the results in. Valid values are:

  • asc
  • desc

No

fields

String

Defines the fields of the document to return in the response.

No

Example requests

edit

Example 1

Get a list of the current user’s conversations.

GET api/security_ai_assistant/current_user/conversations/_find?page=1&per_page=100

Response code

edit

200 Indicates a successful call.

Response payload

edit

A JSON conversation object with a unique id.

Example 1

Conversation response payload:

{
  "perPage": 20,
  "page": 1,
  "total": 1,
  "data": [
    {
      "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"
    }
  ]
}