---
title: "TranspileDataPolicy"
method: POST
path: "/v1alpha/data-policies/transpile"
tags: ["DataPoliciesService"]
---

# TranspileDataPolicy

`POST /v1alpha/data-policies/transpile`

## Request body

- TranspileDataPolicyRequest
  - `dataPolicyRef` DataPolicyRef
    - `dataPolicyId` string
    - `platformId` string
  - `inlineDataPolicy` DataPolicy
    - `metadata` DataPolicyMetadata
      - `createTime` string, date-time
      - `description` string
      - `lastApplyTime` string, date-time — The last time the policy was applied to the target(s).
      - `tags` string[]
      - `title` string
      - `updateTime` string, date-time
      - `version` integer — For new policies, the version does not need to be set. When updating a policy, the version must match the current version. The version is then automatically incremented.
    - `ruleSets` DataPolicyRuleSet[]
      - `fieldTransforms` RuleSetFieldTransform[] — Zero or more field transforms. Any field for which no field transform is specified will be included as-is.
        - `field` DataPolicyField
          - `nameParts` string[] — Instead of using "nodes", nesting can be expressed by specifying multiple name parts. A flat table (e.g. csv file) will only contain a single name part for all fields.
          - `required` boolean — Whether the field is required. If not, the field may be null.
          - `tags` string[]
          - `type` string — The data type of the field.
        - `transforms` FieldTransformTransform[] — The last condition in the list must have 0 principals, as this acts as the default / else condition. Transforms should have mutually exclusive sets of principals.
          - `aggregation` TransformAggregation
            - `avg` AggregationAvg
              - …
            - `max` AggregationMax
            - `min` AggregationMin
            - `partitionBy` DataPolicyField[] — The fields to partition by.
              - …
            - `sum` AggregationSum
          - `detokenize` TransformDetokenize
            - `tokenField` DataPolicyField
              - …
            - `tokenSourceRef` string — Full reference to the token source, e.g. a fully qualified table name.
            - `valueField` DataPolicyField
              - …
          - `fixed` TransformFixed
            - `value` string
          - `hash` TransformHash
            - `seed` string
          - `identity` TransformIdentity
          - `nullify` TransformNullify
          - `numericRounding` TransformNumericRounding
            - `ceil` NumericRoundingCeil
              - …
            - `floor` NumericRoundingFloor
              - …
            - `round` NumericRoundingRound
              - …
          - `principals` DataPolicyPrincipal[] — The principals (e.g. groups) for which this transform will be applied.
            - `group` string — a group of users, different for each platform
            - `permission` string — a permission, currently only supported for Google IAM permissions in BigQuery IAM Check Extension
            - `role` string — a user role, currently only supported for Google IAM roles with BigQuery IAM Check Extension
          - `regexp` TransformRegexp
            - `regexp` string
            - `replacement` string — Use dollar signs to reference capturing groups in the replacement, e.g. "my-replacement-$1-$2". If the replacement is left empty, the regexp match result (full match or first capturing group) is used.
          - `sqlStatement` TransformSqlStatement
            - `statement` string
      - `filters` RuleSetFilter[] — Zero or more filters. Records that match the conditions are included in the result. When no filters are defined, all records are always included.
        - `genericFilter` FilterGenericFilter
          - `conditions` GenericFilterCondition[] — The last condition in the list must have 0 principals, as this acts as the default / else condition.
            - `condition` string — A (platform-specific) SQL expression. If it evaluates to true, the principals are allowed to access the data.
            - `principals` DataPolicyPrincipal[] — The principals (e.g. groups) that apply to this condition.
              - …
        - `retentionFilter` FilterRetentionFilter
          - `conditions` RetentionFilterCondition[] — The last condition in the list must have 0 principals, as this acts as the default / else condition.
            - `period` RetentionFilterPeriod
              - …
            - `principals` DataPolicyPrincipal[] — The principals (e.g. groups) that apply to this condition.
              - …
          - `field` DataPolicyField
            - `nameParts` string[] — Instead of using "nodes", nesting can be expressed by specifying multiple name parts. A flat table (e.g. csv file) will only contain a single name part for all fields.
            - `required` boolean — Whether the field is required. If not, the field may be null.
            - `tags` string[]
            - `type` string — The data type of the field.
      - `target` DataPolicyTarget
        - `ref` ResourceUrn
          - `catalog` DataCatalog
            - `databases` Database[] — A top-most level of the catalog. This is typically a database.
              - …
            - `id` string — An arbitrary but unique identifier for the catalog. This matches the id from the PACE app configuration.
            - `tags` string[]
            - `type` 'TYPE_UNSPECIFIED' | 'COLLIBRA' | 'ODD' | 'DATAHUB', enum
          - `integrationFqn` string — the Fully Qualified Name of the data resource on the processing platform / data catalog.
          - `platform` ProcessingPlatform
            - `id` string — An arbitrary but unique identifier for the platform. This matches the id from the PACE app configuration.
            - `platformType` 'PLATFORM_TYPE_UNSPECIFIED' | 'DATABRICKS' | 'SNOWFLAKE' | 'BIGQUERY' | 'POSTGRES' | 'SYNAPSE', enum
          - `resourcePath` ResourceNode[]
            - `displayName` string — human readable string. If absent use name.
            - `isLeaf` boolean — data resource
            - `name` string — the bits between the slashes. the technical path to the data. can be uuid (Collibra for instance)
            - `platformName` string — dataset, schema, table, whatever... For display purposes only. FIXME platform type
        - `type` 'TARGET_TYPE_UNSPECIFIED' | 'SQL_VIEW' | 'DBT_SQL', enum
    - `source` DataPolicySource
      - `fields` DataPolicyField[] — A representation of the source data schema. Nested fields are supported.
        - `nameParts` string[] — Instead of using "nodes", nesting can be expressed by specifying multiple name parts. A flat table (e.g. csv file) will only contain a single name part for all fields.
        - `required` boolean — Whether the field is required. If not, the field may be null.
        - `tags` string[]
        - `type` string — The data type of the field.
      - `ref` ResourceUrn
        - `catalog` DataCatalog
          - `databases` Database[] — A top-most level of the catalog. This is typically a database.
            - `catalog` DataCatalog — recursive
            - `displayName` string
            - `id` string — The id of the database
            - `processingPlatform` ProcessingPlatform
              - …
            - `schemas` Schema[] — The schemas in this database.
              - …
            - `tags` string[]
            - `type` string
          - `id` string — An arbitrary but unique identifier for the catalog. This matches the id from the PACE app configuration.
          - `tags` string[]
          - `type` 'TYPE_UNSPECIFIED' | 'COLLIBRA' | 'ODD' | 'DATAHUB', enum
        - `integrationFqn` string — the Fully Qualified Name of the data resource on the processing platform / data catalog.
        - `platform` ProcessingPlatform
          - `id` string — An arbitrary but unique identifier for the platform. This matches the id from the PACE app configuration.
          - `platformType` 'PLATFORM_TYPE_UNSPECIFIED' | 'DATABRICKS' | 'SNOWFLAKE' | 'BIGQUERY' | 'POSTGRES' | 'SYNAPSE', enum
        - `resourcePath` ResourceNode[]
          - `displayName` string — human readable string. If absent use name.
          - `isLeaf` boolean — data resource
          - `name` string — the bits between the slashes. the technical path to the data. can be uuid (Collibra for instance)
          - `platformName` string — dataset, schema, table, whatever... For display purposes only. FIXME platform type
      - `tags` string[]

## Response `200`

OK

- TranspileDataPolicyResponse
  - `sql` string — The SQL DDL of all rule sets in the transpiled data policy

## Other responses

- `default` — Default error response

## Changes

- **2024-02-13** `ebae64971b7c` — 1 info
  - added the new `DBT_SQL` enum value to the request property `inlineDataPolicy/ruleSets/items/target/type`
- **2024-01-29** `17f0e5433616` — 1 info
  - endpoint added
- **2023-11-17** `04d64891152e` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/getstrm/apis/pace-api/changes/v1alpha/data-policies/transpile/post.md)

---

[API](https://skmtc.dev/getstrm/apis/pace-api.md) · [All operations](https://skmtc.dev/getstrm/apis/pace-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/getstrm/pace-api/revisions/7102a90e7c1e/schema)
