API docs
A hosted HTTP API. Authenticate with your x-api-key, call embed before you deliver a copy, and call extract when a copy surfaces.
Getting started
Each key is scoped to one product and metered monthly. Keys are issued when you buy a plan or start a pilot: you receive a one-time link, open it, and the key is shown once. Store it like a password. A lost key is re-issued, not recovered.
All requests go to https://api.tracereceipt.com and carry the key in a header:
x-api-key: pk_live_xxxxxxxx
content-type: application/jsonNever put your API key in a browser or a mobile app. Call the API from your server.
Images
Issue a marked copy
Call this for every image before it reaches a specific recipient, and deliver the copy it returns.
curl -X POST https://api.tracereceipt.com/sdk/v1/watermark/embed \
-H "x-api-key: $KEY" \
-H "content-type: application/json" \
-d '{"image_b64":"'"$(base64 -w0 photo.jpg)"'","recipient_id":"user-42","content_id":"launch-teaser"}'{
"watermarked_image_b64": "...",
"fingerprint": "a4b2...",
"recipient_id": "user-42"
}Find whose copy leaked
{ "image_b64": "<base64 of the leaked image or screenshot>" }{
"status": "detected",
"found": true,
"recipient_id": "user-42",
"content_id": "launch-teaser",
"issued_at": "2026-11-19T10:04:11Z",
"content_match": true,
"evidence": { ... }
}recipient_id is your own id, exactly as you sent it. Nothing needs to be stored on your side.
Documents
PDF, Word, PowerPoint, Excel, plain text and Markdown, up to 25 MB. The format is detected from the content.
{
"document_b64": "<base64 of the file>",
"filename": "board-pack.pdf",
"recipient_id": "user-42",
"content_id": "q3-board-pack"
}{
"document_b64": "...",
"filename": "board-pack.watermarked.pdf",
"mime_type": "application/pdf",
"layers": [ ... ], // the protections applied to this copy
"pages": 12,
"units_charged": 12
}What a protected document survives
| How it leaks | Formats |
|---|---|
| Screenshot of a page in a viewer: zoomed, scrolled, off-centre, PNG or JPEG | |
| Forwarding the file; opening, editing and saving it | PDF, DOCX, PPTX, XLSX |
| Copying the text into email, chat or another document | DOCX, PPTX, TXT, MD |
PDF copies protected against screenshots look the same, but their text can't be selected or searched. PDFs are billed per page, up to 50 per request by default (max_pages up to 100). Password-protected PDFs are refused. Excel copies are protected without changing any cell data.
Find the source
Send whichever form the leak took:
{ "document_b64": "<base64 of the leaked file>" }
{ "text": "<text pasted from wherever it leaked>" }
{ "image_b64": "<base64 screenshot of a page>" }For PDFs, up to the first 3 pages are checked by default (scan_pages up to 10). evidence.pages_scanned shows the result for each page, and evidence.geometry says where a page was found inside a screenshot.
- Page screenshots taken at 50%, 70% and 100% zoom, scrolled, off-centre, as PNG or JPEG, in a dark or light viewer, and phone-sized screenshots have all been attributed.
- A screenshot from a light-theme viewer takes about 50 seconds to scan.
- Pages issued before 19 November 2026 are still read from the file itself, but not from screenshots.
- Phone photos of a page and print-and-scan are not covered yet.
Lists supported formats and limits.
Video and audio
Video up to 50 MB and audio up to 25 MB, billed one unit per started 5 MB. Audio needs at least about five seconds.
curl -H "x-api-key: $KEY" \
-F [email protected] -F recipient_id=editor-7 -F content_id=ep-12 \
-F response=binary -o clip.editor-7.mp4 \
https://api.tracereceipt.com/sdk/v1/video/embedWith response=binary the marked file comes back directly, with the attribution in the x-tracereceipt-recipient-id, x-tracereceipt-content-id, x-tracereceipt-fingerprint and x-tracereceipt-units-charged headers. Otherwise you get JSON with media_b64.
curl -H "x-api-key: $KEY" -F [email protected] https://api.tracereceipt.com/sdk/v1/video/extractA public post that everyone sees carries one mark for everyone, so it identifies the post, not a person. Per-person attribution needs a separate copy per person.
Web app screens
For dashboards, portals and AI answers that only ever appear on screen. A small script gives each viewer an imperceptible mark of their own, so a screenshot can later be traced to the viewer who took it. It does not block screenshots; nothing in a browser can.
1. Your server mints a short-lived viewer token
{ "recipient_id": "user-42", "content_id": "dashboard", "ttl_seconds": 900 }Tokens last 15 minutes by default and at most an hour.
2. The page starts protection with that token
TraceReceiptProtect.start({
endpoint: "https://api.tracereceipt.com",
token: viewerToken, // from your server, never your API key
getToken: () => fetch("/viewer-token").then((r) => r.text()),
sessionId: myAuditLogId, // optional, joins results to your logs
onError: (err) => console.warn(err.code, err.status),
});The browser script is supplied to pilot customers. Your API key never goes to the browser. The page authenticates with the viewer token alone, so a viewer cannot create a mark naming a colleague.
3. Scan a leaked screenshot
Send the screenshot to /sdk/v1/watermark/extract as above. The result names the viewer's recipient id and the content id from the token.
Script errors
| code | Meaning | What to do |
|---|---|---|
viewport_too_small | The window is under about 1000×750 device pixels and can't carry the mark | Nothing; a larger window fixes it |
token_expired | The token expired and getToken was missing or failed | Supply getToken |
rate_limited | Still limited after one retry that honoured retry-after | Back off |
Browser support
- Chromium (Chrome, Edge), Firefox and WebKit (Safari) engines, at normal and zoomed-in views.
- The mark stays sharp at any zoom level and display density, and covers modal dialogs and pop-overs.
Reading a result
| status | Meaning |
|---|---|
detected | A mark issued under your key was read; the recipient and content ids are returned. |
inconclusive | A mark is present but cannot be attributed to one copy. No identity is returned. |
unrecognised | A mark exists but was not issued under your key. No identity is returned. |
camera_detected | A photo of a protected screen was traced to one viewer you issued it to. Reserved: photo-of-screen tracing is in development and not yet enabled for customer keys. |
camera_capture_insufficient | A protected screen was photographed too poorly to read. capture.advice says what to change. Reserved, as above. |
not_detected | No mark found. |
scan_incomplete (504) | The scan did not finish. Retry it, and never treat it as clean. |
A match identifies the copy that was issued, not the person who shared it. A recipient may have passed their copy to someone else. Treat a match as the start of an investigation, never as proof of who leaked.
Signed receipts
Every scan result carries a receipt signed with Ed25519. Anyone holding a receipt can check it, with no API key, so you can pass it to counsel, an auditor or the other side.
{
"algorithm": "Ed25519",
"public_key": "...",
"encoding": "base64url, raw 32-byte key",
"signed_message": "canonical JSON of receipt.payload (keys sorted at every level, no whitespace)"
}{ "receipt": { "payload": { ... }, "signature": "..." } }
{ "valid": true }Because the signed message is defined, a receipt can also be verified offline with any Ed25519 library. Receipts are cryptographically verifiable and tamper-evident; whether they are admissible in a particular case is for counsel to assess.
{
"receipt": { "payload": { ... }, "signature": "..." },
"case": {
"reference": "HR-2026-114",
"title": "...", "found_at_url": "...", "found_at": "...",
"prepared_by": "...", "organisation": "...", "notes": "..."
}
}Returns a printable HTML evidence report (print it to PDF to keep it): the finding, the file's SHA-256, a timeline, the decoder's measurements, the full receipt and the steps to verify it. A receipt that doesn't verify gets 422 invalid_receipt and no report. case is optional and is printed as your own statements. No key is needed, and nothing is stored. You can also create a report on this site.
Managing your key
These calls are authenticated by the key itself. The two GET calls can also be made from a browser, which is how the dashboard shows your usage live. Rotate and revoke only work server to server.
Key status, product and this month's usage.
Recent calls made with the key, for your own audit trail.
Issue a replacement key and retire the current one.
Stop the key working immediately. Use this if it was exposed.
Billing units
Usage is counted in units when a copy is issued. Embed responses report what they used in units_charged (or the x-tracereceipt-units-charged header for binary media responses).
| Content | Units |
|---|---|
| Image | 1 unit per recipient copy |
| 1 unit per page (up to 50 pages a request by default, 100 maximum) | |
| Word, PowerPoint, Excel, text, Markdown | 1 unit per recipient copy |
| Video and audio | 1 unit per started 5 MB |
| Web app screen | 1 unit per viewer mark issued |
| Leak scans | Included, subject to a per-key rate limit |
A monthly limit applies per key; GET /sdk/v1/key shows what you've used. See pricing.
Errors
| Status | Meaning |
|---|---|
| 401 | Missing or invalid x-api-key |
| 403 | Key revoked, or used for the wrong product |
| 413 | Document over 25 MB, video over 50 MB, or audio over 25 MB |
| 415 | Unsupported document format |
| 422 | Unreadable or password-protected document, too many pages, or media that cannot be decoded or is too short. The message explains which |
| 429 | Rate limit or monthly quota reached. Check x-ratelimit-remaining and retry-after |
| 502 | Watermark engine temporarily unavailable. Safe to retry |
| 503 | PDF engine unavailable. Safe to retry later |
| 504 | scan_incomplete. Retry; this does not mean the content is clean |
Questions about an integration: [email protected]