# Privacy Center & FidesJS

## Adding Privacy Center Configuration to Properties

A default property is automatically created for you. You can manage your privacy center configuration through the API or by directly editing configuration files.

## Recommended: API-based Configuration

The recommended way to configure your privacy center is through the API by linking your privacy center configurations to one of your [properties](/content/docs/platform/configuration/properties/index.html). This method requires Fides Cloud or Fides Enterprise and provides additional features:

- Support for unique privacy center configurations for each property (see [Multiple Privacy Centers](/content/docs/privacy-center-fidesjs/privacy-center/multiple-privacy-centers/index.html))
- Different appearances for each Property
- [Location-based actions](/content/docs/privacy-center-fidesjs/privacy-center/privacy-requests/index.html)

### Adding Privacy Center Configuration to Your Property
1. **List your properties** by calling `GET /api/v1/plus/properties` to get your property ID
2. **Update the property** using `PUT /api/v1/plus/property/{property_id}` with your desired `privacy_center_config` and/or `stylesheet`
3. **(Optional) Create a new property and add your configuration to it by:**
   - First creating a new property via the [admin UI](/content/docs/platform/configuration/properties/index.html)
   - Then calling `POST /api/v1/plus/property` with your configuration

> **Note**: For API authentication, see the [API Authentication](/content/docs/api-reference/auth/index.html) documentation.

The request body adds three new properties to your existing property configuration:

```
{
  "privacy_center_config": {
    // See example config.json
  },
  "stylesheet": "body { background-color: cyan; }",
  "paths": ["/"]
}
```

#### privacy_center_config
The main configuration object that defines your privacy center's behavior and content. See an [example of the privacy_center_config structure](https://github.com/ethyca/fides/blob/main/clients/privacy-center/config/config.json) for all available configuration options.

#### stylesheet
Custom CSS styles to control the visual appearance of your privacy center. This field contains the CSS content that would otherwise be in `config.css`. See an [example with customizable CSS variables](https://github.com/ethyca/fides/blob/main/clients/privacy-center/config/config.css) and the [Appearance](/content/docs/privacy-center-fidesjs/privacy-center/appearance/index.html) section for styling examples and best practices.

#### paths
Defines which URLs your privacy center configuration applies to. This property allows you to set different paths for each of your properties on the same domain. See the [Multiple Privacy Centers](/content/docs/privacy-center-fidesjs/privacy-center/multiple-privacy-centers/index.html) section for examples and configuration details.

## File-Based Configuration
Configure your privacy center by editing `config.json` and `config.css` in your privacy center's configuration directory.

This method is simpler but has limitations:
- Cannot manage multiple privacy centers
- Cannot set different styles for different Properties
- Cannot use location-based actions
- Changes require direct file access and deployment

For detailed configuration options, see [Consent Options](/content/docs/privacy-center-fidesjs/privacy-center/consent-options/index.html) and [Appearance](/content/docs/privacy-center-fidesjs/privacy-center/appearance/index.html).

## Migrating to API-based Configuration
If you're currently using file-based configuration and want to migrate to API-based configuration:
1. **Backup Current Configuration**
   - Make a copy of your existing `config.json` and `config.css` files
   - Keep these backups until you've verified the migration
2. **Get Your Property ID**
   - Call `GET /api/v1/plus/properties` to list your properties
   - Note your default property ID
3. **Update Property Configuration**

```
{
     "privacy_center_config": { /* Your existing config.json content */ },
     "stylesheet": "/* Your existing config.css content */",
     "paths": ["/"]
}
```

- Use `PUT /api/v1/plus/property/{property_id}` to update your property
4. **Update Consent Experiences**
   - If you have any consent experiences of the privacy center type, update them to match your default property
   - This ensures your consent management continues to work with the new API-based configuration
5. **Enable API Configuration**
   - Fides Cloud: Contact support to enable `FIDES_PRIVACY_CENTER__USE_API_CONFIG=true`
   - Self-hosted: Set `FIDES_PRIVACY_CENTER__USE_API_CONFIG=true` in your deployment configuration
6. **Verify Configuration**
   - Your privacy center should maintain the same appearance and behavior
   - Try making a small change to styles or text to confirm it's manageable through the API

## Admin UI Privacy Requests Configuration
If you want to submit privacy requests from the [Admin UI](/content/docs/privacy-requests/guides/submitting-requests#the-admin-ui/index.html), you'll need to submit part of your privacy center configuration to a separate endpoint. This configuration defines the available privacy request types and their required fields in the Admin UI.

Here's an example of the configuration you can submit to `PUT /api/v1/plus/privacy-center-config`:

```
{
  "actions": [
    {
      "policy_key": "default_access_policy",
      "title": "Access your data",
      "identity_inputs": {
        "email": "required"
      },
      "custom_privacy_request_fields": {
        "site_id": {
          "label": "Site ID",
          "required": false,
          "hidden": false
        }
      }
    },
    {
      "policy_key": "default_erasure_policy",
      "title": "Erase your data",
      "identity_inputs": {
        "email": "required"
      }
    }
  ]
}
```
