---
title: "Apply a bulk action to prompts"
method: POST
path: "/api/security_ai_assistant/prompts/_bulk_action"
tags: ["Security AI Assistant API"]
---

# Apply a bulk action to prompts

`POST /api/security_ai_assistant/prompts/_bulk_action`

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/security_ai_assistant/prompts/_bulk_action</span></div>

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

Apply a bulk action to multiple prompts. The bulk action is applied to all prompts that match the filter or to the list of prompts by their IDs. This action allows for bulk create, update, or delete operations.

## Request body

- object
  - `create` SecurityAIAssistantAPIPromptCreateProps[] — List of prompts to be created.
    - `categories` string[] — List of categories for the prompt.
    - `color` string — The color associated with the prompt.
    - `consumer` string — The consumer associated with the prompt.
    - `content` string, required — The content of the prompt.
    - `isDefault` boolean — Whether this prompt should be the default.
    - `isNewConversationDefault` boolean — Whether this prompt should be the default for new conversations.
    - `name` string, required — The name of the prompt.
    - `promptType` 'system' | 'quick', required — Type of the prompt (either system or quick).
  - `delete` object — Criteria for deleting prompts in bulk.
    - `ids` string[] — Array of IDs to apply the action to.
    - `query` string — Query to filter the bulk action.
  - `update` SecurityAIAssistantAPIPromptUpdateProps[] — List of prompts to be updated.
    - `categories` string[] — The updated categories for the prompt.
    - `color` string — The updated color associated with the prompt.
    - `consumer` string — The updated consumer for the prompt.
    - `content` string — The updated content for the prompt.
    - `id` string, required — The ID of the prompt to update.
    - `isDefault` boolean — Whether this prompt should be the default.
    - `isNewConversationDefault` boolean — Whether the prompt should be the default for new conversations.

## Response `200`

Indicates a successful call with the results of the bulk action.

- SecurityAIAssistantAPIPromptsBulkCrudActionResponse
  - `attributes` object, required
    - `errors` SecurityAIAssistantAPINormalizedPromptError[]
      - `err_code` string — A code representing the error type.
      - `message` string, required — A message describing the error encountered.
      - `prompts` SecurityAIAssistantAPIPromptDetailsInError[], required — List of prompts that encountered errors.
        - `id` string, required — The ID of the prompt that encountered an error.
        - `name` string — The name of the prompt that encountered an error.
      - `status_code` integer, required — The HTTP status code associated with the error.
    - `results` SecurityAIAssistantAPIPromptsBulkCrudActionResults, required
      - `created` SecurityAIAssistantAPIPromptResponse[], required — List of prompts that were created.
        - `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, required — 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, nonempty, required — 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, required — The name of the prompt.
        - `namespace` string — Kibana space where the prompt is located.
        - `promptType` 'system' | 'quick', required — Type of the prompt (either system or quick).
        - `timestamp` string, nonempty — 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` SecurityAIAssistantAPIUser[] — List of users associated with the prompt.
          - `id` string — User id.
          - `name` string — User name.
      - `deleted` string[], required — List of IDs of prompts that were deleted.
      - `skipped` SecurityAIAssistantAPIPromptsBulkActionSkipResult[], required — List of prompts that were skipped.
        - `id` string, required — The ID of the prompt that was skipped.
        - `name` string — The name of the prompt that was skipped.
        - `skip_reason` 'PROMPT_FIELD_NOT_MODIFIED', required — Reason why a prompt was skipped during the bulk action.
      - `updated` SecurityAIAssistantAPIPromptResponse[], required — List of prompts that were updated.
        - `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, required — 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, nonempty, required — 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, required — The name of the prompt.
        - `namespace` string — Kibana space where the prompt is located.
        - `promptType` 'system' | 'quick', required — Type of the prompt (either system or quick).
        - `timestamp` string, nonempty — 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` SecurityAIAssistantAPIUser[] — List of users associated with the prompt.
          - `id` string — User id.
          - `name` string — User name.
    - `summary` SecurityAIAssistantAPIBulkCrudActionSummary, required
      - `failed` integer, required — The number of failed actions.
      - `skipped` integer, required — The number of skipped actions.
      - `succeeded` integer, required — The number of successfully performed actions.
      - `total` integer, required — The total number of actions attempted.
  - `message` string — A message describing the result of the bulk action.
  - `prompts_count` integer — The number of prompts processed in the bulk action.
  - `status_code` integer — The HTTP status code of the response.
  - `success` boolean — Indicates if the bulk action was successful.

## Other responses

- `400` — Bad Request response.

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/revisions/deb2e8b751e7/schema)
