> For the complete documentation index, see [llms.txt](https://v2.dataos.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2.dataos.info/references/interfaces/apis/api-reference/quality-and-activity.md).

# Quality & Activity

Data quality rules, deployment plans, and runs.

## Data Quality

Review quality status and inspect rules. Start with the summary; drill into rules when something looks wrong.

***

### GET /api/v1/dq

**Summary:** Quality summary

**Description:** Aggregated pass/fail/warn counts per quality dimension. Pass `as_of_ts` (Unix seconds) for a point-in-time snapshot.

**cURL:**

```bash
curl -s https://$BASE_URL/api/v1/dq \
  -H "Authorization: Bearer $TOKEN"

# Point-in-time snapshot
curl -s "https://$BASE_URL/api/v1/dq?as_of_ts=1716076800" \
  -H "Authorization: Bearer $TOKEN"
```

**Returns:** JSON with `checks_count`, `summary` (pass/fail/warn/total/pass\_rate), and `dimensions` (same breakdown per dimension: accuracy, completeness, etc.).

***

### GET /api/v1/dq/rules

**Summary:** List all quality rules

**Description:** Catalog of all rules with their latest execution results. Each rule includes up to `runs_per_rule` recent executions (default 10).

**Key query params:** `model`, `column`, `dimension`, `runs_per_rule`, `limit`, `offset`

**cURL:**

```bash
curl -s "https://$BASE_URL/api/v1/dq/rules?dimension=completeness&limit=20" \
  -H "Authorization: Bearer $TOKEN"
```

**Returns:** JSON with `rules[]` — each entry has `identity`, `name`, `dimension`, `column`, `model`, `definition`, and a `runs[]` array with recent outcomes (pass/fail/warn).

***

### GET /api/v1/dq/rules/by-name/{model}/{dimension}/{name}

**Summary:** Look up a rule by name

**Description:** Fetch a specific rule by its natural key instead of a hash. Useful when you know the rule name from an alert or report.

**cURL:**

```bash
curl -s "https://$BASE_URL/api/v1/dq/rules/by-name/orders_analytics.users/completeness/row_count_check" \
  -H "Authorization: Bearer $TOKEN"
```

**Returns:** Same structure as `GET /dq/rules/{identity}` — rule definition plus `runs[]` history.

***

### GET /api/v1/dq/rules/{identity}

**Summary:** Fetch rule by identity hash

**Description:** Returns execution history for a single rule, ordered most recent first.

**cURL:**

```bash
curl -s https://$BASE_URL/api/v1/dq/rules/dfabde6e \
  -H "Authorization: Bearer $TOKEN"
```

**Returns:** JSON with `rule` (identity, name, dimension, model, definition) and `runs[]` — each run has `outcome`, `start_ts`, `diagnostics`, and a link to the parent run.

***

## Plans

Plan history and git diffs for each deployment of the data product. A **plan** is a deployment event; one plan can trigger many runs.

***

### GET /api/v1/activity/plans

**Summary:** List deployment plans

**Description:** Returns plans ordered newest first. Filter by model names or success status.

**Key query params:** `model_names`, `success`, `start_ts`, `end_ts`, `limit`, `offset`

**cURL:**

```bash
curl -s "https://$BASE_URL/api/v1/activity/plans?limit=20&offset=0" \
  -H "Authorization: Bearer $TOKEN"

# Failed plans only
curl -s "https://$BASE_URL/api/v1/activity/plans?success=false" \
  -H "Authorization: Bearer $TOKEN"
```

**Returns:** JSON with `plans[]` — each plan has `plan_id`, `environment`, `start_ts`, `end_ts`, `success`, `git_commit_sha`, and a `changes` summary (added/modified/removed model counts).

***

### GET /api/v1/activity/plans/{plan\_id}

**Summary:** Plan detail

**Description:** Full detail on a specific deployment: which models were added, modified, or removed; downstream impact; backfill requirements; and links to adjacent plans.

**cURL:**

```bash
curl -s https://$BASE_URL/api/v1/activity/plans/c8852cdc210e43e4bf261c9983c8f3d6 \
  -H "Authorization: Bearer $TOKEN"
```

**Returns:** Full `Plan` object with `changes` (direct/indirect/added/removed models), `backfills[]`, `errors[]`, and HATEOAS `_links` to previous plan and git diff.

***

### GET /api/v1/activity/plans/{plan\_id}/git-diff

**Summary:** Git diff between plans

**Description:** Code diff between this plan and the previous one in the same environment. Diffs are isolated per environment. Large diffs are truncated at 512KB (`truncated: true`).

**cURL:**

```bash
curl -s https://$BASE_URL/api/v1/activity/plans/c8852cdc210e43e4bf261c9983c8f3d6/git-diff \
  -H "Authorization: Bearer $TOKEN"
```

**Returns:** JSON with `git_diff` (raw diff text), `commits[]` (sha, message, author, authored\_at), `truncated` flag, and `_links` to current and previous plans.

***

## Runs

Run history and per-model execution details for each scheduled or triggered execution. A **run** is an execution event.

***

### GET /api/v1/activity/runs

**Summary:** List execution runs

**Description:** Returns runs ordered newest first. Includes execution metrics, quality check results, and profile stats per run.

**Key query params:** `model_names`, `success`, `start_ts`, `end_ts`, `limit`, `offset`

**cURL:**

```bash
curl -s "https://$BASE_URL/api/v1/activity/runs?limit=20&offset=0" \
  -H "Authorization: Bearer $TOKEN"
```

**Returns:** JSON with `runs[]` — each run has `run_id`, `plan_id`, `start_ts`, `end_ts`, `success`, `models_affected[]`, and optional `quality[]` / `profile[]` arrays.

***

### GET /api/v1/activity/runs/{run\_id}

**Summary:** Run detail

**Description:** Full run record: timing, rows affected, per-model quality checks, and profile stats. Quality and profile fields are `null` if those features weren't enabled for the run.

**cURL:**

```bash
curl -s https://$BASE_URL/api/v1/activity/runs/8b299d19d22342d4a9348140353475e4 \
  -H "Authorization: Bearer $TOKEN"
```

**Returns:** Full `RunDetail` object: `run_id`, `plan_id`, `start_ts/end_ts`, `success`, `models_affected[]` (name, rows\_affected, evaluation\_ms), `errors[]`, `quality[]`, `profile[]`.

***

### GET /api/v1/activity/models

**Summary:** All models with latest run

**Description:** Every model in the data product alongside its most recent run. If a model has never run, the `run` field is `null`. Use this for a model freshness dashboard.

**cURL:**

```bash
curl -s https://$BASE_URL/api/v1/activity/models \
  -H "Authorization: Bearer $TOKEN"
```

**Returns:** JSON with `models[]` — each entry has `model_name` and `run` (the latest `RunDetail`, or `null` if never run).

***

### GET /api/v1/activity/models/{model\_name}/runs

**Summary:** Runs for a specific model

**Description:** Execution history scoped to one model. Note: `start_ts`/`end_ts` are for the full run, not just this model's portion. Returns `404` if the model name doesn't exist in this data product.

**cURL:**

```bash
curl -s "https://$BASE_URL/api/v1/activity/models/orders_analytics.users/runs?limit=10" \
  -H "Authorization: Bearer $TOKEN"
```

**Returns:** JSON with `model_name`, `runs[]` filtered to this model, and pagination.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://v2.dataos.info/references/interfaces/apis/api-reference/quality-and-activity.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
