---
title: "Show what one change did to a page"
method: GET
path: "/api/v1/sites/{slug}/activity/{id}/diff"
tags: ["Draft & publish"]
---

# Show what one change did to a page

`GET /api/v1/sites/{slug}/activity/{id}/diff`

## Request

- Base URL: `https://api.dotsy.ai`
- URL: `https://api.dotsy.ai/api/v1/sites/{slug}/activity/{id}/diff`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

The before and after of one file in one change, as a line diff with 3 lines of context. Pass `key` to pick the file in a change that touched several; it defaults to the first. A page that was created or deleted is compared with an empty body. Each side is read from storage at most 512 KB deep. The diff exists only while the old version is still kept: after that it answers 410.

## Path parameters

- `slug` string, required
- `id` string, required

## Query parameters

- `key` string

## Response `200`

The diff, plus every key of the change and whether it can be undone.

- ActivityDiff
  - `id` string, required
  - `key` string, required: The key `rows` belong to.
  - `keys` object[], required: Every content key of the change, with whether it can be undone.
    - `key` string, required
    - `change` 'created' | 'edited' | 'deleted', required
    - `revertable` boolean, required
    - `reason` 'published_creation' | 'deleted_with_routes' | 'brief' | 'truncated' | 'already_reverted' | 'not_content': Why a change cannot be undone here. `published_creation`: it created a page that is live now (delete the page instead). `deleted_with_routes`: it deleted a page and its routes. `brief`: the site brief has its own rules. `truncated`: too many files. `already_reverted`: it was undone. `not_content`: this event changed no page.
  - `rows` DiffRow[], required: Changed lines with 3 lines of context; `skip` rows stand for the unchanged stretches.
    - `type` 'ctx' | 'add' | 'del' | 'skip', required
    - `text` string, required: The line. Empty on `skip`.
    - `count` integer: On `skip`: how many unchanged lines it stands for.
  - `added` integer, required
  - `removed` integer, required
  - `truncated` boolean, required: A side was over 512 KB (only its head was compared), or the rows were cut at 2,000.
  - `revert` object, required: Whether the whole change can be undone, and the reason when it cannot.
    - `allowed` boolean, required
    - `reason` 'published_creation' | 'deleted_with_routes' | 'brief' | 'truncated' | 'already_reverted' | 'not_content': Why a change cannot be undone here. `published_creation`: it created a page that is live now (delete the page instead). `deleted_with_routes`: it deleted a page and its routes. `brief`: the site brief has its own rules. `truncated`: too many files. `already_reverted`: it was undone. `not_content`: this event changed no page.

## Other responses

- `401`: Missing or invalid credentials.
- `404`: No such site, no such event (`activity_not_found`), or `key` is not part of the change.
- `410`: The old or the new version is no longer kept (`activity_version_gone`).
- `422`: This event has no diff (`activity_no_diff`): it changed no page, or it touched too many files to keep one.

---

[API](https://skmtc.dev/dotsy/apis/dotsy-api.md) · [All operations](https://skmtc.dev/dotsy/apis/dotsy-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dotsy/apis/dotsy-api/revisions/4272ed3b85d7?raw)
