Create a new quality rule - Precisely Data Integrity Suite

Data Integrity Suite APIs

Product
Data_Integrity
Spatial_Analytics
Data_Enrichment
geo_addressing_1
Services
Spatial Analytics
Data Enrichment
Geo Addressing
ft:title
Data Integrity Suite APIs
ft:locale
en-US
PublicationType
pt_developer
copyrightfirst
2023
copyrightlast
2026

Creates a new quality rule with the provided details. Returns a status message.

HTML

POST https://hostname/v1/quality/rules

Request

Request body properties

Name Type Required Description
name string Yes Name of the quality rule. Must be unique within the account.
description string No Description of the rule.
dimensionName string Yes

Specifies the data quality dimension the rule addresses and how results are grouped and reported. Valid values: Accuracy, Completeness, Consistency, Timeliness, Uniqueness, Validity.

ruleType string No Specifies the type of rule evaluation logic. Supported values: Expression, Sql. If not provided, the rule is treated as Expression by default.
passCondition object Yes

Defines the logic that determines whether a record passes the rule. This is the core rule logic evaluated by the rule engine.

passCondition.type string Yes

Specifies the condition type. Interpreted based on ruleType (Expression or SQL).

passCondition.config

string Yes

Expression or SQL logic evaluated by the rule. Syntax depends on ruleType.

filterCondition object No Optional pre-filter applied before rule evaluation. Records that do not match this condition are excluded from evaluation.
filterCondition.type string Conditional

Specifies the filter condition type. Required if filterCondition is provided.

filterCondition.config string Conditional Expression or SQL used to filter records before apply the passCondition.
failedCondition object No

Optional condition that explicitly defines failed records. Applicable for SQL rules and uses the same {type, config} structure as passCondition and filterCondition.

failedCondition.type string Conditional

Specifies the failed‑condition type. Required if failedCondition is provided. Interpreted based on ruleType.

failedCondition.config string Conditional Expression or SQL identifying failed records. Evaluated based on ruleType.
isFailedCondition boolean No

Indicates whether the failedCondition should be evaluated. For SQL rules, when failedCondition is provided, this value must be set to true.

captureFailedRecords boolean No

When true, failed records are captured for inspection as part of rule results.

enableAutoRun boolean No

Controls whether the rule is executed automatically based on system conditions. When true, the rule is automatically triggered based on system conditions.

targetingType string Yes

Specifies the scope at which the rule is applied. Determines whether the rule applies at the Field, Dataset, or FieldByCondition level.

targetAssetsFilter

array<string>

Yes

Filter expressions used to select target assets for rule evaluation. Controls which assets the rule applies to.

mappings

array<object>

Yes (if targetingType is Field or Dataset)

Array of mapping objects that define how dataset columns are mapped for rule evaluation. Required when targetingType is Field or Dataset; not required for FieldByCondition.

mappings[].datasetId

string Conditional

Identifier of the dataset used by the rule. Required when mappings is provided.

mappings[].columnMapping

array<object> Conditional

Defines column‑level mappings used to bind rule logic to dataset columns during rule evaluation. Required when mappings is provided.

mappings[].columnMapping[].columnName

string Conditional

Name of the source dataset column referenced by the rule.

mappings[].columnMapping[].dataType

string Conditional

Data type of the column, used by the rule engine during evaluation.

mappings[].columnMapping[].alias

string No

Alias for the column used in expressions to simplify logic.

mappings[].columnMapping[].targetField

string

No

Target field name used internally by the rule engine for rule processing.

Examples of valid rule conditions

The following examples illustrate valid rule conditions using Expression and SQL syntax. They demonstrate function usage and show how rule behavior defaults to Expression when ruleType is not specified.

Example 1 - Default Expression rule

If ruleType is not specified, the rule is treated as an Expression rule by default.
{
  "name": "firstname_not_null",
  "dimensionName": "Completeness",
  "targetingType": "Field",
  "targetAssetsFilter": [
    "properties.CatalogType:eq(Field)"
  ],
  "passCondition": {
    "type": "Expression",
    "config": "FIRSTNAME IS NOT NULL"
   }
}
Example 2 - Explicit Expression rule with function usage
{
  "name": "recent_order_check",
  "ruleType": "Expression",
  "dimensionName": "Timeliness",
  "targetingType": "Dataset",
  "targetAssetsFilter": [
    "properties.CatalogType:eq(Dataset)"
  ],
  "passCondition": {
    "type": "Expression",
    "config": "ORDER_DATE >= TO_DATE('2024-01-01')"
  }
}
Example 3 - SQL rule with date-time function
{
  "name": "active_records_sql_rule",
  "ruleType": "Sql",
  "dimensionName": "Accuracy",
  "targetingType": "Dataset",
  "targetAssetsFilter": [
    "properties.CatalogType:eq(Dataset)"
  ],
  "passCondition": {
    "type": "Sql",
    "config": "SELECT * FROM input WHERE CREATED_TS >= TO_DATETIME('2024-01-01 00:00:00')"
  }
}

Request body property operators

Tables in this section describe operators to be used in specified request body property values.

Table 1. Operators for targetAssetsFilter property setting.

For the targetAssetsFilter property setting, choose from operators in this table.

