# Record and review redaction requests

{% hint style="info" %}
**Required global permission:** Use the Request Explorer
{% endhint %}

When you use the `redact` method to redact a plain text string, you can also choose to record the request.

The recorded requests are encrypted.

When you make the request, you specify the number of hours to keep the recorded request. After that amount of time elapses, the request is completely purged. Recorded requests are never kept more than 720 hours, regardless of the configured retention time.

From the **Request Explorer**, you can review your recorded requests to check the results and assess the quality of the redaction. You can also test changes to the redaction configuration.

You cannot view requests from other users.

## **Recording a redaction request** <a href="#redaction-requeset-record" id="redaction-requeset-record"></a>

To record a redaction request, you include the `record_options` argument:

{% code overflow="wrap" %}

```python
record_options = RecordApiRequestOptions(record=<boolean>, retention_time_in_hours=<number of hours>, tags=["tag name"])
```

{% endcode %}

The `record_options` argument includes the following parameters:

* `record` - Whether to record the request. The default is `False`. To record the request, set record to `True`.
* `retention_time_in_hours` - The number of hours to preserve the recorded request. The default is 1. After the retention time elapses, the request is purged completely.
* `tags` - A list of tags to assign to the request. The tags are mostly intended to make it easier to search for requests on the **Request Explorer** page.

## **Viewing the list of recorded requests** <a href="#redaction-request-view-list" id="redaction-request-view-list"></a>

The **Request Explorer** page in Textual contains the list requests that you recorded and that are not yet purged. You cannot view requests from other users.

To display the **Request Explorer** page, in the Textual navigation menu, click the request explorer icon.

For each request, the list includes:

* A 255-character preview of the text that was sent for redaction.
* The tags assigned to the request.
* The date when the request will be purged.

## **Filtering the requests** <a href="#redaction-request-filter-list" id="redaction-request-filter-list"></a>

You can search for a request based on text that is contained in the redacted text, and by the tags that you assigned to the request.

To search by text from the string, in the search field, begin to type the text.

To search by an assigned tag, in the search field, type `tags:` followed by the tag to search for.

## **Previewing the request results** <a href="#redaction-requeset-preview-results" id="redaction-requeset-preview-results"></a>

From the request list, to view the results of a request, click the request row.

By default, the preview uses **Identification** view. For each detected entity, **Identification** view displays the value and the entity type.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FPLqQIj38NpZ4N9Snw5ea%2FRequestExplorerPreviewIdentification.png?alt=media&#x26;token=0dec229a-33a9-40e6-9730-745a76f65982" alt=""><figcaption><p>Identification view of the redaction preview</p></figcaption></figure>

To instead display only the replacement value, which by default is the entity type, click **Replacement**.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2Fckdxna5tm6v181AjFzuc%2FRequestExplorerPreviewReplacement.png?alt=media&#x26;token=cd07da1d-b38f-41e5-9182-189807128802" alt=""><figcaption><p>Replacement view of the redaction preview</p></figcaption></figure>

## Testing changes to the redaction configuration <a href="#request-preview-test-values" id="request-preview-test-values"></a>

From the preview, you can test how the results change when you:

* Change the handling option for entity types.
* Add and exclude values for entity types.

### Displaying the Edit Request panel <a href="#request-edit-display-panel" id="request-edit-display-panel"></a>

To display the edit panel, from the request preview page, click **Edit**.

The **Edit Request** panel displays the full list of the available entity types.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FWXIIXzbMjFyuFTRJ1i6l%2FRequestExplorerPreviewEditRequest.png?alt=media&#x26;token=166cf8ed-0295-46e4-94b4-c02a8c556e4c" alt=""><figcaption><p>Edit Request panel with the list of entity types</p></figcaption></figure>

### Changing entity type handling options <a href="#request-explorer-preview-handling-option" id="request-explorer-preview-handling-option"></a>

You can change how Textual handles detected entity values for each entity type.

Note that the handling option changes are not saved when you close the preview and return to the requests list.

#### Available handling options

The handling options are:

* **Off** - Indicates to ignore values for this entity type.
* **Redact** - This is the default option. Indicates to replace each value with a token that represents the entity type.
* **Synthesize** - Indicates to replace each value with a realistic replacement value.

