---
type: api
title: Get prompts
description: Get a list of all prompts based on optional filters, sorting, and pagination.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-findprompts
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-findprompts
products:
  - Kibana
---

# Get prompts

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

## Paths

- `GET` `/api/security_ai_assistant/prompts/_find`

- [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)

## Description

Get a list of all prompts based on optional filters, sorting, and pagination.

## Query String Parameters

- `fields` ([] string)
  List of specific fields to include in each returned prompt.
- `filter` (string)
  Search query string to filter prompts by matching fields.
- `sort_field` (enum)
  Field to sort prompts by.
  Values: `created_at`, `is_default`, `name`, `updated_at`
- `sort_order` (enum)
  Sort order, either asc or desc.
  Values: `asc`, `desc`
- `page` (integer · min: 1 · default: 1)
  Page number for pagination.
- `per_page` (integer · min: 0 · default: 20)
  Number of prompts per page.

## Responses

#### `200`

Successful response containing a list of prompts.

`application/json`

- `data` ([] object)
  The list of prompts returned based on the search query, sorting, and pagination.
  - `categories` ([] string)
    Categories associated with the prompt.
  - `color` (string)
    The color associated with the prompt.
  - `consumer` (string)
    The consumer that the prompt is associated with.
  - `content` (string)
    The content of the prompt.
  - `createdAt` (string)
    The timestamp of when the prompt was created.
  - `createdBy` (string)
    The user who created the prompt.
  - `id` (string · min: 1)
    A string that does not contain only whitespace characters.
  - `isDefault` (boolean)
    Whether this prompt is the default.
  - `isNewConversationDefault` (boolean)
    Whether this prompt is the default for new conversations.
  - `name` (string)
    The name of the prompt.
  - `namespace` (string)
    Kibana space where the prompt is located.
  - `promptType` (enum)
    Type of the prompt (either system or quick).
    Values: `system`, `quick`
  - `timestamp` (string · min: 1)
    A string that represents a timestamp in ISO 8601 format and does not contain only whitespace characters.
  - `updatedAt` (string)
    The timestamp of when the prompt was last updated.
  - `updatedBy` (string)
    The user who last updated the prompt.
  - `users` ([] object)
    List of users associated with the prompt.
    - `id` (string)
      User id.
    - `name` (string)
      User name.
- `page` (integer)
  Current page number.
- `perPage` (integer)
  Number of prompts per page.
- `total` (integer)
  Total number of prompts matching the query.
#### `400`

Bad request due to invalid parameters or malformed query.

`application/json`

- `error` (string)
  Short error message.
- `message` (string)
  Detailed description of the error.
- `statusCode` (number)
  HTTP status code for the error.
## Code Examples

#### curl

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

## Response Examples

#### Find prompts response200

```json
{
  "data": [
    {
      "categories": [
        "troubleshooting",
        "logging"
      ],
      "color": "#FF5733",
      "consumer": "security",
      "content": "If you encounter an error, check the logs and retry.",
      "createdAt": "2025-04-20T21:00:00Z",
      "createdBy": "jdoe",
      "id": "prompt-123",
      "isDefault": true,
      "isNewConversationDefault": false,
      "name": "Error Troubleshooting Prompt",
      "namespace": "default",
      "promptType": "standard",
      "timestamp": "2025-04-30T22:30:00Z",
      "updatedAt": "2025-04-30T22:45:00Z",
      "updatedBy": "jdoe",
      "users": [
        {
          "full_name": "John Doe",
          "username": "jdoe"
        }
      ]
    }
  ],
  "page": 1,
  "perPage": 20,
  "total": 142
}
```

#### Find prompts response400

```json
{
  "error": "Bad Request",
  "message": "Invalid sort order value provided.",
  "statusCode": 400
}
```

