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

# Apply a bulk action to anonymization fields

`POST /api/security_ai_assistant/anonymization_fields/_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/anonymization_fields/_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 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.

## Request body

- object
  - `create` SecurityAIAssistantAPIAnonymizationFieldCreateProps[] — Array of anonymization fields to create.
    - `allowed` boolean — Whether this field is allowed to be sent to the model.
    - `anonymized` boolean — Whether this field should be anonymized.
    - `field` string, required — Name of the anonymization field to create.
  - `delete` object — Object containing the query to filter anonymization fields and/or an array of anonymization field IDs to delete.
    - `ids` string[] — Array of IDs to apply the action to.
    - `query` string — Query to filter the bulk action.
  - `update` SecurityAIAssistantAPIAnonymizationFieldUpdateProps[] — Array of anonymization fields to update.
    - `allowed` boolean — Whether this field is allowed to be sent to the model.
    - `anonymized` boolean — Whether this field should be anonymized.
    - `id` string, required — The ID of the anonymization field to update.

## Response `200`

Indicates a successful call.

- SecurityAIAssistantAPIAnonymizationFieldsBulkCrudActionResponse
  - `anonymization_fields_count` integer — Total number of anonymization fields processed.
  - `attributes` object, required
    - `errors` SecurityAIAssistantAPINormalizedAnonymizationFieldError[] — List of errors that occurred during the bulk operation.
      - `anonymization_fields` SecurityAIAssistantAPIAnonymizationFieldDetailsInError[], required — Array of anonymization fields that caused the error.
        - `id` string, required — The ID of the anonymization field.
        - `name` string — Name of the anonymization field.
      - `err_code` string — Error code indicating the type of failure.
      - `message` string, required — Error message.
      - `status_code` integer, required — Status code of the response.
    - `results` SecurityAIAssistantAPIAnonymizationFieldsBulkCrudActionResults, required
      - `created` SecurityAIAssistantAPIAnonymizationFieldResponse[], required — List of anonymization fields successfully created.
        - `allowed` boolean — Whether this field is allowed to be sent to the model.
        - `anonymized` boolean — Whether this field should be anonymized.
        - `createdAt` string — Timestamp of when the anonymization field was created.
        - `createdBy` string — Username of the person who created the anonymization field.
        - `field` string, required — Name of the anonymization field.
        - `id` string, nonempty, required — A string that does not contain only whitespace characters.
        - `namespace` string — Kibana space in which this anonymization field exists.
        - `timestamp` string, nonempty — A string that represents a timestamp in ISO 8601 format and does not contain only whitespace characters.
        - `updatedAt` string — Timestamp of the last update.
        - `updatedBy` string — Username of the person who last updated the field.
      - `deleted` string[], required
      - `skipped` SecurityAIAssistantAPIAnonymizationFieldsBulkActionSkipResult[], required — List of anonymization fields that were skipped during the operation.
        - `id` string, required — The ID of the anonymization field that was not modified.
        - `name` string — Name of the anonymization field that was not modified.
        - `skip_reason` 'ANONYMIZATION_FIELD_NOT_MODIFIED', required — Reason why the anonymization field was not modified.
      - `updated` SecurityAIAssistantAPIAnonymizationFieldResponse[], required — List of anonymization fields successfully updated.
        - `allowed` boolean — Whether this field is allowed to be sent to the model.
        - `anonymized` boolean — Whether this field should be anonymized.
        - `createdAt` string — Timestamp of when the anonymization field was created.
        - `createdBy` string — Username of the person who created the anonymization field.
        - `field` string, required — Name of the anonymization field.
        - `id` string, nonempty, required — A string that does not contain only whitespace characters.
        - `namespace` string — Kibana space in which this anonymization field exists.
        - `timestamp` string, nonempty — A string that represents a timestamp in ISO 8601 format and does not contain only whitespace characters.
        - `updatedAt` string — Timestamp of the last update.
        - `updatedBy` string — Username of the person who last updated the field.
    - `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 — Message providing information about the bulk action result.
  - `status_code` integer — HTTP status code returned.
  - `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/versions/531c9e2a7d23/schema)