#### Changing the handling option for a single entity type <a href="#request-explorer-handling-option-single" id="request-explorer-handling-option-single"></a>

To change the handling option for a single entity type, either:

* Click the handling option value for the entity type, then select the handling option.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FuubWjcSoxobpCI4l4tDc%2FRequestExplorerPreviewHandlingOption.png?alt=media&#x26;token=bbce0ea6-8745-462c-8bd4-cf8cec02a1df" alt=""><figcaption><p>Handling option dropdown for an entity type on the Request Explorer preview</p></figcaption></figure>

* Click the entity type, then under **Generator**, click the handling option.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FgMdYrwsiWQxdaHY8KouL%2FRequestExplorerGeneratorOptions.png?alt=media&#x26;token=c41a3f49-81f3-44aa-b172-132279e6d9ec" alt=""><figcaption><p>Generator panel to select the entity type handling option</p></figcaption></figure>

#### Selecting the same handling option for all entity types <a href="#request-explorer-bulk-edit" id="request-explorer-bulk-edit"></a>

To select the same handling option for all of the entity types:

1. Click **Bulk Edit**.
2. From the **Bulk Edit** dropdown list, select the handling option.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FolMp1v6cAFmQp7KGXSaW%2FRequestExplorerBulkEditDropdown.png?alt=media&#x26;token=9a13c080-288a-4a1b-8fd1-1140cd54e9a9" alt=""><figcaption><p>Bulk Edit dropdown to set the handling option for all entity types</p></figcaption></figure>

### Configuring added and excluded values for an entity type <a href="#request-edit-configure-values" id="request-edit-configure-values"></a>

To configure added and excluded values for an entity type, click the entity type.

The **Edit Request** panel expands to display the **Add to detection** and **Exclude from detection** lists.

* You use the **Add to detection** list to configure regular expressions to identify additional values to detect as the selected entity type.
* You use the **Exclude from detection** list to configure regular expressions to identify values to not detect as the selected entity type.

Note that the added and excluded values are not saved when you close the preview and return to the requests list.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FwDWzXkG9lNkaO9pbI6P4%2FRequestExplorerPreviewTypeSelected.png?alt=media&#x26;token=ad5cc89e-a9ab-4029-b8d5-04992e2012a0" alt=""><figcaption><p>Edit Request panel with the Add to detection and Exclude from detection lists</p></figcaption></figure>

#### Creating a regular expression for an added or excluded value <a href="#edit-request-create-regex" id="edit-request-create-regex"></a>

To create a regular expression for added or excluded values:

1. Click the **Add regex option** for that list.
2. In the field, provide a regular expression to identify values to add or exclude.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FTZS01S4pFwK7cBChAtwq%2FRequestExplorerPreviewNewValue.png?alt=media&#x26;token=09ea1cae-b766-49d6-986e-0ddac76961a2" alt=""><figcaption><p>Field to create an added or excluded value regular expression</p></figcaption></figure>

3. Press Enter.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2F3dRMgPw5xg13MANrwnIv%2FRequestExplorerPreviewSavedValue.png?alt=media&#x26;token=3af191da-758d-4664-9428-3b17f4bd9d93" alt=""><figcaption><p>Saved regular expression for a value</p></figcaption></figure>

#### Editing a regular expression for added or excluded values <a href="#edit-request-edit-regex" id="edit-request-edit-regex"></a>

To edit a regular expression:

1. Click the edit icon for the expression.
2. In the field, edit the expression.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FRUb3fayoZihbX9QDqRU0%2FRequestExplorerPreviewEditValue.png?alt=media&#x26;token=5a0a14f9-1f8e-4af8-924a-5c6e9f876f9d" alt=""><figcaption><p>Edit field for a regular expression</p></figcaption></figure>

3. Click the save icon.

#### Deleting a regular expression for added or excluded values <a href="#edit-request-delete-regex" id="edit-request-delete-regex"></a>

To delete a regular expression, click the delete icon for that expression.

#### Viewing whether an entity type has added or excluded values <a href="#added-excluded-values-icons" id="added-excluded-values-icons"></a>

