> For the complete documentation index, see [llms.txt](https://docs.truedat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.truedat.io/v8.8/api-integrations/data-quality-apis/quality-rules.md).

# Quality Rules

## Get quality rule

> Retrieve the specified quality rule by ID if the user has view permission.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/rules/{id}":{"get":{"description":"Retrieve the specified quality rule by ID if the user has view permission.","operationId":"TdDqWeb.RuleController.show","parameters":[{"description":"Rule ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleResponse"}}},"description":"Quality rule response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqForbiddenResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqNotFoundResponse"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Get quality rule","tags":["Quality Rules"]}}},"components":{"schemas":{"RuleResponse":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"active":{"type":"boolean"},"business_concept_id":{"nullable":true,"type":"integer"},"business_concept_name":{"nullable":true,"type":"string"},"current_business_concept_version":{"additionalProperties":true,"nullable":true,"type":"object"},"deleted_at":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"df_content":{"additionalProperties":true,"nullable":true,"type":"object"},"df_name":{"nullable":true,"type":"string"},"domain":{"additionalProperties":false,"nullable":true,"properties":{"external_id":{"nullable":true,"type":"string"},"id":{"type":"integer"},"name":{"type":"string"}},"type":"object"},"domain_id":{"type":"integer"},"dynamic_content":{"additionalProperties":true,"nullable":true,"type":"object"},"id":{"type":"integer"},"inserted_at":{"nullable":true,"type":"string"},"name":{"type":"string"},"updated_at":{"nullable":true,"type":"string"},"updated_by":{"nullable":true,"type":"integer"},"version":{"type":"integer"}},"required":["id","name","domain_id","active","version"],"type":"object"},"user_permissions":{"additionalProperties":false,"properties":{"manage_quality_rules":{"type":"boolean"}},"type":"object"}},"required":["data"],"title":"RuleResponse","type":"object"},"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqForbiddenResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqForbiddenResponse","type":"object"},"TdDqNotFoundResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqNotFoundResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```

## Update quality rule

> Update an existing quality rule using the provided data after permission checks.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/rules/{id}":{"put":{"description":"Update an existing quality rule using the provided data after permission checks.","operationId":"TdDqWeb.RuleController.update","parameters":[{"description":"Rule ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleCreateRequest"}}},"description":"Rule update request","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleResponse"}}},"description":"Quality rule response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqForbiddenResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqNotFoundResponse"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnprocessableEntityResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Update quality rule","tags":["Quality Rules"]}}},"components":{"schemas":{"RuleCreateRequest":{"additionalProperties":false,"properties":{"rule":{"additionalProperties":true,"properties":{"active":{"nullable":true,"type":"boolean"},"business_concept_id":{"nullable":true,"type":"integer"},"description":{"nullable":true,"type":"string"},"df_content":{"additionalProperties":true,"nullable":true,"type":"object"},"df_name":{"nullable":true,"type":"string"},"domain_id":{"nullable":true,"type":"integer"},"name":{"nullable":true,"type":"string"}},"type":"object"}},"required":["rule"],"title":"RuleCreateRequest","type":"object"},"RuleResponse":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"active":{"type":"boolean"},"business_concept_id":{"nullable":true,"type":"integer"},"business_concept_name":{"nullable":true,"type":"string"},"current_business_concept_version":{"additionalProperties":true,"nullable":true,"type":"object"},"deleted_at":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"df_content":{"additionalProperties":true,"nullable":true,"type":"object"},"df_name":{"nullable":true,"type":"string"},"domain":{"additionalProperties":false,"nullable":true,"properties":{"external_id":{"nullable":true,"type":"string"},"id":{"type":"integer"},"name":{"type":"string"}},"type":"object"},"domain_id":{"type":"integer"},"dynamic_content":{"additionalProperties":true,"nullable":true,"type":"object"},"id":{"type":"integer"},"inserted_at":{"nullable":true,"type":"string"},"name":{"type":"string"},"updated_at":{"nullable":true,"type":"string"},"updated_by":{"nullable":true,"type":"integer"},"version":{"type":"integer"}},"required":["id","name","domain_id","active","version"],"type":"object"},"user_permissions":{"additionalProperties":false,"properties":{"manage_quality_rules":{"type":"boolean"}},"type":"object"}},"required":["data"],"title":"RuleResponse","type":"object"},"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqForbiddenResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqForbiddenResponse","type":"object"},"TdDqNotFoundResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqNotFoundResponse","type":"object"},"TdDqUnprocessableEntityResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnprocessableEntityResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```

## Delete quality rule

