---
title: "Create Referential Check"
method: POST
path: "/api/v1/assets/{asset_id}/referential-checks"
tags: ["metrics"]
---

# Create Referential Check

`POST /api/v1/assets/{asset_id}/referential-checks`

## Request

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

Create a new referential integrity check for an asset.

## Path parameters

- `asset_id` string, uuid, 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)