When an entity type has added values, the added values icon displays for that entity type.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2Fw5zLofMloaBHbbSR01S0%2FRequestExplorerAddedValuesIcon.png?alt=media&#x26;token=d1f82848-b308-4d1c-9f5c-dc56767616ea" alt=""><figcaption><p>Added values icon for an entity type in the Request Explorer</p></figcaption></figure>

When an entity type has excluded values, the excluded values icon displays for that entity type.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2F7klBb20K9Kq5psfS6b9o%2FRequestExplorerExcludedValuesIcon.png?alt=media&#x26;token=7fc20978-911f-46d2-aa59-774ed909466e" alt=""><figcaption><p>Excluded values icon for an entity type in the Request Explorer</p></figcaption></figure>

### Replaying the request <a href="#edit-request-replay-request" id="edit-request-replay-request"></a>

To replay the request based on the current configuration, click **Replay**.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FGA1BYdinLANzWvA0Dz79%2FRequestExplorerPreviewReplayRemove.png?alt=media&#x26;token=8cdf8238-80f5-488e-b592-c901d6a6dd55" alt=""><figcaption><p>Replay button for a previewed request</p></figcaption></figure>

When you replay the request, in addition to the **Identification** and **Replacement** options, you use the **Diff** toggle to indicate whether to compare the original and new results.

For our example, we made the following changes to the configuration:

* For Given Name and Family Name, changed the handling option to **Synthesize**.
* For Credit Card, indicated to ignore the value 41111111111.

#### Replayed results views with the Diff toggle off

When the **Diff** toggle is in the off position, **Identification** view only reflects changes to the added and excluded values.

In our example, we configured 41111111111 to not be detected as a credit card number. In the replayed request, it is instead detected as a numeric value.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FsMiL9zikPuYS4DVKTcV2%2FRequestExplorerReplayDiffOffIdentification.png?alt=media&#x26;token=b104eb5c-bbfb-49de-847b-0c04ea4fb6ac" alt=""><figcaption><p>Identification view of a replayed request with Diff off</p></figcaption></figure>

**Replacement** view reflects both the added and excluded values and the changes to the handling option.

For our example, in addition to the entity type change for the credit card number 41111111111, the given and family names are now realistic replacement values instead of the entity types.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FqxmUpE3K28dIXf8I8Sre%2FRequestExplorerReplayDiffOffReplacement.png?alt=media&#x26;token=a7abfd7f-4651-462f-87cd-34d5e0d2143e" alt=""><figcaption><p>Replacement view of a replayed request with Diff off</p></figcaption></figure>

#### Replayed results views with the Diff toggle on

When you set the **Diff** toggle to the on position, the preview displays the original content to the left, and the modified content to the right.

In **Identification** view, you can see the changes to the entity detection based on the added and excluded values.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FecMxJeSbYYYmEkSB8kBL%2FRequestExplorerReplayDiffOnIdentification.png?alt=media&#x26;token=ca3951e4-1315-4f7e-906f-8e9efebcd0f9" alt=""><figcaption><p>Identification view of a replayed request with Diff on</p></figcaption></figure>

In **Replacement** view, you can also see the changes to the selected handling options for the entity types.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FprG4kWsm5DiIQ3gb0XMI%2FRequestExplorerReplayDiffOnReplacement.png?alt=media&#x26;token=ec1b9fc6-f774-4aae-a91b-c76f71222b60" alt=""><figcaption><p>Replacement view of a replayed request with Diff on</p></figcaption></figure>

### Clearing all of the configuration changes <a href="#edit-request-clear-all-changes" id="edit-request-clear-all-changes"></a>

To clear all of the regular expressions for all of the entity types, click **Remove Changes**.

<figure><img src="https://3072847115-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvOPn7KQptPWmS5iKg5P0%2Fuploads%2FGA1BYdinLANzWvA0Dz79%2FRequestExplorerPreviewReplayRemove.png?alt=media&#x26;token=8cdf8238-80f5-488e-b592-c901d6a6dd55" alt=""><figcaption><p>Remove Changes button for a previewed request</p></figcaption></figure>


---

# 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.tonic.ai/textual/tonic-textual-api/datasets-redaction/redaction-requeset-record-review.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.
