Apply a bulk action to prompts

POST /api/security_ai_assistant/prompts/_bulk_action

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.

application/json

Body

  • create array[object]

    List of prompts to be created.

    Hide create attributes Show create attributes object
    • categories array[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.

    • Whether this prompt should be the default for new conversations.

    • name string Required

      The name of the prompt.

    • promptType string Required

      The type of the prompt.

      Values are system or quick.

  • delete object

    Criteria for deleting prompts in bulk.

    Hide delete attributes Show delete attributes object
    • ids array[string]

      Array of IDs to apply the action to.

      At least 1 element.

    • query string

      Query to filter the bulk action.

  • update array[object]

    List of prompts to be updated.

    Hide update attributes Show update attributes object
    • categories array[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.

    • Whether the prompt should be the default for new conversations.

Responses

  • 200 application/json

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

    Hide response attributes Show response attributes object
    • attributes object Required
      Hide attributes attributes Show attributes attributes object
      • errors array[object]
        Hide errors attributes Show errors attributes object
        • err_code string

          A code representing the error type.

        • message string Required

          A message describing the error encountered.

        • prompts array[object] Required

          List of prompts that encountered errors.

          Hide prompts attributes Show prompts attributes object
          • 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 object Required
        Hide results attributes Show results attributes object
        • created array[object] Required

          List of prompts that were created.

          Hide created attributes Show created attributes object
          • categories array[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.

          • The timestamp of when the prompt was created.

          • The user who created the prompt.

          • id string(nonempty) Required

            The ID of the anonymization field.

            Minimum length is 1.

          • isDefault boolean

            Whether this prompt is the default.

          • Whether this prompt is the default for new conversations.

          • name string Required

            The name of the prompt.

          • Kibana space where the prompt is located.

          • promptType string Required

            The type of the prompt.

            Values are system or quick.

          • timestamp string(nonempty)

            Timestamp when the anonymization field was initially created.

            Minimum length is 1.

          • The timestamp of when the prompt was last updated.

          • The user who last updated the prompt.

          • users array[object]

            List of users associated with the prompt.

            Could be any string, not necessarily a UUID.

            Hide users attributes Show users attributes object
        • deleted array[string] Required

          List of IDs of prompts that were deleted.

        • skipped array[object] Required

          List of prompts that were skipped.

          Hide skipped attributes Show skipped attributes object
          • id string Required

            The ID of the prompt that was skipped.

          • name string

            The name of the prompt that was skipped.

          • skip_reason string Required

            The reason for skipping the prompt.

            Value is PROMPT_FIELD_NOT_MODIFIED.

        • updated array[object] Required

          List of prompts that were updated.

          Hide updated attributes Show updated attributes object
          • categories array[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.

          • The timestamp of when the prompt was created.

          • The user who created the prompt.

          • id string(nonempty) Required

            The ID of the anonymization field.

            Minimum length is 1.

          • isDefault boolean

            Whether this prompt is the default.

          • Whether this prompt is the default for new conversations.

          • name string Required

            The name of the prompt.

          • Kibana space where the prompt is located.

          • promptType string Required

            The type of the prompt.

            Values are system or quick.

          • timestamp string(nonempty)

            Timestamp when the anonymization field was initially created.

            Minimum length is 1.

          • The timestamp of when the prompt was last updated.

          • The user who last updated the prompt.

          • users array[object]

            List of users associated with the prompt.

            Could be any string, not necessarily a UUID.

            Hide users attributes Show users attributes object
      • summary object Required
        Hide summary attributes Show summary attributes object
        • 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.

    • The number of prompts processed in the bulk action.

    • The HTTP status code of the response.

    • success boolean

      Indicates if the bulk action was successful.

  • 400 application/json

    Indicates a generic error due to a bad request.

    Hide response attributes Show response attributes object
POST /api/security_ai_assistant/prompts/_bulk_action
curl \
 --request POST 'https://localhost:5601/api/security_ai_assistant/prompts/_bulk_action' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"create":[{"name":"New Security Prompt","content":"Please verify the security settings.","promptType":"system"}],"delete":{"ids":["prompt1","prompt2"]},"update":[{"id":"prompt123","content":"Updated content for security prompt."}]}'
Request example
{
  "create": [
    {
      "name": "New Security Prompt",
      "content": "Please verify the security settings.",
      "promptType": "system"
    }
  ],
  "delete": {
    "ids": [
      "prompt1",
      "prompt2"
    ]
  },
  "update": [
    {
      "id": "prompt123",
      "content": "Updated content for security prompt."
    }
  ]
}
Response examples (200)
{
  "message": "Bulk action completed successfully.",
  "success": true,
  "attributes": {
    "errors": [],
    "results": {
      "created": [
        {
          "id": "prompt6",
          "name": "New Security Prompt",
          "content": "Please verify the security settings.",
          "promptType": "system"
        }
      ],
      "deleted": [
        "prompt2",
        "prompt3"
      ],
      "skipped": [
        {
          "id": "prompt4",
          "name": "Security Prompt",
          "skip_reason": "PROMPT_FIELD_NOT_MODIFIED"
        }
      ],
      "updated": [
        {
          "id": "prompt1",
          "name": "Security Prompt",
          "content": "Updated security settings prompt",
          "promptType": "system"
        }
      ]
    },
    "summary": {
      "total": 5,
      "failed": 0,
      "skipped": 1,
      "succeeded": 4
    }
  },
  "status_code": 200,
  "prompts_count": 5
}