> For the complete documentation index, see [llms.txt](https://k-ai.gitbook.io/knowledge-ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://k-ai.gitbook.io/knowledge-ai/k-ai-audit/api-reference/duplicates.md).

# Duplicates

List and manage duplicate document clusters detected during the audit lifecycle. Duplicate identification runs as a background task during the `ON_DUPLICATE_IDENTIFICATION` step, after indexation has been verified.

This page covers 2 operations.

Auth: OAuth 2.1 Bearer token (MCP) or the `kai_auth` HttpOnly cookie (browsers) — see [OAuth 2.1](/knowledge-ai/authentication/oauth.md).

***

## audit\_duplicate\_list

`POST /audit/duplicate/list-duplicates-for-instance`

Paginated list of duplicate document clusters for an audit instance. Each cluster carries the list of `kd_*` documents that share the same canonical content plus the cluster's `state`.

{% openapi src="/files/LsPumOBZAN25uU285Xuz" path="/audit/duplicate/list-duplicates-for-instance" method="post" %}
[audit-api.yaml](https://3937809777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F85gF5n5kGsNQKMPwm2VR%2Fuploads%2Fgit-blob-00a25a57ce88a8c396c05c4686ed7c88c8fa834a%2Faudit-api.yaml?alt=media)
{% endopenapi %}

{% tabs %}
{% tab title="curl" %}

```bash
curl -X POST https://api-audit.kai-studio.ai/audit/duplicate/list-duplicates-for-instance \
  -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"instance_id": "ki_abc123", "offset": 0, "limit": 50}'
```

{% endtab %}

{% tab title="Python" %}

```python
import httpx

response = httpx.post(
    "https://api-audit.kai-studio.ai/audit/duplicate/list-duplicates-for-instance",
    headers={"Authorization": f"Bearer {access_token}"},
    json={"instance_id": "ki_abc123", "offset": 0, "limit": 50},
)
response.raise_for_status()
print(response.json())
```

{% endtab %}

{% tab title="TypeScript" %}

```ts
const response = await fetch(
  "https://api-audit.kai-studio.ai/audit/duplicate/list-duplicates-for-instance",
  {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${accessToken}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      instance_id: "ki_abc123",
      offset: 0,
      limit: 50,
    }),
  },
);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());
```

{% endtab %}
{% endtabs %}

***

## audit\_duplicate\_set\_managed

`POST /audit/duplicate/set-managed`

Mark a duplicate cluster as managed. Triggers a verification job against the linked K-AI instance to re-check the cluster after the Steward has either kept the canonical document or merged the duplicates upstream.

{% openapi src="/files/LsPumOBZAN25uU285Xuz" path="/audit/duplicate/set-managed" method="post" %}
[audit-api.yaml](https://3937809777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F85gF5n5kGsNQKMPwm2VR%2Fuploads%2Fgit-blob-00a25a57ce88a8c396c05c4686ed7c88c8fa834a%2Faudit-api.yaml?alt=media)
{% endopenapi %}

***

## Next

* [Mandatory questions](/knowledge-ai/k-ai-audit/api-reference/mandatory-questions.md) — Steward-defined questions feeding the conflict worklist.
* [Conflicts](/knowledge-ai/k-ai-audit/api-reference/conflicts.md) — the primary expert worklist.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://k-ai.gitbook.io/knowledge-ai/k-ai-audit/api-reference/duplicates.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