The eq and ne operators evaluate single values while the in and ni operators evaluate lists.

  • in: value matches any value in a list or set
  • ni: value does not match any value in a list or set
  • eq: equal to
  • ne: not equals to
  • eq("is populated"): contains any value (not null)
  • eq("is not populated"): contains no value (is null)
targetingType value Catalog type Filter Operators
Field Field  
  • For a single field, use the eq operator.
  • For multiple fields, use the in operator
Dataset Dataset  
  • For a single dataset, use the eq operator.
  • For multiple datasets, use the in operator
FilterByCondition Datasource filter = name
  • in
  • ni
Datasource filter = name
  • eq("is populated")
  • eq("is not populated")
Dataset filter = id
  • in
  • ni
Dataset filter = value
  • eq("is populated")
  • eq("is not populated")
Semantic type filter = qualifier
  • eq
  • ne
Semantic type filter = value
  • eq("is populated")
  • eq("is not populated")
Table 2. Operators for passCondition and filterCondition properties.

For passCondition and filterCondition use these operators while formulating a condition into the Natural Language.

For this operation Use this operator
is =
is not !=
is populated IS NOT NULL
is not populated IS NULL
Value in the array values IN
is greater than >=
is greater than or equal to >=
is less than <=
is less than or equals to <=
Date TO_DATE('YYYY-MM-DD'), for example TO_DATE('1990-12-07')
Time TO_TIME('HH:MI:SS'), for example TO_TIME('11:25:31')
Date-time TO_DATETIME('YYYY-MM-DD HH:MI:SS'), for example TO_DATETIME('1990-12-07 11:25:31')

Request example

Example request body for this method is shown below. You can create rules in three ways by setting the targetingType property to Field, Dataset, or FieldByCondition.

Examples
{
  "name": "rule_name",
  "description": "rule_description",
  "dimensionName": "dimension_name",
  "targetAssetsFilter": [
    "properties.CatalogType:eq(Field)&filter=id:eq(asset_id)"
  ],
  "mappings": [
    {
      "datasetId": "dataset_id",
      "columnMapping": [
        {
          "columnName": "column_name",
          "dataType": "string",
          "alias": "column_alias",
          "targetField": "column_name"
        }
      ]
    }
  ],
  "captureFailedRecords": true,
  "enableAutoRun": true,
  "targetingType": "Field",
  "passCondition": {
    "type": "script",
    "config": "condition_expression"
  },
  "filterCondition": {
    "type": "script",
    "config": "filter_expression"
  }
}
{
  "id": "rule_id",
  "name": "rule_name",
  "description": "rule_description",
  "dimensionName": "dimension_name",
  "passCondition": {
    "type": "script",
    "config": "condition_expression"
  },
  "captureFailedRecords": true,
  "enableAutoRun": true,
  "targetingType": "Dataset",
  "targetAssetsFilter": [
    "properties.CatalogType:eq(Dataset)&filter=id:eq(asset_id)"
  ],
  "mappings": [
    {
      "datasetId": "dataset_id",
      "columnMapping": [
        {
          "columnName": "column_name",
          "dataType": "string",
          "alias": "column_alias"
        }
      ]
    }
  ]
}
{
    "name": "rule_name",
    "description": "rule_description",
    "dimensionName": "dimension_name",
    "targetAssetsFilter": [
        "properties.CatalogType:eq(Datasource type)&filter=name:in(dataSource_type)",
        "properties.CatalogType:eq(Datasource)&filter=displayValue:in(dataSource_name)",
        "properties.CatalogType:eq(Dataset)&filter=displayValue:in(dataset_name)",
        "properties.CatalogType:eq(Semantic type)&filter=qualifier:eq(semantic_name)"
    ],
    "captureFailedRecords": true,
    "enableAutoRun": true,
    "targetingType": "FieldByCondition",
    "passCondition": {
        "type": "script",
        "config": "condition_expression"
    },
    "filterCondition": {
        "type": "script",
        "config": "filter_expression"
    }
}
{
  "name": "conditional_field_rule",
  "description": "Apply rule to fields selected dynamically by conditions",
  "dimensionName": "Accuracy",
  "targetAssetsFilter": [
    "properties.CatalogType:eq(Datasource)&filter=displayValue:in(dataSource_name)",
    "properties.CatalogType:eq(Dataset)&filter=displayValue:in(dataset_name)"
  ],
  "captureFailedRecords": true,
  "enableAutoRun": true,
  "targetingType": "FieldByCondition",
  "passCondition": {
    "type": "Expression",
    "config": "VALUE IS NOT NULL"
  },
  "filterCondition": {
    "type": "Expression",
    "config": "STATUS = 'ACTIVE'"
  }
}

Response

The successful response returns the unique identifier for the new quality rule.

Response example

Example status code responses for this method are shown here.

Examples

Rule created successfully.

{
"id":"693eed89aa5bb52e34cc61dd"
}
{
  "type": "about:blank",
  "title": "Bad Request",
  "status": 400,
  "detail": "Invalid rule request - Rule must have a name present",
  "instance": "/v1/quality/rules",
  "errorCode": "DIS-QUALITY-RULES-USR-0006"
}
{
  "type": "about:blank",
  "title": "Internal Server Error",
  "status": 500,
  "detail": "An unexpected error occurred on the server",
  "instance": "/v1/quality/rules",
  "errorCode": "DIS-QUALITY-RULES-SVC-0001"
}