Create a check on the table, view or metric named by subject_type and subject_uuid, or refine the one already carrying the same fingerprint. Re-creating a semantically identical check returns 200 and the existing row, never a duplicate.
Request
- Base URL: https://us.posthog.com
- URL: https://us.posthog.com/api/projects/{project_id}/data_quality_checks/
- Auth: HTTP bearer
Path parameters
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Request body
Why this check exists and what a failure means.
- table - table
- view - view
- metric - metric
- posthog_table - posthog_table
Id of the table, view, metric, or PostHog table to check.
Queryable name of the subject, refreshed on every run.
'orphaned' once the subject stops resolving. Orphaned checks are skipped, not deleted.
Column the check applies to. Omit for table-scoped types like row_count.
- not_null - not_null
- unique - unique
- accepted_values - accepted_values
- relationships - relationships
- row_count - row_count
- freshness - freshness
- custom_sql - custom_sql
Type-specific configuration, validated against the check type's JSON schema.
- error - error
- warn - warn
Disabled checks are never run by any trigger.
Free-form string labels for grouping and filtering.
Email of the human accountable for this check, or null.
When the check last executed.
Outcome of the newest run: passed, failed, errored, skipped, or empty if never run.
When the check last passed. Read failing_since for how long a failing check has been failing. Null means it has not passed within the run retention window.
When the current streak of failing runs started, so a failing check can say how long it has been failing. Null when the check is not failing.
sha256 of the subject, type, column, and config. Re-creating the same check upserts.
- user - user
- ai_generated - ai_generated
Model that generated the check, if AI-authored.
AI author's confidence in the check, 0-1.
AI author's reasoning, surfaced as review context.
Response
Why this check exists and what a failure means.
- table - table
- view - view
- metric - metric
- posthog_table - posthog_table
Id of the table, view, metric, or PostHog table to check.
Queryable name of the subject, refreshed on every run.
'orphaned' once the subject stops resolving. Orphaned checks are skipped, not deleted.
Column the check applies to. Omit for table-scoped types like row_count.
- not_null - not_null
- unique - unique
- accepted_values - accepted_values
- relationships - relationships
- row_count - row_count
- freshness - freshness
- custom_sql - custom_sql
Type-specific configuration, validated against the check type's JSON schema.
- error - error
- warn - warn
Disabled checks are never run by any trigger.
Free-form string labels for grouping and filtering.
Email of the human accountable for this check, or null.
When the check last executed.
Outcome of the newest run: passed, failed, errored, skipped, or empty if never run.
When the check last passed. Read failing_since for how long a failing check has been failing. Null means it has not passed within the run retention window.
When the current streak of failing runs started, so a failing check can say how long it has been failing. Null when the check is not failing.
sha256 of the subject, type, column, and config. Re-creating the same check upserts.
- user - user
- ai_generated - ai_generated
Model that generated the check, if AI-authored.
AI author's confidence in the check, 0-1.
AI author's reasoning, surfaced as review context.
Changes
No recorded changes to this operation across all 1 revision of this API.