---
title: "Upsert data quality rules for a workflow"
method: PUT
path: "/v4/workflows/{workflowId}/schema-validation-rules"
tags: ["Data Quality"]
---

# Upsert data quality rules for a workflow

`PUT /v4/workflows/{workflowId}/schema-validation-rules`

## Request

- Base URL: `https://api.kadoa.com`
- URL: `https://api.kadoa.com/v4/workflows/{workflowId}/schema-validation-rules`
- Auth: API key in header `x-api-key`

Patch-merge the per-field data quality rules persisted on the workflow. Fields included in the
request body replace any existing rules for those fields; fields not included are left untouched.
To remove a field's rules, call the corresponding `DELETE` endpoint instead.
Rule edits take effect on the next workflow run.

## Path parameters

- `workflowId` string, required

## Request body

- WorkflowSchemaValidationRules: Map keyed by schema field name, with the per-field data quality rules for that field.

## Response `200`

Rules updated successfully. Returns the merged ruleset.

- object
  - `rules` WorkflowSchemaValidationRules, required: Map keyed by schema field name, with the per-field data quality rules for that field.

## Other responses

- `400`: Invalid workflow ID or invalid rule payload
- `401`: Unauthorized
- `404`: Workflow not found
- `500`: Internal server error

---

[API](https://skmtc.dev/kadoa/apis/kadoa-api.md) · [All operations](https://skmtc.dev/kadoa/apis/kadoa-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kadoa/apis/kadoa-api/revisions/bf7803c927b4?raw)
