Apply a bulk action to prompts
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.
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
}