> For the complete documentation index, see [llms.txt](https://developer.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.collibra.com/api/references/dq-product/dq-rule-api.md).

# DQ Rule API

The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions.

## Return a list of all rules and their details

> Returns a list of all dataset rules and their details.\
> Admin (ROLE\_ADMIN) users can access all dataset rules and users without the admin role can only view rules on datasets to which they have dataset access.

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"RuleDTO":{"required":["dataset","perc","points","ruleNm","ruleRepo","ruleType","ruleValue"],"type":"object","properties":{"dataset":{"type":"string"},"ruleNm":{"maxLength":100,"minLength":0,"pattern":"^[a-zA-Z0-9-_]+$","type":"string"},"ruleType":{"type":"string"},"ruleValue":{"type":"string"},"points":{"type":"integer","format":"int32"},"perc":{"type":"number","format":"double"},"ruleRepo":{"type":"string"},"isActive":{"type":"integer","format":"int32"},"userNm":{"type":"string"},"exception":{"type":"string"},"columnName":{"type":"string"},"businessCategory":{"type":"string"},"businessDesc":{"type":"string"},"dimId":{"type":"integer","format":"int32"},"dimName":{"type":"string"},"ruleValueBuilder":{"type":"string"},"previewLimit":{"type":"integer","format":"int32"},"runTimeLimit":{"type":"number","format":"double"},"scoringScheme":{"type":"integer","format":"int32"},"filterQuery":{"type":"string"}}}}},"paths":{"/v3/rules":{"get":{"tags":["DQ Rule API"],"summary":"Return a list of all rules and their details","description":"Returns a list of all dataset rules and their details.\nAdmin (ROLE_ADMIN) users can access all dataset rules and users without the admin role can only view rules on datasets to which they have dataset access.","operationId":"findAll","responses":{"200":{"description":"List of DQ rules","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleDTO"}}}}},"500":{"description":"Error fetching rules","content":{"application/json":{"schema":{"type":"string"}}}}}}}}}
```

## Create or update a rule for a given dataset

> Creates or updates a rule for a given dataset. \
> Pre-authorization requirements: \
> \
> \- \`hasDatasetAccess(#dto.getDataset())\`<br>

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"RuleDTO":{"required":["dataset","perc","points","ruleNm","ruleRepo","ruleType","ruleValue"],"type":"object","properties":{"dataset":{"type":"string"},"ruleNm":{"maxLength":100,"minLength":0,"pattern":"^[a-zA-Z0-9-_]+$","type":"string"},"ruleType":{"type":"string"},"ruleValue":{"type":"string"},"points":{"type":"integer","format":"int32"},"perc":{"type":"number","format":"double"},"ruleRepo":{"type":"string"},"isActive":{"type":"integer","format":"int32"},"userNm":{"type":"string"},"exception":{"type":"string"},"columnName":{"type":"string"},"businessCategory":{"type":"string"},"businessDesc":{"type":"string"},"dimId":{"type":"integer","format":"int32"},"dimName":{"type":"string"},"ruleValueBuilder":{"type":"string"},"previewLimit":{"type":"integer","format":"int32"},"runTimeLimit":{"type":"number","format":"double"},"scoringScheme":{"type":"integer","format":"int32"},"filterQuery":{"type":"string"}}}}},"paths":{"/v3/rules":{"post":{"tags":["DQ Rule API"],"summary":"Create or update a rule for a given dataset","description":"Creates or updates a rule for a given dataset. \nPre-authorization requirements: \n\n- `hasDatasetAccess(#dto.getDataset())`\n","operationId":"create_2","requestBody":{"description":"Rule object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleDTO"}}},"required":true},"responses":{"200":{"description":"Rule upserted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleDTO"}}}},"400":{"description":"Error upserting rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleDTO"}}}},"403":{"description":"Forbidden. No access to dataset","content":{"application/json":{}}}}}}}}
```

## Copy rules from a source dataset and add them to a different target dataset

> Copies rules from a source dataset and adds them to a different target dataset.\
> \*\*Note:\*\* You must have access to both datasets to copy rules successfully.\
> Pre-authorization requirements: \
> \
> \- \`hasDatasetAccess(#sourceDataset)\`<br>

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"RuleCopyDTO":{"required":["sourceDataset","sourceRuleName","targetDataset"],"type":"object","properties":{"sourceDataset":{"type":"string","description":"Source dataset name"},"sourceRuleName":{"type":"string","description":"Source rule name"},"targetDataset":{"type":"string","description":"Target dataset name"},"generatedRuleName":{"type":"string","description":"Target rule name. Generated if not provided"}},"description":"Rule Copy DTO"}}},"paths":{"/v3/rules/{source}/copy":{"post":{"tags":["DQ Rule API"],"summary":"Copy rules from a source dataset and add them to a different target dataset","description":"Copies rules from a source dataset and adds them to a different target dataset.\n**Note:** You must have access to both datasets to copy rules successfully.\nPre-authorization requirements: \n\n- `hasDatasetAccess(#sourceDataset)`\n","operationId":"copyByDataset","parameters":[{"name":"source","in":"path","description":"Source dataset","required":true,"schema":{"type":"string"}},{"name":"target","in":"query","description":"List of target dataset","required":true,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Rules copied successfully to accessible target datasets","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleCopyDTO"}}}}},"400":{"description":"Error copying rules from source to target datasets","content":{"application/json":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden. No access to source dataset","content":{"application/json":{}}}}}}}}
```

## Return a list of rules for a dataset and/or rule

> Returns a list of rules for a given dataset and/or rule name.\
> Pre-authorization requirements: \
> \
> \- \`hasDatasetAccess(#dataset)\`<br>

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"RuleDTO":{"required":["dataset","perc","points","ruleNm","ruleRepo","ruleType","ruleValue"],"type":"object","properties":{"dataset":{"type":"string"},"ruleNm":{"maxLength":100,"minLength":0,"pattern":"^[a-zA-Z0-9-_]+$","type":"string"},"ruleType":{"type":"string"},"ruleValue":{"type":"string"},"points":{"type":"integer","format":"int32"},"perc":{"type":"number","format":"double"},"ruleRepo":{"type":"string"},"isActive":{"type":"integer","format":"int32"},"userNm":{"type":"string"},"exception":{"type":"string"},"columnName":{"type":"string"},"businessCategory":{"type":"string"},"businessDesc":{"type":"string"},"dimId":{"type":"integer","format":"int32"},"dimName":{"type":"string"},"ruleValueBuilder":{"type":"string"},"previewLimit":{"type":"integer","format":"int32"},"runTimeLimit":{"type":"number","format":"double"},"scoringScheme":{"type":"integer","format":"int32"},"filterQuery":{"type":"string"}}}}},"paths":{"/v3/rules/{dataset}":{"get":{"tags":["DQ Rule API"],"summary":"Return a list of rules for a dataset and/or rule","description":"Returns a list of rules for a given dataset and/or rule name.\nPre-authorization requirements: \n\n- `hasDatasetAccess(#dataset)`\n","operationId":"filterByDatasetAndRuleName","parameters":[{"name":"dataset","in":"path","description":"Dataset name","required":true,"schema":{"type":"string"}},{"name":"ruleName","in":"query","description":"(Optional) Rule name. If not provided, all rules for the dataset will be returned","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of DQ rules","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleDTO"}}}}},"403":{"description":"Forbidden. No access to dataset","content":{"application/json":{}}}}}}}}
```

## Create rules for a given dataset

> Creates rules for a given dataset. \
> Pre-authorization requirements: \
> \
> \- \`hasDatasetAccess(#dataset)\`<br>

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"RuleDTO":{"required":["dataset","perc","points","ruleNm","ruleRepo","ruleType","ruleValue"],"type":"object","properties":{"dataset":{"type":"string"},"ruleNm":{"maxLength":100,"minLength":0,"pattern":"^[a-zA-Z0-9-_]+$","type":"string"},"ruleType":{"type":"string"},"ruleValue":{"type":"string"},"points":{"type":"integer","format":"int32"},"perc":{"type":"number","format":"double"},"ruleRepo":{"type":"string"},"isActive":{"type":"integer","format":"int32"},"userNm":{"type":"string"},"exception":{"type":"string"},"columnName":{"type":"string"},"businessCategory":{"type":"string"},"businessDesc":{"type":"string"},"dimId":{"type":"integer","format":"int32"},"dimName":{"type":"string"},"ruleValueBuilder":{"type":"string"},"previewLimit":{"type":"integer","format":"int32"},"runTimeLimit":{"type":"number","format":"double"},"scoringScheme":{"type":"integer","format":"int32"},"filterQuery":{"type":"string"}}}}},"paths":{"/v3/rules/{dataset}":{"post":{"tags":["DQ Rule API"],"summary":"Create rules for a given dataset","description":"Creates rules for a given dataset. \nPre-authorization requirements: \n\n- `hasDatasetAccess(#dataset)`\n","operationId":"create_3","parameters":[{"name":"dataset","in":"path","description":"Dataset name","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"List of RuleDTO objects","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleDTO"}}}},"required":true},"responses":{"200":{"description":"Rules created successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleDTO"}}}}},"400":{"description":"Dataset must be the same for all rules","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleDTO"}}}}},"403":{"description":"Forbidden. No access to dataset","content":{"application/json":{}}}}}}}}
```

## Delete all rules for a given dataset

> Deletes all rules for a given dataset. \
> Pre-authorization requirements: \
> \
> \- \`hasDatasetAccess(#dataset)\`<br>

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v3/rules/{dataset}":{"delete":{"tags":["DQ Rule API"],"summary":"Delete all rules for a given dataset","description":"Deletes all rules for a given dataset. \nPre-authorization requirements: \n\n- `hasDatasetAccess(#dataset)`\n","operationId":"delete","parameters":[{"name":"dataset","in":"path","description":"Dataset name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Rules deleted successfully"},"400":{"description":"Error deleting rules for the given dataset","content":{"application/json":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden. No access to dataset","content":{"application/json":{}}}}}}}}
```

## Validate the syntax of a Pushdown rule

> Validates the syntax of a rule for a given Pushdown dataset, the rule value, and rule type. \
> Pre-authorization requirements: \
> \
> \- \`hasDatasetAccess(#dataset)\`<br>

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v3/rules/{dataset}/validatePushdown":{"post":{"tags":["DQ Rule API"],"summary":"Validate the syntax of a Pushdown rule","description":"Validates the syntax of a rule for a given Pushdown dataset, the rule value, and rule type. \nPre-authorization requirements: \n\n- `hasDatasetAccess(#dataset)`\n","operationId":"validatePushdown","parameters":[{"name":"dataset","in":"path","description":"Dataset name","required":true,"schema":{"type":"string"}},{"name":"ruleValue","in":"query","description":"Rule value","required":true,"schema":{"type":"string"}},{"name":"ruleType","in":"query","description":"Rule type","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Rule syntax is correct","content":{"text/plain":{}}},"400":{"description":"Error validating rule","content":{"text/plain":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden. No access to dataset","content":{"text/plain":{}}}}}}}}
```

## Retrieve the pre-signed URL for rule break records for a given dataset

> Retrieves the pre-signed URL for rule break records for a given dataset. \
> Pre-authorization requirements: \
> \
> \- \`hasDatasetAccess(#dataset)\`<br>

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v3/rules/{dataset}/presignedURLForRuleBreaks":{"post":{"tags":["DQ Rule API"],"summary":"Retrieve the pre-signed URL for rule break records for a given dataset","description":"Retrieves the pre-signed URL for rule break records for a given dataset. \nPre-authorization requirements: \n\n- `hasDatasetAccess(#dataset)`\n","operationId":"getPresignedURLForRuleBreaks","parameters":[{"name":"dataset","in":"path","description":"Dataset name","required":true,"schema":{"type":"string"}},{"name":"runDate","in":"query","description":"Run id","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"ruleName","in":"query","description":"Rule name","required":true,"schema":{"type":"string"}},{"name":"archiveConnectionAlias","in":"query","description":"Archive Connection alias","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Presigned URL for RuleBreak records","content":{"text/plain":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden. No access to dataset","content":{"text/plain":{}}},"404":{"description":"Archive Connection not found for alias","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## Returns the SQL results of a Pushdown rule

> Return the SQL results of a rule for a given Pushdown dataset. \
> Pre-authorization requirements: \
> \
> \- \`hasDatasetAccess(#dataset) and canAccessConnection(#connectionAlias)\`<br>

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v3/rules/run":{"post":{"tags":["DQ Rule API"],"summary":"Returns the SQL results of a Pushdown rule","description":"Return the SQL results of a rule for a given Pushdown dataset. \nPre-authorization requirements: \n\n- `hasDatasetAccess(#dataset) and canAccessConnection(#connectionAlias)`\n","operationId":"run","parameters":[{"name":"dataset","in":"query","description":"Dataset name","required":true,"schema":{"type":"string"}},{"name":"connectionAlias","in":"query","description":"Connection alias","required":true,"schema":{"type":"string"}},{"name":"ruleValue","in":"query","description":"Rule value","required":true,"schema":{"type":"string"}},{"name":"ruleType","in":"query","description":"Rule type","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Rule executed successfully","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Error executing rule","content":{"application/json":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden. No access to dataset or connection","content":{"application/json":{}}}}}}}}
```

## Copy rules from a source dataset and add them to a different target dataset

> Copies rules from a source dataset and adds them to a different target dataset.\*\*Note:\*\* You must have access to both datasets to copy rules successfully

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"RuleCopyDTO":{"required":["sourceDataset","sourceRuleName","targetDataset"],"type":"object","properties":{"sourceDataset":{"type":"string","description":"Source dataset name"},"sourceRuleName":{"type":"string","description":"Source rule name"},"targetDataset":{"type":"string","description":"Target dataset name"},"generatedRuleName":{"type":"string","description":"Target rule name. Generated if not provided"}},"description":"Rule Copy DTO"}}},"paths":{"/v3/rules/copy":{"post":{"tags":["DQ Rule API"],"summary":"Copy rules from a source dataset and add them to a different target dataset","description":"Copies rules from a source dataset and adds them to a different target dataset.**Note:** You must have access to both datasets to copy rules successfully","operationId":"copy","requestBody":{"description":"List of RuleCopyDTO objects","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleCopyDTO"}}}},"required":true},"responses":{"200":{"description":"Rules copied successfully to the target dataset","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleCopyDTO"}}}}},"400":{"description":"User does not have access to any source and target dataset pairs","content":{"application/json":{"schema":{"type":"string"}}}}}}}}}
```

## Retrieve a CSV file containing rule break records of a dataset

> Retrieves a CSV file containing rule break records of a given dataset and rule. \
> Pre-authorization requirements: \
> \
> \- \`hasDatasetAccess(#dataset)\`<br>

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v3/rules/{dataset}/{ruleName}/{runId}/breaks":{"get":{"tags":["DQ Rule API"],"summary":"Retrieve a CSV file containing rule break records of a dataset","description":"Retrieves a CSV file containing rule break records of a given dataset and rule. \nPre-authorization requirements: \n\n- `hasDatasetAccess(#dataset)`\n","operationId":"getBreakRecords","parameters":[{"name":"dataset","in":"path","description":"Dataset name","required":true,"schema":{"type":"string"}},{"name":"ruleName","in":"path","description":"Rule name","required":true,"schema":{"type":"string"}},{"name":"runId","in":"path","description":"Run id","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","description":"Limit number of records","required":false,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"RuleBreak records in CSV file format","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"Forbidden. No access to dataset","content":{"application/octet-stream":{}}},"404":{"description":"Not found","content":{"application/octet-stream":{}}}}}}}}
```

## Retrieve the SQL \`SELECT\` statement for rule break records of a dataset

> Retrieves the SQL \`SELECT\` statement for rule break records of a given dataset. \
> Pre-authorization requirements: \
> \
> \- \`hasDatasetAccess(#dataset)\`<br>

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v3/rules/{dataset}/ruleBreaksSelect":{"get":{"tags":["DQ Rule API"],"summary":"Retrieve the SQL `SELECT` statement for rule break records of a dataset","description":"Retrieves the SQL `SELECT` statement for rule break records of a given dataset. \nPre-authorization requirements: \n\n- `hasDatasetAccess(#dataset)`\n","operationId":"getRuleBreaksSelect","parameters":[{"name":"dataset","in":"path","description":"Dataset name","required":true,"schema":{"type":"string"}},{"name":"tableName","in":"query","description":"Table name","required":true,"schema":{"type":"string"}},{"name":"storageType","in":"query","description":"Storage type","required":false,"schema":{"type":"string","enum":["INTERNAL","EXTERNAL"]}}],"responses":{"200":{"description":"SQL SELECT statement for RuleBreak records","content":{"text/plain":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden. No access to dataset","content":{"text/plain":{}}}}}}}}
```

## Retrieve the SQL \`CREATE TABLE\` statement for rule break records of a ataset

> Retrieves the SQL \`CREATE TABLE\` statement for rule break records of a given dataset. \
> Pre-authorization requirements: \
> \
> \- \`hasDatasetAccess(#dataset)\`<br>

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v3/rules/{dataset}/ruleBreaksCreateTable":{"get":{"tags":["DQ Rule API"],"summary":"Retrieve the SQL `CREATE TABLE` statement for rule break records of a ataset","description":"Retrieves the SQL `CREATE TABLE` statement for rule break records of a given dataset. \nPre-authorization requirements: \n\n- `hasDatasetAccess(#dataset)`\n","operationId":"getRuleBreaksCreateTable","parameters":[{"name":"dataset","in":"path","description":"Dataset name","required":true,"schema":{"type":"string"}},{"name":"archiveConnectionAlias","in":"query","description":"Archive Connection alias","required":true,"schema":{"type":"string"}},{"name":"runDate","in":"query","description":"Run id","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"ruleName","in":"query","description":"Rule name","required":false,"schema":{"type":"string"}},{"name":"delimiter","in":"query","description":"Delimiter","required":false,"schema":{"type":"string","default":","}}],"responses":{"200":{"description":"SQL DDL statement for Rule Break records","content":{"text/plain":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden. No access to dataset","content":{"text/plain":{}}},"404":{"description":"Archive Connection not found for alias","content":{"text/plain":{}}}}}}}}
```

## List the rules of a dataset and/or run date

> Returns a list of rules of a given dataset and/or run date. \
> Pre-authorization requirements: \
> \
> \- \`hasDatasetAccess(#dataset)\`<br>

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"RuleBreaksDTO":{"type":"object","properties":{"dataset":{"type":"string"},"runId":{"type":"string","format":"date-time"},"ruleNm":{"type":"string"},"linkId":{"type":"string"}}}}},"paths":{"/v3/rules/{dataset}/breaks":{"get":{"tags":["DQ Rule API"],"summary":"List the rules of a dataset and/or run date","description":"Returns a list of rules of a given dataset and/or run date. \nPre-authorization requirements: \n\n- `hasDatasetAccess(#dataset)`\n","operationId":"findBreaksByDataset","parameters":[{"name":"dataset","in":"path","description":"Dataset name","required":true,"schema":{"type":"string"}},{"name":"runDate","in":"query","description":"(Optional) Run id. If not provided, all rule breaks for the dataset will be returned","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"List of DQ rule breaks","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleBreaksDTO"}}}}},"403":{"description":"Forbidden. No access to dataset","content":{"application/json":{}}}}}}}}
```

## List all rule definitions

> Returns a list of all rule definitions.\
> Admin (ROLE\_ADMIN) users can access all dataset rules and users without the admin role can only view rules on datasets to which they have dataset access.

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"RuleDefinitionDTO":{"required":["dataset","perc","points","ruleNm","ruleRepo","ruleType","ruleValue"],"type":"object","properties":{"dataset":{"type":"string"},"ruleNm":{"maxLength":100,"minLength":0,"pattern":"^[a-zA-Z0-9-_]+$","type":"string"},"ruleType":{"type":"string"},"ruleValue":{"type":"string"},"points":{"type":"integer","format":"int32"},"perc":{"type":"number","format":"double"},"ruleRepo":{"type":"string"},"isActive":{"type":"integer","format":"int32"},"userNm":{"type":"string"},"exception":{"type":"string"},"columnName":{"type":"string"},"businessCategory":{"type":"string"},"businessDesc":{"type":"string"},"dimId":{"type":"integer","format":"int32"},"dimName":{"type":"string"},"ruleValueBuilder":{"type":"string"},"previewLimit":{"type":"integer","format":"int32"},"runTimeLimit":{"type":"number","format":"double"},"scoringScheme":{"type":"integer","format":"int32"},"filterQuery":{"type":"string"},"dbNm":{"type":"string"},"tableNm":{"type":"string"}}}}},"paths":{"/v3/rules/definitions":{"get":{"tags":["DQ Rule API"],"summary":"List all rule definitions","description":"Returns a list of all rule definitions.\nAdmin (ROLE_ADMIN) users can access all dataset rules and users without the admin role can only view rules on datasets to which they have dataset access.","operationId":"findAllRuleDefs","responses":{"200":{"description":"List of RuleDefinitions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleDefinitionDTO"}}}}},"500":{"description":"Unable to fetch rule definitions","content":{"application/json":{"schema":{"type":"string"}}}}}}}}}
```

## List the rule breaks of a Job ID or UUID

> Return a list of rule breaks of a given job ID or UUID.

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"RuleBreaksDTO":{"type":"object","properties":{"dataset":{"type":"string"},"runId":{"type":"string","format":"date-time"},"ruleNm":{"type":"string"},"linkId":{"type":"string"}}}}},"paths":{"/v3/rules/breaks":{"get":{"tags":["DQ Rule API"],"summary":"List the rule breaks of a Job ID or UUID","description":"Return a list of rule breaks of a given job ID or UUID.","operationId":"findBreaksByJob","parameters":[{"name":"jobId","in":"query","description":"Job ID","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"jobUUID","in":"query","description":"Job UUID","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"List of DQ rule breaks","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleBreaksDTO"}}}}},"403":{"description":"Forbidden. No access to dataset","content":{"application/json":{}}},"404":{"description":"Job not found"},"500":{"description":"Error fetching rule breaks","content":{"application/json":{"schema":{"type":"string"}}}}}}}}}
```

## Delete a rule from a given dataset

> Deletes a rule from a given dataset. \
> Pre-authorization requirements: \
> \
> \- \`hasDatasetAccess(#dataset)\`<br>

```json
{"openapi":"3.0.1","info":{"title":"Collibra DQ Product API","version":"v3"},"tags":[{"name":"DQ Rule API","description":"The DQ Rule API allows you to manage dataset rules, rule breaks, and rule definitions."}],"servers":[{"url":"https://<host-name>","description":"Generated server url"}],"security":[{"bearer-jwt":[]}],"components":{"securitySchemes":{"bearer-jwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v3/rules/{dataset}/{ruleName}":{"delete":{"tags":["DQ Rule API"],"summary":"Delete a rule from a given dataset","description":"Deletes a rule from a given dataset. \nPre-authorization requirements: \n\n- `hasDatasetAccess(#dataset)`\n","operationId":"delete_1","parameters":[{"name":"dataset","in":"path","description":"Dataset name","required":true,"schema":{"type":"string"}},{"name":"ruleName","in":"path","description":"Rule name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Rule deleted successfully"},"400":{"description":"Error deleting rule by name for the given dataset","content":{"application/json":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden. No access to dataset","content":{"application/json":{}}}}}}}}
```
