---
title: "Compare a candidate PDF against the original it claims to be"
method: POST
path: "/api/v1/compare"
tags: ["Inspect"]
---

# Compare a candidate PDF against the original it claims to be

`POST /api/v1/compare`

## Request

- Base URL: `https://tamperlens.com` (the document declares no server; this is the origin it was published from)
- URL: `https://tamperlens.com/api/v1/compare`
- Auth: none declared

Accepts multipart/form-data with two file fields: `original` (the reference: the file you generated or hold on record) and `candidate` (the file being verified). Returns a CompareReport: byte identity, revision ancestry and structural difference, as facts.

**The three tiers, strongest first.**

1. `relationship: "identical"`: the files hash equal. The only result that is a proof.
2. `"candidate-extends-original"` / `"candidate-truncates-original"`: one file contains the other verbatim up to a revision boundary. PDF edits-in-place append rather than rewrite, so the appended revisions ARE the edit; the report classifies the objects they touch (`ancestry.contentTouched` is the headline fact: page/content/image objects were replaced after the shorter file was complete).
3. `"rewritten"`: neither contains the other. The report degrades honestly to parsed structure: Info/XMP metadata field by field, the /ID pair (permanent half vs per-save half), fonts added/removed, page count and page geometry.

**What it cannot do.** No pages are rendered, so no result asserts the rendered appearance is identical. A `"rewritten"` pair with clean structure is still only structurally clean. Findings are facts with severities, never verdicts.

**Cost.** One comparison parses two documents and is metered as **2 documents** against the monthly quota. Requires an API key (or a dashboard session); there is no anonymous access to this endpoint.

## Response `200`

Default Response

- object

---

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