Skip to content

Validation API

GET /v1/validation/tests

List all inferred tests without running them.

bash
curl https://api.onlymetrix.com/v1/validation/tests \
  -H "Authorization: Bearer omx_sk_..."
json
{
  "tests": [
    {
      "metric": "total_revenue",
      "rule": "sum_non_negative",
      "name": "Non-negative values",
      "check": "Sum(revenue_gbp) >= 0",
      "severity": "HIGH",
      "confidence": "high",
      "status": "pending"
    }
  ],
  "count": 22
}

POST /v1/semantic-tests/run

Execute all inferred tests against live warehouse data.

bash
curl -X POST https://api.onlymetrix.com/v1/semantic-tests/run \
  -H "Authorization: Bearer omx_sk_..."
json
{
  "summary": { "total": 22, "passing": 11, "failing": 3, "warning": 0 },
  "tests": [
    {
      "metric": "total_revenue",
      "rule": "sum_non_negative",
      "name": "Non-negative values",
      "severity": "HIGH",
      "confidence": "high",
      "status": "failing",
      "rows_affected": 7901,
      "rows_total": 44876,
      "message": "7901 rows violating (17.6% of 44876)",
      "sample_sql": "SELECT * FROM invoices WHERE total_amount < 0 LIMIT 10"
    }
  ],
  "ran_at": "2026-04-09T12:00:00Z"
}

GET /v1/compiler/ir

Get compiled IR for all metrics. Alias for /v1/compiler/status.

bash
curl https://api.onlymetrix.com/v1/compiler/ir \
  -H "Authorization: Bearer omx_sk_..."

GET /v1/compiler/ir/:name

Get compiled IR for a single metric.

bash
curl https://api.onlymetrix.com/v1/compiler/ir/total_revenue \
  -H "Authorization: Bearer omx_sk_..."
json
{
  "name": "total_revenue",
  "kind": "structured",
  "datasource": "default",
  "measures": [{ "alias": "revenue_gbp", "function": "Sum" }],
  "dimensions": [
    { "name": "country", "source_table": null },
    { "name": "invoice_date", "source_table": null }
  ],
  "joins": []
}

MIT Licensed (SDK) | Proprietary (Server)