---
title: "EvaluateDataPolicy"
method: POST
path: "/v1alpha/data-policies/{data_policy_id}/{platform_id}/evaluate"
tags: ["DataPoliciesService"]
---

# EvaluateDataPolicy

`POST /v1alpha/data-policies/{data_policy_id}/{platform_id}/evaluate`

Evaluates a previously upserted DataPolicy against a provided data sample. Platform-specific data types, transforms
 and nested fields are not supported.

## Path parameters

- `data_policy_id` string, required
- `platform_id` string, required

## Request body

- EvaluateDataPolicyRequest
  - `csvSample` EvaluateDataPolicyRequestCsvSample
    - `csv` string — The CSV-formatted sample data to evaluate the policy against. The first row must be a header row.
  - `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[]
  - `principals` DataPolicyPrincipal[] — Evaluate a data policy for these principals against a sample of data. If left empty, the policy will be evaluated against all principals. In order to evaluate the policy for a principal that does not occur in the policy, add a principal message without the `principal` field set. This will be treated as the `other` principal.
    - `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

## Response `200`

OK

- EvaluateDataPolicyResponse
  - `ruleSetResults` EvaluateDataPolicyResponseRuleSetResult[] — The results of the evaluation, grouped by rule set.
    - `evaluationResults` RuleSetResultEvaluationResult[] — A result is returned for each principal specified in the rule set, as well as the case where there is no matching principal.
      - `csvEvaluation` EvaluationResultCsvEvaluation
        - `csv` string — The result of the evaluation in CSV format, including headers.
      - `principal` DataPolicyPrincipal
        - `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
    - `target` DataPolicyTarget
      - `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
      - `type` 'TARGET_TYPE_UNSPECIFIED' | 'SQL_VIEW' | 'DBT_SQL', enum

## Other responses

- `default` — Default error response

## Changes

- **2024-02-13** `ebae64971b7c` — 1 warning, 1 info
  - added the new `DBT_SQL` enum value to the `ruleSetResults/items/target/allOf[#/components/schemas/DataPolicy_Target]/type` response property for the response status `200`
  - added the new `DBT_SQL` enum value to the request property `inlineDataPolicy/ruleSets/items/target/type`
- **2024-01-29** `48511c3bebbb` — 10 info
  - added the new optional request property `inlineDataPolicy/ruleSets/items/fieldTransforms/items/transforms/items/principals/items/permission`
  - added the new optional request property `inlineDataPolicy/ruleSets/items/fieldTransforms/items/transforms/items/principals/items/role`
  - added the new optional request property `inlineDataPolicy/ruleSets/items/filters/items/genericFilter/conditions/items/principals/items/permission`
  - added the new optional request property `inlineDataPolicy/ruleSets/items/filters/items/genericFilter/conditions/items/principals/items/role`
  - …6 more
- **2024-01-26** `7569cbc2340d` — 2 breaking, 4 warning, 2 info
  - added `#/components/schemas/ResourceUrn` to the `inlineDataPolicy/source/ref` request property `allOf` list
  - the `inlineDataPolicy/source/ref` request property type/format changed from `string`/`` to ``/``
  - removed the request property `inlineDataPolicy/id`
  - removed the request property `inlineDataPolicy/platform`
  - …4 more
- **2023-11-17** `04d64891152e` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/getstrm/apis/pace-api/changes/v1alpha/data-policies/:data_policy_id/:platform_id/evaluate/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)
