---
title: "Show the words a similar copy would lose"
method: POST
path: "/api/v1/sites/{slug}/shared-sections/compare"
tags: ["Content"]
---

# Show the words a similar copy would lose

`POST /api/v1/sites/{slug}/shared-sections/compare`

## Request

- Base URL: `https://api.dotsy.ai`
- URL: `https://api.dotsy.ai/api/v1/sites/{slug}/shared-sections/compare`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

For one page from analyze's `similar.keys`: each text, link or image that differs from the shared version. Writes nothing.

## Path parameters

- `slug` string, required

## Request body

- CompareSharedSectionRequest
  - `sourceKey` string, required: Content key of the page the element is on, e.g. 'about.html'.
  - `selector` string, required: CSS selector of the element in the page's stored HTML (the editor's selector, or one checked with get_content?selector=). It must match exactly one element.
  - `ifMatch` string: The page's content hash (analyze's sourceEtag). If the page changed since, nothing is written.
  - `key` string, required: A page from analyze's similar.keys: the words it would lose by taking the shared version.

## Response `200`

What differs.

- CompareSharedSectionResult
  - `key` string, required
  - `changes` object[], required
    - `kind` 'text' | 'link' | 'image' | 'attr', required
    - `tag` string, required
    - `before` string, required: This page's own wording, which it would lose.
    - `after` string, required: The shared wording.
  - `more` boolean, required

## Other responses

- `400`: The body or selector is not valid.
- `401`: Missing or invalid credentials.
- `404`: No such site, or the page (`content_not_found`).
- `422`: The element or page can't take part (`not_eligible`, with `reason`), the selector matched 0 or 2+ elements (`unexpected_match_count`), or `selectors` don't sit next to each other in one parent, in page order (`not_siblings`).

---

[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)
