# Configuration

This page explains how to enable custom request fields and add them to your Privacy Center intake form using JSON configuration.

You can also configure custom fields visually using the [Form Builder](/content/docs/privacy-requests/guides/custom-request-fields/form-builder/index.html) in the Admin UI.

## Enable custom fields [Permalink for this section](/content/docs/privacy-requests/guides/custom-request-fields/configuration#enable-custom-fields/index.html)

To enable custom fields for privacy requests, please add the following section to your `fides.toml` file:

```
[execution]
allow_custom_privacy_request_field_collection = true
allow_custom_privacy_request_fields_in_request_execution = true
```

## Configure custom fields [Permalink for this section](/content/docs/privacy-requests/guides/custom-request-fields/configuration#configure-custom-fields/index.html)

To add custom fields that will be collected for privacy requests, add them to the Privacy Center's `config.json` file under `custom_privacy_request_fields`.

Every field supports the following attributes:

| Attribute        | Description                                                                                                 |
|------------------|-------------------------------------------------------------------------------------------------------------|
| `label`          | Human-readable label rendered on the form.                                                                 |
| `required`       | Whether the value must be supplied. Defaults to `true` for non-file fields and `false` for `file` fields. |
| `default_value`  | Value used to pre-populate the input. Not supported for `multiselect`, `checkbox_group`, or `file` fields.|
| `hidden`         | If `true`, the field is not rendered but its `default_value` is still submitted. Not supported for `multiselect`, `checkbox_group`, or `file` fields.|
| `field_type`     | Selects the input variant rendered by the Privacy Center. See [Field types](/content/docs/privacy-requests/guides/custom-request-fields/configuration#field-types/index.html) below. Defaults to `text`.|
| `options`        | List of choices. Required for `select`, `multiselect`, and `checkbox_group`. Rejected for `text`, `textarea`, `checkbox`, and `file`.|
| `query_param_key`| Optional URL query-parameter name used to pre-populate the field when the Privacy Center is opened with a deep link. |

## Field types [Permalink for this section](/content/docs/privacy-requests/guides/custom-request-fields/configuration#field-types/index.html)

The `field_type` attribute selects the input variant rendered by the Privacy Center:

| `field_type` | Description                                                             |
|--------------|-------------------------------------------------------------------------|
| `text` (default) | Single-line free-text input.                                           |
| `textarea`     | Multi-line free-text input.                                           |
| `select`       | Single-select dropdown. Requires `options`.                          |
| `multiselect`  | Multi-select dropdown. Requires `options`.                           |
| `checkbox`     | A single boolean checkbox. Persists as `true`/`false`.              |
| `checkbox_group`| A group of checkboxes that the data subject can toggle independently. Requires `options` and persists as a list of the selected values.|
| `radio`        | Radio button group showing all options at once. Requires `options`.  |
| `location`     | Country/region picker using ISO 3166 codes. Accepts `ip_geolocation_hint` to pre-fill from the user's IP. |
| `date`         | Date picker in ISO 8601 (YYYY-MM-DD) format. Accepts optional `min` and `max` to constrain the selectable range. |
| `file`         | One or more file attachments uploaded by the data subject. See [Attachments](/content/docs/privacy-requests/guides/custom-request-fields/attachments/index.html).|

## Configuration example [Permalink for this section](/content/docs/privacy-requests/guides/custom-request-fields/configuration#configuration-example/index.html)

The configuration below combines the available field types into a single intake form: _First name_, an optional _Last name_, a hidden _Tenant ID_, a single-select _State of residence_, a multi-select _Brands_, a boolean _Marketing opt-out_ checkbox, a _Reasons_ checkbox group, a free-form _Additional context_ textarea, and a _Supporting documents_ file upload.

```
"custom_privacy_request_fields": {
  "first_name": {
    "label": "First name"
  },
  "last_name": {
    "label": "Last name",
    "required": false
  },
  "tenant_id": {
    "label": "Tenant ID",
    "hidden": true,
    "default_value": "123"
  },
  "state": {
    "label": "State of residence",
    "field_type": "select",
    "options": ["California", "New York", "Texas"]
  },
  "brands": {
    "label": "Brands",
    "field_type": "multiselect",
    "options": ["Cookie House", "Cookie Mansion", "Cookie Castle"]
  },
  "marketing_opt_out": {
    "label": "Opt me out of marketing emails",
    "field_type": "checkbox",
    "required": false
  },
  "reasons": {
    "label": "Reason for this request",
    "field_type": "checkbox_group",
    "options": ["Account closure", "Privacy concerns", "Data accuracy", "Other"]
  },
  "additional_context": {
    "label": "Additional context",
    "field_type": "textarea",
    "required": false
  },
  "supporting_documents": {
    "label": "Supporting documents",
    "field_type": "file",
    "required": false,
    "max_size_bytes": 5242880,
    "allowed_file_types": ["pdf", "png", "jpg"]
  }
}
```

Server-side validation enforces the field-type constraints listed above. For example, declaring `options` on a `text`, `textarea`, `checkbox`, or `file` field, marking a `multiselect`/`checkbox_group` as `hidden`, or omitting `options` from a `checkbox_group` will be rejected when the Privacy Center configuration is saved.
