---
title: "Create rules in batch"
method: POST
path: "/data-quality/v1/rules/batch/create"
tags: ["Data Quality Rules"]
---

# Create rules in batch

`POST /data-quality/v1/rules/batch/create`

## Request

- Base URL: `https://your-environment.ataccama.one/api`
- URL: `https://your-environment.ataccama.one/api/data-quality/v1/rules/batch/create`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/ataccama/apis/ataccama-one-agentic-data-trust-platform-public-api/docs/data-quality/v1/rules/batch/create/post.ts> (a function with typed inputs; its response is checked against the schema)

Create up to 100 rules in a single request.

Each item requires `name`, `inputGroups`, and `implementation`. Store each sub-entity under a
temporary key that you choose, such as `new_email`.

Unlike [Create rule](#tag/data-quality-rules/POST/data-quality/v1/rules), batch-created rules skip the draft stage and are created directly as published
versions. Each rule must therefore be complete and meet the publish requirements.

Each item is processed independently: a failure on one item does not cancel the rest. An item that
violates the schema, such as a missing required field, rejects the whole request with `400` instead.
The response is `207 Multi-Status`. It contains a `meta` summary (`total`, `success`, `fail`) and per-item
`results`. On success, a result carries the URN of the created rule (rather than the full body, to
keep the response small) and, in `correlationIds`, the key assigned to each sub-entity the item
created. On failure, it carries the error instead.

By default, results are paired with the request items by position: the first result belongs to the
first item you sent. You can also add your own `id` to each item; the response returns it in the
matching result.

## Request body

- object
  - `data` RuleBatchCreateItemRequest[], required
    - `name` string, required: Human-readable name of the rule. Not unique: multiple rules can share a name. Identify a rule by its URN, never by its name. None of the rule fields is required to create a draft; `name` is required to publish it.
    - `description` string, nullable: Optional description of the rule.
    - `defaultDqThreshold` DqThresholdRequest: Fields shared by a DQ threshold read and create body and its patch body.
      - `severity` string: @ExtensibleEnum Severity assigned to findings triggered by the threshold.
      - `value` integer: Threshold value as a percentage (0-100). If DQ evaluation results in fewer valid records than this percentage, an alert finding is triggered.
      - `correlationId` string: Echo of the temporary key the client used to create this object — the `new_<id>` key sent in the create or patch request. Matches `SubEntityKey`'s temporary-key form exactly: whatever key the client chose comes back verbatim. Returned **only** in the response to the request that created the object, so the client can resolve its temporary key to the server-assigned id, which is the object's key in the response map. Never sent by the client and never present when reading an existing entity. This is a uniform mechanism across the API: every keyed sub-entity collection, on every entity, uses the same temporary-key convention.
    - `stewardship` object, nullable: Stewardship assignment of the rule: an object with the `groupUrn` of the assigned group.
      - `groupUrn` string, uri: A URN identifying a group resource in the IAM API. To find a group's URN, use the Groups endpoints of the IAM API. Format: urn:ata:{tenant}:iam:group:{uuid} Example: urn:ata:acme-corp:iam:group:123e4567-e89b-12d3-a456-426614174000.
    - `inputGroups` object, nullable, required
    - `implementation` object, nullable, required: Fields shared by a rule implementation read and create body and its patch body.
      - `ruleType` string: @ExtensibleEnum The type of DQ evaluation: `SINGLE_TABLE` (per-record evaluation), `AGGREGATION` (aggregates results across records), or `CROSS_TABLE` (evaluates across multiple tables). The default is `SINGLE_TABLE`.
      - `dqDimensionUrn` string, uri: A URN identifying the DQ dimension resource in the Data Quality API. Format: urn:ata:{tenant}:data-quality:dq-dimension:{uuid} Example: urn:ata:acme-corp:data-quality:dq-dimension:123e4567-e89b-12d3-a456-426614174000.
      - `fallback` RuleFallback: Fallback result applied when no condition of a rule matches.
        - `resultUrn` string, uri: A URN identifying the DQ dimension result resource in the Data Quality API. Format: urn:ata:{tenant}:data-quality:dq-dimension-result:{uuid} Example: urn:ata:acme-corp:data-quality:dq-dimension-result:123e4567-e89b-12d3-a456-426614174000.
        - `score` integer: Score assigned when the fallback applies.
        - `explanation` string: Explanation attached to the result when the fallback applies.
      - `conditions` object: The ordered conditions, keyed by their id (UUID) and evaluated in order by the `order` property of each condition. Each condition has an expression and the dimension result assigned when the evaluated data matches the condition. Expressions reference the rule's inputs, parameters, and variables by name.
      - `groupByInputs` object: For `AGGREGATION` rules, defines how records are grouped before the conditions are evaluated, keyed by their id (UUID). Each entry references an input attribute or a variable of the same rule.
    - `parameters` object, nullable: Parameters that configure the rule, keyed by their id (UUID).
    - `variables` object, nullable: Variables derived from inputs and reused within the rule logic, keyed by their id (UUID). A variable is computed either from an expression or by applying transformations to an input attribute.
    - `id` string: Caller-supplied correlation identifier echoed back in the corresponding result item.

## Response `207`

Multi-status batch outcome. Each item in `results` reports its own outcome: `OK` with the
created rule's URN and its `correlationIds` mapping in `data`, or a non-`OK` `status` with
`error`. Inspect `meta` for the success and failure totals.

- object
  - `meta` BatchOperationMeta, required: Summary of a batch operation outcome. Lets clients assess batch health without iterating every item.
    - `total` integer, required: Number of items in the request.
    - `success` integer, required: Number of items with `OK` status.
    - `fail` integer, required: Number of items with non-`OK` status. `success + fail` equals `total`.
  - `results` RuleBatchResultItemResponse[], required
    - union: Outcome of creating a single DQ rule in a batch. On success (`status: OK`), `data` carries the URN of the created (published) rule together with `correlationIds`, resolving each temporary key the request used inside keyed collections to the key the server assigned. On failure, `error` is present. `data` and `error` are mutually exclusive.
      - object
        - `id` string: Echoes the caller-supplied correlation `id` from the corresponding request item, when one was supplied.
        - `status` string, required: @ExtensibleEnum Outcome status. `OK` indicates the rule was created and published; any other value indicates failure and matches the corresponding error `type`.
        - `data` object, required: Present only when `status` is `OK`. Carries the URN of the created published rule and the mapping from the request's temporary keys used inside keyed collections to the keys assigned to the sub-entities they created.
          - `urn` string, uri, required: A URN identifying the data quality rule resource in the Data Quality API. Format: urn:ata:{tenant}:data-quality:rule:{uuid} Example: urn:ata:acme-corp:data-quality:rule:123e4567-e89b-12d3-a456-426614174000.
          - `correlationIds` object: Maps each temporary `new_<id>` key from your request to the key assigned to the sub-entity created under it, so you can resolve your temporary keys to the stored ones. The values are keys, not URNs: sub-entities such as conditions have no URN of their own, and the key is what addresses the sub-entity when you retrieve the rule or update it later. The field is absent when the item created no sub-entities.
        - `error` ProblemDetail
          - `type` string, required: Error type identifier.
          - `title` string, required: Short, human-readable summary of the problem type.
          - `detail` string, required: Detailed specific explanation of the problem.
      - object
        - `id` string: Echoes the caller-supplied correlation `id` from the corresponding request item, when one was supplied.
        - `status` string, required: @ExtensibleEnum Outcome status. `OK` indicates the rule was created and published; any other value indicates failure and matches the corresponding error `type`.
        - `data` object: Present only when `status` is `OK`. Carries the URN of the created published rule and the mapping from the request's temporary keys used inside keyed collections to the keys assigned to the sub-entities they created.
          - `urn` string, uri, required: A URN identifying the data quality rule resource in the Data Quality API. Format: urn:ata:{tenant}:data-quality:rule:{uuid} Example: urn:ata:acme-corp:data-quality:rule:123e4567-e89b-12d3-a456-426614174000.
          - `correlationIds` object: Maps each temporary `new_<id>` key from your request to the key assigned to the sub-entity created under it, so you can resolve your temporary keys to the stored ones. The values are keys, not URNs: sub-entities such as conditions have no URN of their own, and the key is what addresses the sub-entity when you retrieve the rule or update it later. The field is absent when the item created no sub-entities.
        - `error` ProblemDetail, required
          - `type` string, required: Error type identifier.
          - `title` string, required: Short, human-readable summary of the problem type.
          - `detail` string, required: Detailed specific explanation of the problem.

## Other responses

- `400`: Bad request. The request parameters or body are invalid.
- `403`: Forbidden. You do not have permission to access the requested resource.

---

[API](https://skmtc.dev/ataccama/apis/ataccama-one-agentic-data-trust-platform-public-api.md) - [All operations](https://skmtc.dev/ataccama/apis/ataccama-one-agentic-data-trust-platform-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ataccama/apis/ataccama-one-agentic-data-trust-platform-public-api/revisions/46f16e0487f8?raw)
