---
type: api
title: Get conversations
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-findconversations
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-findconversations
products:
  - Kibana
---

# Get conversations

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

## Paths

- `GET` `/api/security_ai_assistant/current_user/conversations/_find`
- `GET` `/s/{space_id}/api/security_ai_assistant/current_user/conversations/_find`

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

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Get a list of all conversations for the current user. This endpoint allows users to search, filter, sort, and paginate through their conversations.

## Query String Parameters

- `fields` ([] string)
  A list of fields to include in the response. If omitted, all fields are returned.
- `filter` (string)
  A search query to filter the conversations. Can match against titles, messages, or other conversation attributes.
- `sort_field` (enum)
  The field by which to sort the results. Valid fields are `created_at`, `title`, and `updated_at`.
  Values: `created_at`, `title`, `updated_at`
- `sort_order` (enum)
  The order in which to sort the results. Can be either `asc` for ascending or `desc` for descending.
  Values: `asc`, `desc`
- `page` (integer · min: 1 · default: 1)
  The page number of the results to retrieve. Default is 1.
- `per_page` (integer · min: 0 · default: 20)
  The number of conversations to return per page. Default is 20.
- `is_owner` (boolean · default: false)
  Whether to return conversations that the current user owns. If true, only conversations owned by the user are returned.

## Responses

#### `200`

Successful response, returns a paginated list of conversations matching the specified criteria.

`application/json`

- `data` ([] object)
  A list of conversations.
  - `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.
    - `content` (string)
      Message content.
    - `id` (string · min: 1)
      A string that does not contain only whitespace characters.
    - `isError` (boolean)
      Is error message.
    - `metadata` ({})
      Message metadata
      - `contentReferences` (object)
        A union of all content reference types
      - `interruptResumeValue` (union)
        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)
        Union of the interrupt values
        - **SelectOptionInterruptValue**
          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)
        - **InputTextInterruptValue**
          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 · min: 1)
      A string that represents a timestamp in ISO 8601 format and does not contain only whitespace characters.
    - `traceData` ({})
      Trace Data
      - `traceId` (string)
        Could be any string, not necessarily a UUID
      - `transactionId` (string)
        Could be any string, not necessarily a UUID
    - `user` ({})
      Could be any string, not necessarily a UUID.
      - `id` (string)
        User id.
      - `name` (string)
        User name.
  - `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.
- `page` (integer)
  The current page of the results.
- `perPage` (integer)
  The number of results returned per page.
- `total` (integer)
  The total number of conversations matching the filter criteria.
#### `400`

Bad Request response.

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (number)
## Code Examples

#### curl

```curl
curl \
 --request GET 'http://localhost:5601/api/security_ai_assistant/current_user/conversations/_find?page=1&per_page=20' \
 --header "Authorization: $API_KEY"
```

## Response Examples

#### Find conversations response200

```json
{
  "data": [
    {
      "category": "assistant",
      "createdAt": "2023-10-31T12:00:00Z",
      "createdBy": {
        "id": "user1",
        "name": "John Doe"
      },
      "excludeFromLastConversationStorage": false,
      "id": "conv-abc123",
      "messages": [],
      "namespace": "default",
      "replacements": {},
      "title": "Security Discussion",
      "updatedAt": "2023-10-31T12:05:00Z",
      "users": [
        {
          "id": "user1",
          "name": "John Doe"
        }
      ]
    }
  ],
  "page": 1,
  "perPage": 20,
  "total": 5
}
```

#### Find conversations response400

```json
{
  "error": "Bad Request",
  "message": "Invalid filter parameter.",
  "statusCode": 400
}
```