> Delete the quality rule identified by ID if the current user has deletion permission.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/rules/{id}":{"delete":{"description":"Delete the quality rule identified by ID if the current user has deletion permission.","operationId":"TdDqWeb.RuleController.delete","parameters":[{"description":"Rule ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqForbiddenResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqNotFoundResponse"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Delete quality rule","tags":["Quality Rules"]}}},"components":{"schemas":{"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqForbiddenResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqForbiddenResponse","type":"object"},"TdDqNotFoundResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqNotFoundResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```

## Update quality rule

> Update an existing quality rule using the provided data after permission checks.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/rules/{id}":{"patch":{"description":"Update an existing quality rule using the provided data after permission checks.","operationId":"TdDqWeb.RuleController.update (2)","parameters":[{"description":"Rule ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleCreateRequest"}}},"description":"Rule update request","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleResponse"}}},"description":"Quality rule response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqForbiddenResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqNotFoundResponse"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnprocessableEntityResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Update quality rule","tags":["Quality Rules"]}}},"components":{"schemas":{"RuleCreateRequest":{"additionalProperties":false,"properties":{"rule":{"additionalProperties":true,"properties":{"active":{"nullable":true,"type":"boolean"},"business_concept_id":{"nullable":true,"type":"integer"},"description":{"nullable":true,"type":"string"},"df_content":{"additionalProperties":true,"nullable":true,"type":"object"},"df_name":{"nullable":true,"type":"string"},"domain_id":{"nullable":true,"type":"integer"},"name":{"nullable":true,"type":"string"}},"type":"object"}},"required":["rule"],"title":"RuleCreateRequest","type":"object"},"RuleResponse":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"active":{"type":"boolean"},"business_concept_id":{"nullable":true,"type":"integer"},"business_concept_name":{"nullable":true,"type":"string"},"current_business_concept_version":{"additionalProperties":true,"nullable":true,"type":"object"},"deleted_at":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"df_content":{"additionalProperties":true,"nullable":true,"type":"object"},"df_name":{"nullable":true,"type":"string"},"domain":{"additionalProperties":false,"nullable":true,"properties":{"external_id":{"nullable":true,"type":"string"},"id":{"type":"integer"},"name":{"type":"string"}},"type":"object"},"domain_id":{"type":"integer"},"dynamic_content":{"additionalProperties":true,"nullable":true,"type":"object"},"id":{"type":"integer"},"inserted_at":{"nullable":true,"type":"string"},"name":{"type":"string"},"updated_at":{"nullable":true,"type":"string"},"updated_by":{"nullable":true,"type":"integer"},"version":{"type":"integer"}},"required":["id","name","domain_id","active","version"],"type":"object"},"user_permissions":{"additionalProperties":false,"properties":{"manage_quality_rules":{"type":"boolean"}},"type":"object"}},"required":["data"],"title":"RuleResponse","type":"object"},"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqForbiddenResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqForbiddenResponse","type":"object"},"TdDqNotFoundResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqNotFoundResponse","type":"object"},"TdDqUnprocessableEntityResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnprocessableEntityResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```

## Upload quality rules CSV

> Upload a CSV file containing quality rules and process the records for ingestion.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/rules/upload":{"post":{"description":"Upload a CSV file containing quality rules and process the records for ingestion.","operationId":"TdDqWeb.RuleUploadController.create","parameters":[],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/RuleUploadRequest"}}},"description":"Rule upload request","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleUploadResponse"}}},"description":"Rule upload response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqForbiddenResponse"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnprocessableEntityResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Upload quality rules CSV","tags":["Quality Rules"]}}},"components":{"schemas":{"RuleUploadRequest":{"properties":{"rules":{"format":"binary","type":"string"}},"required":["rules"],"title":"RuleUploadRequest","type":"object"},"RuleUploadResponse":{"properties":{"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"ids":{"items":{"type":"integer"},"type":"array"}},"title":"RuleUploadResponse","type":"object"},"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqForbiddenResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqForbiddenResponse","type":"object"},"TdDqUnprocessableEntityResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnprocessableEntityResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```

## Search quality rules

