Skip to content

Expected Values Check API

The Expected Values check is created and managed through the standard Quality Checks API by setting rule to expectedValues, listing one field under fields, and providing the allowed vocabulary in properties.list.

Tip

For complete API documentation, including request and response schemas, visit the API docs.

Endpoints

Method Path Purpose
POST /api/quality-checks Create a new Expected Values check.
GET /api/quality-checks/{id} Retrieve an Expected Values check by ID.
PUT /api/quality-checks/{id} Update an existing Expected Values check.
DELETE /api/quality-checks/{id} Delete (or archive) an Expected Values check.

Permission: Requires Author team permission (or above) for POST, PUT, and DELETE; Reporter team permission (or above) for GET.

Payload Example

Create an Expected Values check on o_orderstatus with POST /api/quality-checks, showing every field accepted by the create endpoint:

{
    "description": "Order status must be O, F, or P",
    "rule": "expectedValues",
    "fields": ["o_orderstatus"],
    "container_id": 145,
    "coverage": 1,
    "filter": null,
    "properties": {"list": ["O", "F", "P"]},
    "tags": ["enum", "orders"],
    "additional_metadata": {"jira": "DATA-1101"},
    "anomaly_message_field": null,
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 18
}

Field Notes

Field Required Notes
description Yes Free-text description shown in the UI.
rule Yes Must be "expectedValues".
fields Yes Array with exactly one field name. Expected Values is a single-field rule.
container_id Yes ID of the container (table or file) the check runs against.
coverage No Fractional value between 0 and 1. 1 (default) emits Record Anomalies for each failing row; < 1 rolls failures into a single Shape Anomaly when the failing fraction exceeds the threshold.
filter No Spark SQL WHERE expression. Applied before the value comparison, so only filtered rows are evaluated. Send null for no filter.
properties.list Yes Array of accepted values. The list type is inferred from its contents: all-numeric → numeric list; all-boolean → boolean list; otherwise string list. Match the list type to the field type to avoid every row failing on type coercion.
properties.is_element_context No Set to true to evaluate each element of an array field against the list (uses array_forall). Auto-enabled by the platform for Array[String] fields. Only string element lists are supported today.
tags No List of tag names applied to the check for filtering and organization.
additional_metadata No Free-form key-value pairs (typically links to catalog, tickets, governance records).
anomaly_message_field No Name of a source-record field whose value should be used as the anomaly message instead of the system-generated one. In the UI this corresponds to the Custom Anomaly Description toggle. Applies to Record Anomalies (coverage = 1); ignored for Shape Anomalies.
template_id No ID of a Check Template to associate the check with. null if not using a template.
status No "Active" (default) or "Draft". Draft checks are not evaluated by Scans.
owner_id No ID of the user who owns the check. Defaults to the user creating the check when omitted.
default_anomaly_assignee_id No ID of the user automatically assigned to anomalies produced by the check.