> 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/conflicts.md).

# Conflicts

The question-driven conflict surface — the primary expert worklist. Each conflict represents two or more Document Repository excerpts disagreeing on the answer to a [mandatory question](/knowledge-ai/k-ai-audit/api-reference/mandatory-questions.md). Conflict ids carry the `qc_` prefix (do not confuse with `fc_` full-audit conflict ids — see [Questions & answers](/knowledge-ai/k-ai-audit/api-reference/questions-answers.md)).

When `need_detect_owner_document_feature` is enabled on the audit instance, non-admin users only see conflicts touching documents they own.

This page covers 6 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\_question\_conflict\_list

`POST /audit/conflict/list-conflicts-for-instance`

Paginated flat list of conflicts. Default `state_in=['OPEN']` — the primary expert worklist. Allowed states: `OPEN`, `ANSWERED`, `RECOMMENDATIONS_READY`, `MANAGED`, `IGNORED`. Filter by `question_id_in` (`mq_*`) or `document_id_in` (`kd_*`) to scope to a question or a document. Responses are hydrated with `document_name` and `document_url` on every involved document.

{% hint style="info" %}
**Also exposed on MCP** as `audit_question_conflict_list` (see [Audit MCP tools](/knowledge-ai/k-ai-mcp/audit-tools.md)).
{% endhint %}

{% openapi src="/files/LsPumOBZAN25uU285Xuz" path="/audit/conflict/list-conflicts-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/conflict/list-conflicts-for-instance \
  -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_id": "ki_abc123",
    "offset": 0,
    "limit": 25,
    "state_in": ["OPEN"]
  }'
```

{% endtab %}

{% tab title="Python" %}

```python
import httpx

response = httpx.post(
    "https://api-audit.kai-studio.ai/audit/conflict/list-conflicts-for-instance",
    headers={"Authorization": f"Bearer {access_token}"},
    json={
        "instance_id": "ki_abc123",
        "offset": 0,
        "limit": 25,
        "state_in": ["OPEN"],
    },
)
response.raise_for_status()
print(response.json())
```

{% endtab %}

{% tab title="TypeScript" %}

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

{% endtab %}
{% endtabs %}

***

## audit\_question\_conflict\_get

`POST /audit/conflict/get`

Return the full detail of a conflict — contradicting excerpts, triggering question, companion questions, state, and any saved expert answer. Required before calling `audit_question_conflict_set_answer` unless the conflict-list response already provides the full context.

Passing an `fc_*` id here returns HTTP 400 with a wrong-namespace hint.

{% hint style="info" %}
**Also exposed on MCP** as `audit_question_conflict_get` (see [Audit MCP tools](/knowledge-ai/k-ai-mcp/audit-tools.md)).
{% endhint %}

{% openapi src="/files/LsPumOBZAN25uU285Xuz" path="/audit/conflict/get" 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 %}

***

## audit\_question\_conflict\_set\_answer

`POST /audit/conflict/set-answer`

Record the expert answer for a conflict and immediately return per-document modification recommendations inline. Sync LLM call (\~5s typical, \~10s p99). After receiving the response, render `recommendations` as a markdown table (`Document | Action`) and ask the expert whether each modification was applied before calling `audit_question_conflict_close`. The conflict stays in `RECOMMENDATIONS_READY` until `_close` is called.

If `recommendations` is empty, the LLM crew failed for this conflict — re-call `set_answer` to retry (do **not** call `audit_documents_get_recommendations`, which only reads persisted recommendations).

{% hint style="info" %}
**Also exposed on MCP** as `audit_question_conflict_set_answer` (see [Audit MCP tools](/knowledge-ai/k-ai-mcp/audit-tools.md)).
{% endhint %}

{% openapi src="/files/LsPumOBZAN25uU285Xuz" path="/audit/conflict/set-answer" 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/conflict/set-answer \
  -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_id": "ki_abc123",
    "conflict_id": "qc_xyz789",
    "answer": "The 500kg figure in policy_v3.pdf is correct; policy_v2.pdf is superseded."
  }'
```

{% endtab %}

{% tab title="Python" %}

