Skip to main content
POST
/
api
/
dq
/
rules
/
create
Create a custom data quality rule
curl --request POST \
  --url https://api.example.com/api/dq/rules/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "rule_name": "<string>",
  "rule_description": "<string>",
  "sql": "<string>",
  "table": "<string>",
  "success_value": "<string>"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "rule_name": "<string>",
  "rule_description": "<string>",
  "sql": "<string>",
  "accepted": true,
  "table": "<string>",
  "external_id": "<string>",
  "spark_sql": "<string>",
  "success_value": "<string>"
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

Request to create a custom data quality rule.

rule_name
string
required

Name of the data quality rule.

rule_description
string
required

Description of what the rule checks.

sql
string
required

Trino SQL query for validation.

table
string
required

Fully qualified table name this rule applies to.

success_value
string
required

Expected success condition (e.g., 'count = 0', 'value > 95').

Response

Rule created.

id
string<uuid>
required

Unique ID of the data quality rule.

rule_name
string
required

Name of the data quality rule.

rule_description
string
required

Brief explanation of what the rule checks.

sql
string
required

Trino SQL query used to validate the rule.

accepted
boolean
required

Indicates if the rule has been accepted or not.

table
string
required

The database table this rule applies to.

external_id
string | null

Uniform Resource Name (URN) of the assertion in DataHub.

spark_sql
string | null

Spark SQL query of the rule, if applicable.

success_value
string | null

Expected success condition for this rule.