> Search quality rules using the request payload and return paginated results.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/rules/search":{"post":{"description":"Search quality rules using the request payload and return paginated results.","operationId":"TdDqWeb.RuleSearchController.create","parameters":[{"description":"Page number","in":"query","name":"page","required":false,"schema":{"type":"integer"}},{"description":"Page size","in":"query","name":"size","required":false,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleSearchRequest"}}},"description":"Rule search request","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleSearchResponse"}}},"description":"Rule search response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Search quality rules","tags":["Quality Rules"]}}},"components":{"schemas":{"RuleSearchRequest":{"additionalProperties":false,"properties":{"filters":{"additionalProperties":true,"description":"Search filters","nullable":true,"properties":{"active":{"description":"Filter by active status","items":{"type":"boolean"},"type":"array"},"business_concept_id":{"description":"Filter by business concept ID","items":{"type":"integer"},"type":"array"},"domain_id":{"description":"Filter by domain ID","items":{"type":"integer"},"type":"array"},"system":{"description":"Filter by system","items":{"type":"string"},"type":"array"}},"type":"object"},"must":{"additionalProperties":true,"nullable":true,"type":"object"},"must_not":{"additionalProperties":true,"nullable":true,"type":"object"},"page":{"default":0,"description":"Page number","minimum":0,"type":"integer"},"size":{"default":20,"description":"Page size","minimum":1,"type":"integer"}},"title":"RuleSearchRequest","type":"object"},"RuleSearchResponse":{"additionalProperties":false,"properties":{"data":{"items":{"additionalProperties":false,"properties":{"active":{"type":"boolean"},"business_concept_id":{"nullable":true,"type":"integer"},"business_concept_name":{"nullable":true,"type":"string"},"current_business_concept_version":{"additionalProperties":true,"nullable":true,"type":"object"},"deleted_at":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"df_content":{"additionalProperties":true,"nullable":true,"type":"object"},"df_name":{"nullable":true,"type":"string"},"domain":{"additionalProperties":false,"nullable":true,"properties":{"external_id":{"nullable":true,"type":"string"},"id":{"type":"integer"},"name":{"nullable":true,"type":"string"}},"type":"object"},"domain_id":{"nullable":true,"type":"integer"},"dynamic_content":{"additionalProperties":true,"nullable":true,"type":"object"},"id":{"type":"integer"},"inserted_at":{"nullable":true,"type":"string"},"name":{"type":"string"},"updated_at":{"nullable":true,"type":"string"},"updated_by":{"additionalProperties":true,"nullable":true,"type":"object"},"version":{"type":"integer"}},"required":["id","name","active","version"],"type":"object"},"type":"array"},"filters":{"additionalProperties":true,"type":"object"},"user_permissions":{"additionalProperties":false,"properties":{"manage_quality_rules":{"type":"boolean"}},"type":"object"}},"required":["data"],"title":"RuleSearchResponse","type":"object"},"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```

## List quality rules by business concept

> Retrieve quality rules filtered by the specified business concept and authorize access where applicable.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/rules/concept/{business_concept_id}":{"get":{"description":"Retrieve quality rules filtered by the specified business concept and authorize access where applicable.","operationId":"TdDqWeb.RuleController.get_rules_by_concept","parameters":[{"description":"Business concept ID","in":"path","name":"business_concept_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleIndexResponse"}}},"description":"Quality rules response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List quality rules by business concept","tags":["Quality Rules"]}}},"components":{"schemas":{"RuleIndexResponse":{"additionalProperties":false,"properties":{"_actions":{"additionalProperties":true,"nullable":true,"type":"object"},"_managable_domain_ids":{"items":{"additionalProperties":true,"type":"object"},"nullable":true,"type":"array"},"data":{"items":{"additionalProperties":false,"properties":{"active":{"type":"boolean"},"business_concept_id":{"nullable":true,"type":"integer"},"business_concept_name":{"nullable":true,"type":"string"},"deleted_at":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"df_content":{"additionalProperties":true,"nullable":true,"type":"object"},"df_name":{"nullable":true,"type":"string"},"domain":{"additionalProperties":false,"nullable":true,"properties":{"external_id":{"nullable":true,"type":"string"},"id":{"type":"integer"},"name":{"type":"string"}},"type":"object"},"domain_id":{"type":"integer"},"dynamic_content":{"additionalProperties":true,"nullable":true,"type":"object"},"id":{"type":"integer"},"inserted_at":{"nullable":true,"type":"string"},"name":{"type":"string"},"updated_at":{"nullable":true,"type":"string"},"updated_by":{"nullable":true,"type":"integer"},"version":{"type":"integer"}},"required":["id","name","domain_id","active","version"],"type":"object"},"type":"array"},"user_permissions":{"additionalProperties":false,"properties":{"manage_quality_rules":{"type":"boolean"}},"type":"object"}},"required":["data"],"title":"RuleIndexResponse","type":"object"},"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```

## Get rule filters

> Return the available filter values for quality rule searches.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/rule_filters/search":{"post":{"description":"Return the available filter values for quality rule searches.","operationId":"TdDqWeb.RuleFilterController.search","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterSearchRequest"}}},"description":"Filter search request","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterSearchResponse"}}},"description":"Filter response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqForbiddenResponse"}}},"description":"Forbidden"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Get rule filters","tags":["Quality Rules"]}}},"components":{"schemas":{"FilterSearchRequest":{"additionalProperties":false,"properties":{"filters":{"additionalProperties":true,"description":"Filter criteria (e.g., domain_id, status, etc.)","type":"object"}},"title":"FilterSearchRequest","type":"object"},"FilterSearchResponse":{"properties":{"filters":{"additionalProperties":true,"type":"object"}},"title":"FilterSearchResponse","type":"object"},"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqForbiddenResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqForbiddenResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```

## Reindex quality rule search

> Trigger a full reindex of the quality rule search index for the current tenant.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/rules/search/reindex_all":{"get":{"description":"Trigger a full reindex of the quality rule search index for the current tenant.","operationId":"TdDqWeb.RuleSearchController.reindex","parameters":[],"responses":{"202":{"description":"Accepted"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Reindex quality rule search","tags":["Quality Rules"]}}},"components":{"schemas":{"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```

## List quality rules

> Retrieve all quality rules visible to the current user and include domain enrichment.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/rules":{"get":{"description":"Retrieve all quality rules visible to the current user and include domain enrichment.","operationId":"TdDqWeb.RuleController.index","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleIndexResponse"}}},"description":"Quality rules response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqForbiddenResponse"}}},"description":"Forbidden"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List quality rules","tags":["Quality Rules"]}}},"components":{"schemas":{"RuleIndexResponse":{"additionalProperties":false,"properties":{"_actions":{"additionalProperties":true,"nullable":true,"type":"object"},"_managable_domain_ids":{"items":{"additionalProperties":true,"type":"object"},"nullable":true,"type":"array"},"data":{"items":{"additionalProperties":false,"properties":{"active":{"type":"boolean"},"business_concept_id":{"nullable":true,"type":"integer"},"business_concept_name":{"nullable":true,"type":"string"},"deleted_at":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"df_content":{"additionalProperties":true,"nullable":true,"type":"object"},"df_name":{"nullable":true,"type":"string"},"domain":{"additionalProperties":false,"nullable":true,"properties":{"external_id":{"nullable":true,"type":"string"},"id":{"type":"integer"},"name":{"type":"string"}},"type":"object"},"domain_id":{"type":"integer"},"dynamic_content":{"additionalProperties":true,"nullable":true,"type":"object"},"id":{"type":"integer"},"inserted_at":{"nullable":true,"type":"string"},"name":{"type":"string"},"updated_at":{"nullable":true,"type":"string"},"updated_by":{"nullable":true,"type":"integer"},"version":{"type":"integer"}},"required":["id","name","domain_id","active","version"],"type":"object"},"type":"array"},"user_permissions":{"additionalProperties":false,"properties":{"manage_quality_rules":{"type":"boolean"}},"type":"object"}},"required":["data"],"title":"RuleIndexResponse","type":"object"},"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqForbiddenResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqForbiddenResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```

## Create quality rule

> Create a new quality rule from the provided payload after authorization.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/rules":{"post":{"description":"Create a new quality rule from the provided payload after authorization.","operationId":"TdDqWeb.RuleController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleCreateRequest"}}},"description":"Rule creation request","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleResponse"}}},"description":"Quality rule response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqForbiddenResponse"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnprocessableEntityResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create quality rule","tags":["Quality Rules"]}}},"components":{"schemas":{"RuleCreateRequest":{"additionalProperties":false,"properties":{"rule":{"additionalProperties":true,"properties":{"active":{"nullable":true,"type":"boolean"},"business_concept_id":{"nullable":true,"type":"integer"},"description":{"nullable":true,"type":"string"},"df_content":{"additionalProperties":true,"nullable":true,"type":"object"},"df_name":{"nullable":true,"type":"string"},"domain_id":{"nullable":true,"type":"integer"},"name":{"nullable":true,"type":"string"}},"type":"object"}},"required":["rule"],"title":"RuleCreateRequest","type":"object"},"RuleResponse":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"active":{"type":"boolean"},"business_concept_id":{"nullable":true,"type":"integer"},"business_concept_name":{"nullable":true,"type":"string"},"current_business_concept_version":{"additionalProperties":true,"nullable":true,"type":"object"},"deleted_at":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"df_content":{"additionalProperties":true,"nullable":true,"type":"object"},"df_name":{"nullable":true,"type":"string"},"domain":{"additionalProperties":false,"nullable":true,"properties":{"external_id":{"nullable":true,"type":"string"},"id":{"type":"integer"},"name":{"type":"string"}},"type":"object"},"domain_id":{"type":"integer"},"dynamic_content":{"additionalProperties":true,"nullable":true,"type":"object"},"id":{"type":"integer"},"inserted_at":{"nullable":true,"type":"string"},"name":{"type":"string"},"updated_at":{"nullable":true,"type":"string"},"updated_by":{"nullable":true,"type":"integer"},"version":{"type":"integer"}},"required":["id","name","domain_id","active","version"],"type":"object"},"user_permissions":{"additionalProperties":false,"properties":{"manage_quality_rules":{"type":"boolean"}},"type":"object"}},"required":["data"],"title":"RuleResponse","type":"object"},"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqForbiddenResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqForbiddenResponse","type":"object"},"TdDqUnprocessableEntityResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnprocessableEntityResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```
