> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squasher.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Resource History API

> List page-scoped audit events, inspect restorable revisions, and rollback dashboards, automations, monitors, and status pages.

Use the Resource History API to show who changed a specific dashboard, automation, monitor, or status page and to restore a prior revision.

## List audit events

```text theme={null}
GET https://api.squasher.ai/v1/projects/{project_id}/resource-history/events
```

Pass `resource_type`; for per-page history, also pass `resource_id`:

```text theme={null}
?resource_type=dashboard&resource_id={dashboard_id}
```

Supported `resource_type` values:

* `dashboard`
* `automation`
* `monitor`
* `status_page`

Events include the actor, source surface (`dashboard`, `api`, `cli`, `mcp`, `hosted_agent`, `automation`, or `system`), source operation, API key name when available, agent run id, model id when provided, summary, metadata, and timestamp. Clients should label an unnamed or deleted key as `API key`; do not use its key prefix as the actor label.

## List revisions

```text theme={null}
GET https://api.squasher.ai/v1/projects/{project_id}/resource-history/revisions?resource_type=dashboard&resource_id={dashboard_id}
```

Revisions are config snapshots. They are intended for rollback and reapply flows, not runtime telemetry history.

## Roll back a revision

```text theme={null}
POST https://api.squasher.ai/v1/projects/{project_id}/resource-history/revisions/{revision_id}/rollback
```

Rollback restores the selected snapshot and records the rollback as a new audit event and revision.

## Reapply a revision

```text theme={null}
POST https://api.squasher.ai/v1/projects/{project_id}/resource-history/revisions/{revision_id}/reapply
```

Reapply uses the same restore path as rollback, but records the action as `reapplied`.

## Agent attribution

Squasher-trusted internal agent and MCP gateways can send attribution headers so history reads cleanly:

```text theme={null}
x-squasher-source-surface: mcp
x-squasher-source-operation: dashboards.apply
x-squasher-agent-run-id: 11111111-1111-4111-8111-111111111111
x-squasher-agent-model: agent-model-id
```

When these are present on trusted internal requests, the audit log can show flows such as `Jack via MCP` or `Jack via hosted agent`. Public API-key and OAuth requests are recorded as API/CLI callers and cannot claim MCP, hosted-agent, automation, or system attribution through request headers.
