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 'http://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}]}'
Request example
{
"create": [
{
"allowed": true,
"anonymized": false,
"field": "host.name"
},
{
"allowed": false,
"anonymized": true,
"field": "user.name"
}
],
"delete": {
"ids": [
"field5",
"field6"
],
"query": "field: host.name"
},
"update": [
{
"allowed": true,
"anonymized": false,
"id": "field8"
},
{
"allowed": false,
"anonymized": true,
"id": "field9"
}
]
}
Response examples (200)
{
"anonymization_fields_count": 4,
"attributes": {
"results": {
"created": [
{
"allowed": false,
"anonymized": true,
"createdAt": "2023-10-31T12:00:00Z",
"createdBy": "user1",
"field": "host.name",
"id": "field2",
"namespace": "default",
"timestamp": "2023-10-31T12:00:00Z",
"updatedAt": "2023-10-31T12:00:00Z",
"updatedBy": "user1"
}
],
"deleted": [
"field3"
],
"skipped": [
{
"id": "field4",
"name": "user.name",
"skip_reason": "ANONYMIZATION_FIELD_NOT_MODIFIED"
}
],
"updated": [
{
"allowed": true,
"anonymized": false,
"createdAt": "2023-10-31T12:00:00Z",
"createdBy": "user1",
"field": "url.domain",
"id": "field8",
"namespace": "default",
"timestamp": "2023-10-31T12:00:00Z",
"updatedAt": "2023-10-31T12:00:00Z",
"updatedBy": "user1"
}
]
},
"summary": {
"failed": 0,
"skipped": 1,
"succeeded": 3,
"total": 4
}
},
"message": "Bulk action completed successfully",
"status_code": 200,
"success": true
}
Response examples (400)
{
"error": "Bad Request",
"message": "Invalid request body",
"statusCode": 400
}