---
title: "Create Referential Check"
method: POST
path: "/api/v1/sdk/referential/{asset_id}"
tags: ["public-api", "public-referential"]
---

# Create Referential Check

`POST /api/v1/sdk/referential/{asset_id}`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/v1/sdk/referential/{asset_id}`
- Auth: none declared

Create a new referential integrity check.

Requires read-write or admin scope.
Accepts asset UUID, qualified name (e.g., "postgresql.mydb"), or asset name.

**SDK Usage:**
```python
from anomalyarmor import Client
client = Client()
check = client.referential.create(
    "asset-uuid",
    child_table_path="catalog.schema.orders",
    child_column_name="customer_id",
    parent_table_path="catalog.schema.customers",
    parent_column_name="id",
)
```

## Path parameters

- `asset_id` string, required

## Headers

- `Authorization` string

## Request body

- ReferentialCheckCreate: Request schema for creating a referential integrity check. Validates FK relationships between child and parent tables. Note: asset_id is extracted from the URL path, not the request body.
  - `child_table_path` string, required: Fully qualified child table path
  - `child_column_name` string, required: FK column in child table
  - `parent_table_path` string, required: Fully qualified parent table path
  - `parent_column_name` string, required: PK column in parent table
  - `name` string, nullable: Friendly name
  - `description` string, nullable: Optional description
  - `capture_interval` string: Capture interval (hourly, daily, weekly, or cron)
  - `max_orphan_count` integer, nullable: Alert if orphan count exceeds this value
  - `max_orphan_percent` union: Alert if orphan percentage exceeds this value (0-100)
    - number
    - string
  - `min_child_count` integer, nullable: Each parent should have at least this many children
  - `max_child_count` integer, nullable: Each parent should have at most this many children

## Response `201`

Successful Response

- StandardResponse: Standard API response wrapper.
  - `success` boolean, required
  - `data` unknown
  - `message` string, nullable
  - `error` string, nullable
  - `meta` object, nullable

## Other responses

- `422`: Validation Error

---

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