Apply a bulk action to anonymization fields
Spaces method and path for this operation:
post /s/{space_id}/api/security_ai_assistant/anonymization_fields/_bulk_action
Refer to Spaces for more information.
Apply a bulk action to multiple anonymization fields. The bulk action is applied to all anonymization fields that match the filter or to the list of anonymization fields by their IDs.
POST /api/security_ai_assistant/anonymization_fields/_bulk_action
curl \ --request POST 'https://localhost:5601/api/security_ai_assistant/anonymization_fields/_bulk_action' \ --header "Authorization: $API_KEY" \ --header "Content-Type: application/json" \ --data '{"create":[{"field":"host.name","allowed":true,"anonymized":false},{"field":"user.name","allowed":false,"anonymized":true}],"delete":{"ids":["field5","field6"],"query":"field: host.name"},"update":[{"id":"field8","allowed":true,"anonymized":false},{"id":"field9","allowed":false,"anonymized":true}]}' Request example
{ "create": [ { "field": "host.name", "allowed": true, "anonymized": false }, { "field": "user.name", "allowed": false, "anonymized": true } ], "delete": { "ids": [ "field5", "field6" ], "query": "field: host.name" }, "update": [ { "id": "field8", "allowed": true, "anonymized": false }, { "id": "field9", "allowed": false, "anonymized": true } ] } Response examples (200)
{ "message": "Bulk action completed successfully", "success": true, "attributes": { "results": { "created": [ { "id": "field2", "field": "host.name", "allowed": false, "createdAt": "2023-10-31T12:00:00Z", "createdBy": "user1", "namespace": "default", "timestamp": "2023-10-31T12:00:00Z", "updatedAt": "2023-10-31T12:00:00Z", "updatedBy": "user1", "anonymized": true } ], "deleted": [ "field3" ], "skipped": [ { "id": "field4", "name": "user.name", "skip_reason": "ANONYMIZATION_FIELD_NOT_MODIFIED" } ], "updated": [ { "id": "field8", "field": "url.domain", "allowed": true, "createdAt": "2023-10-31T12:00:00Z", "createdBy": "user1", "namespace": "default", "timestamp": "2023-10-31T12:00:00Z", "updatedAt": "2023-10-31T12:00:00Z", "updatedBy": "user1", "anonymized": false } ] }, "summary": { "total": 5, "failed": 1, "skipped": 1, "succeeded": 2 } }, "status_code": 200, "anonymization_fields_count": 5 } Response examples (400)
{ "error": "Bad Request", "message": "Invalid request body", "statusCode": 400 }