```python
import httpx

response = httpx.post(
    "https://api-audit.kai-studio.ai/audit/conflict/set-answer",
    headers={"Authorization": f"Bearer {access_token}"},
    json={
        "instance_id": "ki_abc123",
        "conflict_id": "qc_xyz789",
        "answer": (
            "The 500kg figure in policy_v3.pdf is correct; "
            "policy_v2.pdf is superseded."
        ),
    },
    timeout=30.0,
)
response.raise_for_status()
print(response.json())
```

{% endtab %}

{% tab title="TypeScript" %}

```ts
const response = await fetch(
  "https://api-audit.kai-studio.ai/audit/conflict/set-answer",
  {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${accessToken}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      instance_id: "ki_abc123",
      conflict_id: "qc_xyz789",
      answer:
        "The 500kg figure in policy_v3.pdf is correct; policy_v2.pdf is superseded.",
    }),
  },
);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());
```

{% endtab %}
{% endtabs %}

***

## audit\_question\_conflict\_close

`POST /audit/conflict/set-managed`

Close (mark `MANAGED`) a conflict. Requires the conflict to be in `RECOMMENDATIONS_READY` (or `ANSWERED`, if the expert decides to close without recommendations). Idempotent if already `MANAGED`. Call only after the expert confirmed every modification was applied (or accepts a partial application). For a false positive that needs no change, use `audit_question_conflict_ignore` instead.

{% hint style="info" %}
**Also exposed on MCP** as `audit_question_conflict_close` (see [Audit MCP tools](/knowledge-ai/k-ai-mcp/audit-tools.md)).
{% endhint %}

{% openapi src="/files/LsPumOBZAN25uU285Xuz" path="/audit/conflict/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 %}

***

## audit\_question\_conflict\_ignore

`POST /audit/conflict/set-ignored`

Mark a conflict as `IGNORED` — the expert judged it a non-issue or a false positive that needs no change. Terminal: the conflict leaves the active worklist. Use this instead of `audit_question_conflict_close` when no document modification is warranted. Idempotent if already `IGNORED`. This is the `qc_` counterpart of [`audit_full_audit_conflict_ignore`](/knowledge-ai/k-ai-audit/api-reference/questions-answers.md).

{% hint style="info" %}
**Also exposed on MCP** as `audit_question_conflict_ignore` (see [Audit MCP tools](/knowledge-ai/k-ai-mcp/audit-tools.md)).
{% endhint %}

{% openapi src="/files/LsPumOBZAN25uU285Xuz" path="/audit/conflict/set-ignored" 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/conflict/set-ignored \
  -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_id": "ki_abc123",
    "conflict_id": "qc_xyz789"
  }'
```

{% endtab %}

{% tab title="Python" %}

```python
import httpx

response = httpx.post(
    "https://api-audit.kai-studio.ai/audit/conflict/set-ignored",
    headers={"Authorization": f"Bearer {access_token}"},
    json={"instance_id": "ki_abc123", "conflict_id": "qc_xyz789"},
)
response.raise_for_status()
print(response.json())
```

{% endtab %}

{% tab title="TypeScript" %}

```ts
const response = await fetch(
  "https://api-audit.kai-studio.ai/audit/conflict/set-ignored",
  {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${accessToken}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      instance_id: "ki_abc123",
      conflict_id: "qc_xyz789",
    }),
  },
);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());
```

{% endtab %}
{% endtabs %}

***

## audit\_conflict\_get\_top\_collaborators

`POST /audit/conflict/get-top-collaborators`

Return the top three other users with overlapping conflicts on this instance — used by the K-AI Audit web app to surface natural review partners. Returns an empty array for admins.

{% openapi src="/files/LsPumOBZAN25uU285Xuz" path="/audit/conflict/get-top-collaborators" 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) — define the probes that produce these conflicts.
* [Questions & answers](/knowledge-ai/k-ai-audit/api-reference/questions-answers.md) — the broader full-audit surface.
* [K-AI MCP](/knowledge-ai/k-ai-mcp/mcp.md) — connect Claude Desktop / Cursor / Le Chat to the Audit MCP server.


---

# 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/conflicts.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.
