---
type: api
title: Get anonymization fields
description: Get a list of all anonymization fields.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-findanonymizationfields
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-findanonymizationfields
products:
  - Kibana
---

# Get anonymization fields

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/security_ai_assistant/anonymization_fields/_find`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v0/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v0/authentication#basicauth)

## Description

Get a list of all anonymization fields.

## Query String Parameters

- `fields` ([] string)
  Fields to return
- `filter` (string)
  Search query
- `sort_field` (enum)
  Field to sort by
  Values: `created_at`, `anonymized`, `allowed`, `field`, `updated_at`
- `sort_order` (enum)
  Sort order
  Values: `asc`, `desc`
- `page` (integer · min: 1 · default: 1)
  Page number
- `per_page` (integer · min: 0 · default: 20)
  AnonymizationFields per page
- `all_data` (boolean)
  If true, additionally fetch all anonymization fields, otherwise fetch only the provided page

## Responses

#### `200`

Indicates a successful call.

`application/json`

- `aggregations` (object)
  - `field_status` (object)
    - `buckets` (object)
      - `allowed` (object)
        - `doc_count` (integer · default: 0)
      - `anonymized` (object)
        - `doc_count` (integer · default: 0)
      - `denied` (object)
        - `doc_count` (integer · default: 0)
- `all` ([] object)
  - `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)
    Name of the anonymization field.
  - `id` (string · min: 1)
    A string that does not contain only whitespace characters.
  - `namespace` (string)
    Kibana space in which this anonymization field exists.
  - `timestamp` (string · min: 1)
    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.
- `data` ([] object)
  Same fields as `all`
- `page` (integer)
- `perPage` (integer)
- `total` (integer)
#### `400`

Bad Request response.

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (number)
## Code Examples

#### curl

```curl
curl \
 --request GET 'http://localhost:5601/api/security_ai_assistant/anonymization_fields/_find?page=1&per_page=20' \
 --header "Authorization: $API_KEY"
```

## Response Examples

#### Find anonymization fields response200

```json
{
  "aggregations": {
    "field_status": {
      "buckets": {
        "allowed": {
          "doc_count": 1
        },
        "anonymized": {
          "doc_count": 1
        },
        "denied": {
          "doc_count": 1
        }
      }
    }
  },
  "all": [
    {
      "allowed": true,
      "anonymized": true,
      "createdAt": "2023-10-31T12:00:00Z",
      "createdBy": "user1",
      "field": "user.name",
      "id": "1",
      "namespace": "default",
      "timestamp": "2023-10-31T12:00:00Z",
      "updatedAt": "2023-10-31T12:00:00Z",
      "updatedBy": "user1"
    }
  ],
  "data": [
    {
      "allowed": true,
      "anonymized": true,
      "createdAt": "2023-10-31T12:00:00Z",
      "createdBy": "user1",
      "field": "user.name",
      "id": "1",
      "namespace": "default",
      "timestamp": "2023-10-31T12:00:00Z",
      "updatedAt": "2023-10-31T12:00:00Z",
      "updatedBy": "user1"
    }
  ],
  "page": 1,
  "perPage": 20,
  "total": 100
}
```

#### Find anonymization fields response400

```json
{
  "error": "Bad Request",
  "message": "Invalid request parameters",
  "statusCode": 400
}
```

