> ## Documentation Index
> Fetch the complete documentation index at: https://docs.operata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CTR redaction schema

> Field tiers, processing order, and the mandatory keep-list for the Contact Trace Record redaction Lambda that runs in your AWS account.

The Contact Trace Record (CTR) redaction Lambda enforces this schema. The Lambda runs inside your AWS account. It applies your `connect/ctr` redaction policy to every Amazon Connect CTR read from Kinesis and ships only the surviving record to Operata.

For the policy rules and endpoints, see [Redaction policy](https://docs.operata.com/docs/api-redaction-policy.md). For the model behind redaction, see [Privacy and redaction](https://docs.operata.com/docs/concepts-privacy-and-redaction.md).

> [!WARNING]
>
> This schema applies to the CTR collector in Cloud Collector v1.2.3 and later. Earlier releases read the legacy redaction config. See [Configure CTR redaction (legacy)](https://docs.operata.com/docs/guides-configure-ctr-redaction-legacy) and the [legacy config endpoints](https://docs.operata.com/docs/api-data-redaction). Contact flow logs and Amazon Lex have their own schemas.

## Field tiers

Every field in a CTR falls into one of four tiers.

| Tier | Behavior | Controlled by |
| - | - | - |
| Mandatory | Key and value sent unchanged. No other rule can remove it. | Operata |
| Deny | Key and value removed. Operata never sees the field. | You, with `DENY` rules |
| Allow | Key and value sent unchanged. | You, with `ALLOW` rules |
| Default | Key kept, value set to `null`. Applies to every field no rule matches. | Operata |

With no `ALLOW` or `DENY` rules, a CTR reaches Operata with every key present but only the mandatory values filled in.

## Processing order

The Lambda checks each field against the tiers in order and applies the first one that matches.

1. **Mandatory.** Keep the field. If a mandatory field sits under a denied parent, keep the parent and remove its other children.
2. **Deny.** Remove the field and everything under it.
3. **Allow.** Keep the field and everything under it.
4. **Default.** Set the value to `null`.

Deny comes before allow, so a `DENY` on a parent removes it even when an `ALLOW` names one of its children. An `ALLOW` on a parent with a `DENY` on a child keeps every child except the denied one.

## Path notation

Rules use dot notation against the CTR JSON. For the full syntax, including wildcards and filters, see [Field paths](https://docs.operata.com/docs/api-redaction-policy.md#field-paths).

* `Attributes` matches the whole `Attributes` object.
* `CustomerEndpoint.Address` matches only that subfield.
* `Attributes.*` matches every direct child of `Attributes`.
* `[Channel == 'CHAT'].Agent.ARN` matches `Agent.ARN` only on chat CTRs.

## Chat CTRs

The Lambda always collects voice CTRs. It collects chat and other non-voice CTRs only when chat collection is on for your Operata Group. Operata manages this setting. If the Lambda can't read it, it treats chat collection as off and drops non-voice CTRs.

Chat CTRs carry extra mandatory fields, such as `ChatMetrics`. They appear in the keep-list with a `[Channel == 'CHAT']` prefix. On voice CTRs, those fields follow your `ALLOW` and `DENY` rules like any other field.

## Data flow

```text theme={null}
Amazon Connect CTR
  ↓
Kinesis data stream (in your AWS account)
  ↓
EventBridge pipe → redaction Lambda (in your AWS account)
  ├─ Drop non-voice CTRs if chat collection is off
  ├─ Mandatory
  ├─ Deny
  ├─ Allow
  └─ Default: set to null
  ↓
Operata API (redacted CTR only)
```

The Lambda refreshes the policy from Operata at most every five minutes and caches it in AWS Secrets Manager in your account. If Operata is unreachable, it applies the cached policy. If it has no policy at all, it fails the batch rather than ship an unredacted CTR.

## Mandatory keep-list

The Lambda always preserves these fields. To see the current list for your Operata Group, read your policy with [Get redaction policy](https://docs.operata.com/docs/api-get-redaction-policy.md).

### All CTRs

```text theme={null}
AWSAccountId
AWSContactTraceRecordFormatVersion
Agent.AfterContactWorkDuration
Agent.AfterContactWorkEndTimestamp
Agent.AfterContactWorkStartTimestamp
Agent.AgentInteractionDuration
Agent.ConnectedToAgentTimestamp
Agent.CustomerHoldDuration
Agent.DeviceInfo
Agent.HierarchyGroups
Agent.LongestHoldDuration
Agent.NumberOfHolds
Agent.Username
AgentConnectionAttempts
AnsweringMachineDetectionStatus
Channel
ConnectedToSystemTimestamp
ContactId
DisconnectReason
DisconnectTimestamp
InitialContactId
InitiationMethod
InitiationTimestamp
InstanceARN
LastUpdateTimestamp
NextContactId
PreviousContactId
QualityMetrics
Queue.DequeueTimestamp
Queue.Duration
Queue.EnqueueTimestamp
Queue.Name
SystemEndpoint.Address
SystemEndpoint.Type
TransferCompletedTimestamp
TransferredToEndpoint
```

### Chat CTRs only

```text theme={null}
[Channel == 'CHAT'].Agent.ARN
[Channel == 'CHAT'].Agent.ActiveRegion
[Channel == 'CHAT'].Agent.AgentInitiatedHoldDuration
[Channel == 'CHAT'].Agent.RoutingProfile.ARN
[Channel == 'CHAT'].Agent.RoutingProfile.Name
[Channel == 'CHAT'].ChatMetrics.AgentMetrics.ConversationAbandon
[Channel == 'CHAT'].ChatMetrics.AgentMetrics.LastMessageTimestamp
[Channel == 'CHAT'].ChatMetrics.AgentMetrics.MaxResponseTimeInMillis
[Channel == 'CHAT'].ChatMetrics.AgentMetrics.MessageLengthInChars
[Channel == 'CHAT'].ChatMetrics.AgentMetrics.MessagesSent
[Channel == 'CHAT'].ChatMetrics.AgentMetrics.NumResponses
[Channel == 'CHAT'].ChatMetrics.AgentMetrics.ParticipantId
[Channel == 'CHAT'].ChatMetrics.AgentMetrics.ParticipantType
[Channel == 'CHAT'].ChatMetrics.AgentMetrics.TotalResponseTimeInMillis
[Channel == 'CHAT'].ChatMetrics.ContactMetrics.AgentFirstResponseTimeInMillis
[Channel == 'CHAT'].ChatMetrics.ContactMetrics.AgentFirstResponseTimestamp
[Channel == 'CHAT'].ChatMetrics.ContactMetrics.ConversationCloseTimeInMillis
[Channel == 'CHAT'].ChatMetrics.ContactMetrics.ConversationTurnCount
[Channel == 'CHAT'].ChatMetrics.ContactMetrics.MultiParty
[Channel == 'CHAT'].ChatMetrics.ContactMetrics.TotalBotMessageLengthInChars
[Channel == 'CHAT'].ChatMetrics.ContactMetrics.TotalBotMessages
[Channel == 'CHAT'].ChatMetrics.ContactMetrics.TotalMessages
[Channel == 'CHAT'].ChatMetrics.CustomerMetrics.ConversationAbandon
[Channel == 'CHAT'].ChatMetrics.CustomerMetrics.LastMessageTimestamp
[Channel == 'CHAT'].ChatMetrics.CustomerMetrics.MaxResponseTimeInMillis
[Channel == 'CHAT'].ChatMetrics.CustomerMetrics.MessageLengthInChars
[Channel == 'CHAT'].ChatMetrics.CustomerMetrics.MessagesSent
[Channel == 'CHAT'].ChatMetrics.CustomerMetrics.NumResponses
[Channel == 'CHAT'].ChatMetrics.CustomerMetrics.ParticipantId
[Channel == 'CHAT'].ChatMetrics.CustomerMetrics.ParticipantType
[Channel == 'CHAT'].ChatMetrics.CustomerMetrics.TotalResponseTimeInMillis
[Channel == 'CHAT'].ContactAssociationId
[Channel == 'CHAT'].MediaStreams.Type
[Channel == 'CHAT'].Queue.ARN
[Channel == 'CHAT'].SegmentAttributes.connect:Purpose.ValueMap.analytics.ValueList.ValueString
[Channel == 'CHAT'].SegmentAttributes.connect:Purpose.ValueMap.contact-attributes-search.ValueList.ValueString
[Channel == 'CHAT'].SegmentAttributes.connect:Subtype
[Channel == 'CHAT'].SegmentAttributes.connect:WorkloadType.ValueString
[Channel == 'CHAT'].Tags.aws:connect:instanceId
```

## Related

* [Redaction policy](https://docs.operata.com/docs/api-redaction-policy.md) — the rule model, path syntax, and endpoints.
* [Configure CTR redaction](https://docs.operata.com/docs/guides-configure-ctr-redaction.md) — set your CTR redaction policy step by step.
* [Configure CTR redaction (legacy)](https://docs.operata.com/docs/guides-configure-ctr-redaction-legacy) — the rollout for Cloud Collector releases before v1.2.3.
* [Privacy and redaction](https://docs.operata.com/docs/concepts-privacy-and-redaction.md) — the cross-integration model.
* [Contact trace records](https://docs.operata.com/docs/contact-trace-records.md) — the CTR fields these paths reference.
* [Lex redaction schema](https://docs.operata.com/docs/lex-privacy.md) and [Contact Flow Log redaction schema](https://docs.operata.com/docs/contact-flow-log-privacy.md) — the sibling schemas.
* [Install CTR collection for Amazon Connect](https://docs.operata.com/docs/ctr-installation.md) — the integration this schema applies to.


## Related topics

- [Lex redaction schema](https://docs.operata.com/docs/lex-privacy.md)
- [Configure CTR redaction](https://docs.operata.com/docs/guides-configure-ctr-redaction.md)
- [Privacy and redaction](https://docs.operata.com/docs/concepts-privacy-and-redaction.md)
