> ## 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.

# Create redaction policy

> Replace your allow and deny rules for one data source by creating a new redaction policy version.

Creates a new version of the redaction policy for one data source, replacing all of your `ALLOW` and `DENY` rules. Send `"rules": []` to remove your rules and keep only the mandatory defaults. The response lists the rules you stored. Call [Get redaction policy](https://docs.operata.com/docs/api-get-redaction-policy.md) to see them merged with the `MANDATORY` rules. Collectors pick up the change within about five minutes. For the rule model and path syntax, see [Redaction policy](https://docs.operata.com/docs/api-redaction-policy.md).


## OpenAPI

````yaml POST /v1/config/source/{platform}/{dataSourceType}/redaction
openapi: 3.0.3
info:
  title: operata-api
  version: '1'
servers:
  - url: https://api.operata.io/
security:
  - sec0: []
paths:
  /v1/config/source/{platform}/{dataSourceType}/redaction:
    post:
      summary: Create redaction policy
      description: >-
        Replaces your `ALLOW` and `DENY` rules for one data source by creating a
        new policy version. Operata keeps earlier versions for audit.
      operationId: create-redaction-policy
      parameters:
        - name: platform
          in: path
          required: true
          description: 'Platform: `connect` (Amazon Connect) or `genesys` (Genesys Cloud).'
          schema:
            type: string
            enum:
              - connect
              - genesys
        - name: dataSourceType
          in: path
          required: true
          description: >-
            Data source: `ctr`, `cfl`, or `lexv2` for `connect`; `gcd` for
            `genesys`.
          schema:
            type: string
            enum:
              - ctr
              - cfl
              - lexv2
              - gcd
        - name: GroupID
          in: header
          required: true
          description: Your Operata Group ID. Must match the Group ID in your credentials.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rules
              properties:
                rules:
                  type: array
                  items:
                    $ref: '#/components/schemas/RedactionRule'
                  description: >-
                    Your `ALLOW` and `DENY` rules. Operata drops any `MANDATORY`
                    rules you send. An empty array removes your rules and leaves
                    only the defaults.
            examples:
              Allow attributes except customer name:
                value:
                  rules:
                    - type: ALLOW
                      fieldList:
                        - Attributes
                    - type: DENY
                      fieldList:
                        - Attributes.CustomerName
      responses:
        '201':
          description: >-
            The new policy version. If the rules match the current version,
            Operata returns that version and creates nothing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedactionPolicyDocument'
              examples:
                Result:
                  value:
                    version: v1
                    policyId: 3f0c2a52-8a1e-4c7e-9a43-2a4f0d6b1c55
                    platform: connect
                    dataSourceType: ctr
                    groupId: 550e8400-e29b-41d4-a716-446655440000
                    createdAt: '2026-11-02T04:12:09Z'
                    createdBy: config-api
                    rules:
                      - type: ALLOW
                        fieldList:
                          - Attributes
                      - type: DENY
                        fieldList:
                          - Attributes.CustomerName
        '400':
          description: >-
            Invalid body (missing `rules`, missing `fieldList`, or unknown rule
            type), unsupported platform and data source combination, or a
            missing or malformed `GroupID` header.
        '401':
          description: >-
            Missing or invalid credentials, or the `GroupID` header doesn't
            match them.
components:
  schemas:
    RedactionRule:
      type: object
      required:
        - fieldList
        - type
      description: 'One redaction rule: an action and the field paths it applies to.'
      properties:
        fieldList:
          type: array
          minItems: 1
          items:
            type: string
          description: >-
            Field paths the rule matches. A path covers every field nested under
            it.
          example:
            - Attributes.CustomerName
            - CustomerEndpoint.Address
        type:
          type: string
          enum:
            - MANDATORY
            - ALLOW
            - DENY
          description: >-
            `ALLOW` keeps matched fields, `DENY` removes them. `MANDATORY` rules
            are managed by Operata and appear only in responses.
        parameters:
          type: object
          description: >-
            Type-specific parameters for the rule. Reserved; no rule type uses
            it yet.
    RedactionPolicyDocument:
      type: object
      required:
        - version
        - policyId
        - platform
        - dataSourceType
        - groupId
        - createdAt
        - createdBy
        - rules
      description: A redaction policy version for one Operata Group and data source.
      properties:
        version:
          type: string
          enum:
            - v1
          description: Schema version of the document.
        policyId:
          type: string
          format: uuid
          description: ID of this policy version.
        platform:
          type: string
          example: connect
          description: Platform the policy applies to.
        dataSourceType:
          type: string
          example: ctr
          description: Data source the policy applies to.
        groupId:
          type: string
          format: uuid
          description: Your Operata Group ID.
        createdAt:
          type: string
          format: date-time
          description: When this policy version was created.
        createdBy:
          type: string
          example: config-api
          description: >-
            What created this version. `system` means no policy was ever set and
            the response holds the defaults only.
        rules:
          type: array
          items:
            $ref: '#/components/schemas/RedactionRule'
          description: >-
            On `GET`, every rule in effect: the `MANDATORY` defaults plus your
            `ALLOW` and `DENY` rules. On `POST`, the `ALLOW` and `DENY` rules
            you stored.
        rulesHash:
          type: string
          description: >-
            SHA-256 hex digest of the effective rule set, independent of rule
            and field order. Returned on `GET` only. Compare it between calls to
            detect a change.
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````

## Related topics

- [Redaction policy](https://docs.operata.com/docs/api-redaction-policy.md)
- [Configure CTR redaction](https://docs.operata.com/docs/guides-configure-ctr-redaction.md)
- [PII in Operata](https://docs.operata.com/docs/pii.md)
