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

# Missing subjects

Missing subjects are topics that should be covered but are absent from the Document Repository. They are produced by clustering unanswered companion questions and refused mandatory questions into coherent themes. This page covers the missing-subject lifecycle: list, find detail, list the companion questions that triggered the cluster, update state, and generate an AI companion document proposition to seed a new Document Product.

This page covers 5 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\_missing\_subject\_list

`POST /audit/missing-subject/list`

Paginated list of missing subjects for an instance. Each subject is a cluster of unanswered probes — the gap a Producer or Steward needs to fill by adding a new Document Product.

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

{% openapi src="/files/LsPumOBZAN25uU285Xuz" path="/audit/missing-subject/list" 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/missing-subject/list \
  -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/missing-subject/list",
    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/missing-subject/list",
  {
    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\_missing\_subject\_find

`POST /audit/missing-subject/find`

Get the detail of a single missing subject, including the cached `compagnon_proposition` (if `audit_missing_subject_generate_compagnon_document` has been called).

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

{% openapi src="/files/LsPumOBZAN25uU285Xuz" path="/audit/missing-subject/find" 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\_missing\_subject\_list\_questions

`POST /audit/missing-subject/questions`

List the questions that triggered the missing-subject cluster. Each question must be answered (via the mandatory-question or conflict surfaces) before `audit_missing_subject_generate_compagnon_document` can succeed.

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

{% openapi src="/files/LsPumOBZAN25uU285Xuz" path="/audit/missing-subject/questions" 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\_missing\_subject\_set\_state

`POST /audit/missing-subject/set-state`

Update the state of a missing subject (for example `MANAGED` once the Steward has commissioned and ingested a Document Product covering the gap, or `IGNORED` if the gap is intentional).

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

{% openapi src="/files/LsPumOBZAN25uU285Xuz" path="/audit/missing-subject/set-state" 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\_missing\_subject\_generate\_compagnon\_document

`POST /audit/missing-subject/generate-compagnon-document`

Produce an AI proposition for a document that would fill the gap identified by this missing subject. All companion questions must have been answered before generation can proceed (otherwise the endpoint returns 403). Output is a draft that a Producer can refine and publish as a new Document Product.

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

{% openapi src="/files/LsPumOBZAN25uU285Xuz" path="/audit/missing-subject/generate-compagnon-document" 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, when refused, can roll up into missing subjects.
* [Stats](/knowledge-ai/k-ai-audit/api-reference/stats.md) — instance-level counters including `missing_subjects_count`.
* [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/missing-subjects.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.
