---
title: "documents.repair-relationships"
method: POST
path: "/capabilities/documents.repair-relationships"
tags: ["Capabilities"]
---

# documents.repair-relationships

`POST /capabilities/documents.repair-relationships`

Retroactively diagnose and repair deterministic document relationships for a bounded document set. Uses shared schemas logic to mark true same-type duplicates and link related invoice/receipt documents.

## Request body

- object
  - `documentIds` string[] — Specific document IDs to diagnose and repair together
  - `messageId` string — Email message ID whose extracted documents should be repaired
  - `processedEntityId` string — Processed entity ID whose extracted documents should be repaired
  - `limit` integer — Maximum active documents to inspect
  - `dryRun` boolean — If true, preview deterministic repairs without writing changes

## Response `200`

Successful response

- object
  - `success` boolean
  - `code` integer
  - `data` object
    - `result` object — Capability-specific result

## Other responses

- `400` — Invalid input
- `401` — Authentication required
- `404` — Resource not found

---

[API](https://skmtc.net/receiptor/apis/receiptor-ai-api.md) · [All operations](https://skmtc.net/receiptor/apis/receiptor-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/receiptor/receiptor-ai-api/versions/da17f0eb65a2/schema)
