> 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.12/api-integrations/data-quality-apis/quality-rules.md).

# Quality Rules

## Get quality rule

> Retrieves a single quality rule by its ID.\
> \
> Requires the \*\*'View quality'\*\* permission on the rule's domain, plus the \*\*'Manage confidential business concepts'\*\* permission when the rule is linked to a confidential concept.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/rules/{id}":{"get":{"description":"Retrieves a single quality rule by its ID.\n\nRequires the **'View quality'** permission on the rule's domain, plus the **'Manage confidential business concepts'** permission when the rule is linked to a confidential concept.\n","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

> Updates an existing quality rule.\
> \
> \*\*Request body:\*\*\
> \- \`rule\` (required) – Fields to update; omitted fields are left unchanged.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/rules/{id}":{"put":{"description":"Updates an existing quality rule.\n\n**Request body:**\n- `rule` (required) – Fields to update; omitted fields are left unchanged.\n","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

> Deletes the specified quality rule.\
> \
> Requires the \*\*'Manage rules'\*\* permission on the rule's domain, plus the \*\*'Manage confidential business concepts'\*\* permission when the rule is linked to a confidential concept.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/rules/{id}":{"delete":{"description":"Deletes the specified quality rule.\n\nRequires the **'Manage rules'** permission on the rule's domain, plus the **'Manage confidential business concepts'** permission when the rule is linked to a confidential concept.\n","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

> Updates an existing quality rule.\
> \
> \*\*Request body:\*\*\
> \- \`rule\` (required) – Fields to update; omitted fields are left unchanged.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/rules/{id}":{"patch":{"description":"Updates an existing quality rule.\n\n**Request body:**\n- `rule` (required) – Fields to update; omitted fields are left unchanged.\n","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

> Uploads a CSV file containing quality rules and processes the rows synchronously. Creates or updates the rules within the request itself and returns the created IDs and any per‑row errors directly.\
> \
> \*\*Permissions:\*\*\
> Requires the \*\*'Manage rules'\*\* permission. For each row, the caller must additionally hold the \*\*'Manage rules'\*\* permission on the rule's domain. When the rule is linked to a confidential business concept, the caller must also hold the \*\*'Manage confidential business concepts'\*\* permission on the concept's own domain or on any of its shared domains. Administrators and service accounts are always allowed.\
> \
> \*\*Request body (multipart/form-data):\*\*\
> \- \`rules\` (required, file) – CSV file with the rule definitions.\
> \- \`lang\` (optional, string) – Language for labels and translations during import. Defaults to the server‑configured application language; the API does not read the browser language.\
> \
> \*\*File format:\*\*\
> \- \*\*Type:\*\* CSV, UTF‑8 encoding.\
> \- \*\*Separator:\*\* semicolon (\`;\`).\
> \- \*\*Header row (required, in order):\*\*\
> &#x20; \- \`name\` – Rule name.\
> &#x20; \- \`domain\_external\_id\` – External ID of the rule's domain.\
> &#x20; \- \`description\` – Rule description.\
> &#x20; \- \`template\` – The template's \*\*name\*\* (not the label).\
> \- \*\*Template fields:\*\* After the fixed columns above, the CSV must include one column per template field. Column headers must be the \*\*field names\*\*, not the field labels. The exact set depends on the template referenced by the \`template\` column.\
> \- \*\*Column semantics:\*\*\
> &#x20; \- A column that is \*\*not present\*\* leaves the corresponding field unchanged on update.\
> &#x20; \- A column that is \*\*present but empty\*\* clears the field.\
> \- \*\*Mixing creates and updates:\*\* A single file may contain both new rules and updates to existing ones. A row is treated as an update when a rule with the same \`name\` already exists in the target domain; otherwise a new rule is created.\
> \
> \*\*Behavior:\*\*\
> Rows are validated and persisted within the request. Partial success is possible: valid rows are saved and invalid rows are reported individually. The response contains:\
> \- \`ids\` – List of created or updated rule IDs.\
> \- \`errors\` – Per‑row errors, with the row's identifier where available.\
> \
> If the CSV cannot be parsed (missing header, wrong separator, non‑UTF‑8 content) the endpoint returns \`422 Unprocessable Entity\`. A row may still be reported as an error even if other rows succeed; the response always reflects the per‑row outcome.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/rules/upload":{"post":{"description":"Uploads a CSV file containing quality rules and processes the rows synchronously. Creates or updates the rules within the request itself and returns the created IDs and any per‑row errors directly.\n\n**Permissions:**\nRequires the **'Manage rules'** permission. For each row, the caller must additionally hold the **'Manage rules'** permission on the rule's domain. When the rule is linked to a confidential business concept, the caller must also hold the **'Manage confidential business concepts'** permission on the concept's own domain or on any of its shared domains. Administrators and service accounts are always allowed.\n\n**Request body (multipart/form-data):**\n- `rules` (required, file) – CSV file with the rule definitions.\n- `lang` (optional, string) – Language for labels and translations during import. Defaults to the server‑configured application language; the API does not read the browser language.\n\n**File format:**\n- **Type:** CSV, UTF‑8 encoding.\n- **Separator:** semicolon (`;`).\n- **Header row (required, in order):**\n  - `name` – Rule name.\n  - `domain_external_id` – External ID of the rule's domain.\n  - `description` – Rule description.\n  - `template` – The template's **name** (not the label).\n- **Template fields:** After the fixed columns above, the CSV must include one column per template field. Column headers must be the **field names**, not the field labels. The exact set depends on the template referenced by the `template` column.\n- **Column semantics:**\n  - A column that is **not present** leaves the corresponding field unchanged on update.\n  - A column that is **present but empty** clears the field.\n- **Mixing creates and updates:** A single file may contain both new rules and updates to existing ones. A row is treated as an update when a rule with the same `name` already exists in the target domain; otherwise a new rule is created.\n\n**Behavior:**\nRows are validated and persisted within the request. Partial success is possible: valid rows are saved and invalid rows are reported individually. The response contains:\n- `ids` – List of created or updated rule IDs.\n- `errors` – Per‑row errors, with the row's identifier where available.\n\nIf the CSV cannot be parsed (missing header, wrong separator, non‑UTF‑8 content) the endpoint returns `422 Unprocessable Entity`. A row may still be reported as an error even if other rows succeed; the response always reflects the per‑row outcome.\n","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

> Searches quality rules with the payload as a JSON body, using Elasticsearch.\
> \
> The set of rules returned is filtered by the caller's search permissions on the \`rules\` index. These include \*\*'View quality'\*\*, \*\*'Manage form implementations'\*\*, \*\*'Manage native implementations'\*\*, and \*\*'Manage confidential business concepts'\*\*. A rule is visible if any of these permissions applies on the rule's domain.\
> \
> \*\*Request body:\*\*\
> \- \`page\`, \`size\` (optional) – Same meaning as the query parameters.\
> \- \`filters\`, \`must\`, \`must\_not\` (optional, objects) – Structured Elasticsearch‑style filters. \`filters\` is the default filter container; \`must\` and \`must\_not\` are supported as alternatives.\
> \- Any additional keys supported by the rule query layer (e.g., \`query\`, \`sort\`) may be included.\
> \
> Results are paginated and the response includes the \`x-total-count\` header with the total number of matches. The response also includes a \`user\_permissions\` object indicating whether the caller has the global \*\*'Manage rules'\*\* permission.\
> \
> Service accounts have a default filter applied (\`status = published\`) when no filter is specified, so they only see published rules by default.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/rules/search":{"post":{"description":"Searches quality rules with the payload as a JSON body, using Elasticsearch.\n\nThe set of rules returned is filtered by the caller's search permissions on the `rules` index. These include **'View quality'**, **'Manage form implementations'**, **'Manage native implementations'**, and **'Manage confidential business concepts'**. A rule is visible if any of these permissions applies on the rule's domain.\n\n**Request body:**\n- `page`, `size` (optional) – Same meaning as the query parameters.\n- `filters`, `must`, `must_not` (optional, objects) – Structured Elasticsearch‑style filters. `filters` is the default filter container; `must` and `must_not` are supported as alternatives.\n- Any additional keys supported by the rule query layer (e.g., `query`, `sort`) may be included.\n\nResults are paginated and the response includes the `x-total-count` header with the total number of matches. The response also includes a `user_permissions` object indicating whether the caller has the global **'Manage rules'** permission.\n\nService accounts have a default filter applied (`status = published`) when no filter is specified, so they only see published rules by default.\n","operationId":"TdDqWeb.RuleSearchController.create","parameters":[{"description":"Page number","in":"query","name":"page","required":false,"schema":{"default":0,"type":"integer"}},{"description":"Page size. ","in":"query","name":"size","required":false,"schema":{"default":20,"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

> Returns the quality rules linked to the specified business concept.\
> \
> A rule is returned only if the caller holds the \*\*'View quality'\*\* permission on the rule's domain. When the rule is linked to a confidential business concept, the caller must additionally hold the \*\*'Manage confidential business concepts'\*\* permission on the concept's own domain or on any of its shared domains. Administrators and service accounts see all rules.\
> \
> When the caller holds the \*\*'Manage rules'\*\* permission on at least one of the domains where the concept is defined or shared, the response includes an \`\_actions\` object containing the URL to create a new rule for the concept and the list of manageable domains. Otherwise, \`\_actions\` is not present.\
> \
> The set of manageable domains is computed from the concept's own domain plus its \`shared\_to\_ids\`, filtered by the caller's \*\*'Manage rules'\*\* permission on each.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/rules/concept/{business_concept_id}":{"get":{"description":"Returns the quality rules linked to the specified business concept.\n\nA rule is returned only if the caller holds the **'View quality'** permission on the rule's domain. When the rule is linked to a confidential business concept, the caller must additionally hold the **'Manage confidential business concepts'** permission on the concept's own domain or on any of its shared domains. Administrators and service accounts see all rules.\n\nWhen the caller holds the **'Manage rules'** permission on at least one of the domains where the concept is defined or shared, the response includes an `_actions` object containing the URL to create a new rule for the concept and the list of manageable domains. Otherwise, `_actions` is not present.\n\nThe set of manageable domains is computed from the concept's own domain plus its `shared_to_ids`, filtered by the caller's **'Manage rules'** permission on each.\n","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

> Returns the set of available filter values for quality rule searches, scoped to what the caller is permitted to see.\
> \
> The endpoint is accessible to any caller holding at least one of the following permissions on any domain: \*\*'View quality'\*\*, \*\*'Manage form implementations'\*\*, \*\*'Manage native implementations'\*\*, or \*\*'Manage confidential business concepts'\*\*. The returned filter values are derived from the rules visible to the caller, so the effective scope depends on the union of those permissions.\
> \
> \*\*Request body:\*\*\
> \- \`filters\` (optional, object) – Optional criteria used to narrow the set of filter values returned (for example, restricting by domain or active status).\
> \
> Returns aggregation metadata for the filters, not the rules themselves. No pagination is applied.\
> \
> Two users with different permission sets may receive different filter options for the same request.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/rule_filters/search":{"post":{"description":"Returns the set of available filter values for quality rule searches, scoped to what the caller is permitted to see.\n\nThe endpoint is accessible to any caller holding at least one of the following permissions on any domain: **'View quality'**, **'Manage form implementations'**, **'Manage native implementations'**, or **'Manage confidential business concepts'**. The returned filter values are derived from the rules visible to the caller, so the effective scope depends on the union of those permissions.\n\n**Request body:**\n- `filters` (optional, object) – Optional criteria used to narrow the set of filter values returned (for example, restricting by domain or active status).\n\nReturns aggregation metadata for the filters, not the rules themselves. No pagination is applied.\n\nTwo users with different permission sets may receive different filter options for the same request.\n","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

> Triggers a full reindex of the quality rule search index for the current tenant. The reindex is started asynchronously in the background. The endpoint returns \`202 Accepted\` immediately after the task is queued.\
> \
> \*\*Only administrators\*\* can trigger reindexing.\
> \
> This is a heavy maintenance operation. Search results may be temporarily incomplete while the index is rebuilt.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/rules/search/reindex_all":{"get":{"description":"Triggers a full reindex of the quality rule search index for the current tenant. The reindex is started asynchronously in the background. The endpoint returns `202 Accepted` immediately after the task is queued.\n\n**Only administrators** can trigger reindexing.\n\nThis is a heavy maintenance operation. Search results may be temporarily incomplete while the index is rebuilt.\n","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

> Returns the quality rules visible to the current user, enriched with domain information.\
> \
> Results are filtered to rules the caller can view. Viewing a rule requires the \*\*'View quality'\*\* permission on the rule's domain, plus the \*\*'Manage confidential business concepts'\*\* permission when the rule is linked to a confidential concept. Administrators see all rules; service accounts see all rules.\
> \
> No pagination is applied; the full filtered list is returned. The response includes a \`user\_permissions\` object with a \`manage\_quality\_rules\` flag indicating whether the caller can manage quality rules globally.\
> \
> Because the filter is applied per rule, the effective result set depends on the caller's domain permissions.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/rules":{"get":{"description":"Returns the quality rules visible to the current user, enriched with domain information.\n\nResults are filtered to rules the caller can view. Viewing a rule requires the **'View quality'** permission on the rule's domain, plus the **'Manage confidential business concepts'** permission when the rule is linked to a confidential concept. Administrators see all rules; service accounts see all rules.\n\nNo pagination is applied; the full filtered list is returned. The response includes a `user_permissions` object with a `manage_quality_rules` flag indicating whether the caller can manage quality rules globally.\n\nBecause the filter is applied per rule, the effective result set depends on the caller's domain permissions.\n","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

> Creates a new quality rule.\
> \
> \*\*Request body:\*\*\
> \- \`rule\` (required) – Rule fields. \`name\` and \`domain\_id\` are typically required; other fields depend on the template referenced by \`df\_name\`.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/rules":{"post":{"description":"Creates a new quality rule.\n\n**Request body:**\n- `rule` (required) – Rule fields. `name` and `domain_id` are typically required; other fields depend on the template referenced by `df_name`.\n","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"}}}}
```
