# Configure Redaction

### Create Project

To protect sensitive data, a project needs to be configured in order to redact the defined [entities](/features/entities.md) for a given audio file.

For this example, we will redact the following entities:

* `Person`

```json
{
    "sid": "NER000",
    "name": "ner",
    "active": true,
    "agent_location": "left",
    "inbound": true,
    "scrubaudio": true,
    "scrubtext": true,
    "rules": [
        {
            "name": "Person",
            "active": true,
            "mask_type": "Placeholder",
            "setting": "[NAME]",
            "real_time": true
        }
    ]
}
```

### Publish Redaction Project

Publish the configuration.

<mark style="color:green;">`POST`</mark> `/system/cache/v2/publish`

Sets the system cache

#### Request Body

| Name                                   | Type   | Description           |
| -------------------------------------- | ------ | --------------------- |
| data<mark style="color:red;">\*</mark> | String | Project configuration |

{% tabs %}
{% tab title="200: OK Project published successfully" %}

{% endtab %}

{% tab title="400: Bad Request Unable to publish project" %}

{% endtab %}

{% tab title="500: Internal Server Error Internal server error" %}

{% endtab %}
{% endtabs %}

The example below use `cURL`, a command line utility that sends HTTP client requests. The `cURL`application is freely available for Linux, Windows, and macOS operating systems.

```bash
curl -s -X POST \
-f 'project.json' \
'brainengine_name/system/cache/v2/publish'    
```

#### Expected Response

```json
{
  "success": true,
  "message": "",
  "detail": ""
}
```

### Confirm Project Configuration

Open your browser and make a call to the following endpoint using the project sid below to retrieve the published configuration.

```bash
sid = NER000
```

{% openapi src="/files/2gsnVsp1zZE7bezy147M" path="/system/cache" method="get" %}
[new\_swagger.json](https://503895249-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1EY0mdS3o1Qc94eAkSh5%2Fuploads%2FeSHq4VHUIyvLRgB2U93u%2Fnew_swagger.json?alt=media)
{% endopenapi %}

```bash
curl -s -X POST \
-f 'project.json' \
'brainengine_name/system/cache/v2/publish'
```

#### Expected Response

```json
{
    "sid": "NER000",
    "name": "ner",
    "active": true,
    "agent_location": "left",
    "inbound": true,
    "scrubaudio": true,
    "scrubtext": true,
    "rules": [
        {
            "name": "Person",
            "active": true,
            "mask_type": "Placeholder",
            "setting": "[NAME]",
            "real_time": true
        }
    ]
}
```

#### Resubmit Sample Call

&#x20;The example below submits a transcription request to BrainEngine for redaction.

```bash
curl -s -X POST \
-T 'sample_2.wav' \
'brainengine_name/transcribe?sid=NER000@scrubtext=true&output=text'
```

#### Expected Response

{% code overflow="wrap" %}

```
AGENT: Hello. This is [NAME] welcome to that until this is [NAME] from the customer service department how can I be of help.
CLIENT: Hi, [NAME], my name is [NAME] and I am a little bit confused about something that I saw on my account.
AGENT: Who [NAME] just hold on I need to ask you a few security questions for verification.
CLIENT: Okay.
AGENT: Okay. What is your full name please?
CLIENT: [NAME]  .
AGENT: to the to ours
CLIENT: One or.
AGENT: one our okay and your social security number.
CLIENT: 657080021.
AGENT: And current address please.
CLIENT: 11 north Pennsylvania avenue Morris Seville Tennessee.
....
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.brainengine.ai/quick-start/configure-redaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
