> 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/concepts/foundations/activation/apis/api-reference/activity.md).

# Activity

Track what changed (plans) and what ran (runs). A **plan** is a deployment event; a **run** is an execution 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.

***

## 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/concepts/foundations/activation/apis/api-reference/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.
