> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nixflex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Review and publish knowledge drafts

> Inspect prepared facts, save draft edits with current revisions, approve selected topics and confirm the publication job before using new answers.

**FIXED · agent** One live knowledge base belongs to an agent. Its attached numbers use that base on enabled channels. Only the active revision and eligible, unsuppressed pieces enter live retrieval.

**NOT OFFERED → do this instead · number** Knowledge and its enabled channels belong to the agent. Retired per-number knowledge operations return 410 number\_knowledge\_removed. Use separate agents when a number needs different knowledge or none.

**YOU CAN CHANGE · source** Use pasted text, PDF, DOCX or plain UTF-8 text, or discover a website and import selected pages. API submissions can request review.

**SCOPE · agent** Review knowledge drafts and publish approved material. Limits per base: `sources` 50 · `kbTokens` 100,000 · `topics` 1,000.

[Read the compact AI rules](https://docs.nixflex.com/ai-rules.md#knowledge)

Turn a prepared knowledge draft into live answers by reviewing its facts, choosing topics and confirming publication.

Input: **Prepared draft** · Concurrency: **Current revisions** · Finish: **Confirmed live topics**

**The important part**

* A prepared source is not the same as published knowledge.
* Use the latest base revision and draft edit revision for each save or acceptance.
* Warnings and flagged topics need explicit human choices.

[Business guide](https://docs.nixflex.com/guides/business/knowledge.md) · [API reference](https://docs.nixflex.com/api-reference/introduction.md) · [Glossary](https://docs.nixflex.com/guides/glossary.md)

## Find the draft from its job

An import returns HTTP 202. Example response, with illustrative IDs:

```json theme={"dark"}
{
  "id":"11111111-1111-4111-8111-111111111111",
  "kb":"22222222-2222-4222-8222-222222222222",
  "kind":"import",
  "state":"pending",
  "stage":"pending",
  "progress":{"percent":0},
  "result":null,
  "error":null,
  "next_retry_at":null,
  "paid_work_started":false,
  "created_at":"2026-11-05T12:00:00Z"
}
```

Poll [GET job](https://docs.nixflex.com/api-reference/knowledge/get-knowledge-jobs-id.md) using the returned `id`. Use a bounded delay, for example one second increasing to five seconds, and stop when the user leaves the screen. This is a client choice, not a required server interval. Honour `next_retry_at` and HTTP retry guidance. Resume later from the same job ID rather than submitting another import.

| State | Client action |
| - | - |
| `pending`, `running` | Keep polling; show server `stage` and `progress.percent`. Progress measures completed stages, not time remaining. |
| `needs_review` | Read `result.draft_id` and show the draft for review. |
| `ready` | Inspect the job kind and result. An unchanged or duplicate-only import can be ready without publishing new topics. |
| `failed` | Read the job’s safe `error`. HTTP 200 for a failed job is still a failed operation. |
| `cancelled`, `deleted` | Stop polling and reconcile current state. |

Read [the draft](https://docs.nixflex.com/api-reference/knowledge/get-knowledge-bases-kb-drafts-id.md). Legacy normalization is projected without being saved, using stable draft-scoped piece IDs. An explicit save or accept persists the repair. Retain the returned `data.edit_revision`, not an earlier cached value. Show each topic’s `facts`, title and review reasons. Edit with `expected_revision`, `expected_draft_revision`, `topic_id` and `topic`; save before accepting.

## Choose and publish reviewed facts

POST to [accept draft](https://docs.nixflex.com/api-reference/knowledge/post-knowledge-bases-kb-drafts-id-accept.md) with a new operation key. Use the current base revision, current draft edit revision and the explicit IDs the reviewer selected:

```json theme={"dark"}
{"expected_revision":1,"expected_draft_revision":0,"topic_ids":["33333333-3333-4333-8333-333333333333"]}
```

Those values are examples, not defaults to hard-code. If warnings exist, collect acknowledgement and send `acknowledge_warnings:true`. Individually approved flagged pieces go in `approved_flagged_topic_ids`; never populate that array automatically. An unticked replacement retains the existing live topic.

Acceptance returns another job. Poll until its publication is confirmed, then reread the base and [live topics](https://docs.nixflex.com/api-reference/knowledge/get-knowledge-bases-kb-topics.md). Lists use `items,next_cursor`, with limit 1–100. A stale topic cursor requires restarting the list.

## Handle a stale review

On `stale_revision`, reload both the current base and draft. Show the reviewer what changed before submitting again. Do not simply copy a newer revision number into an old approval: the facts or selected replacements may have changed.

Keep the idempotency key for an uncertain save. Use a new key only for a genuinely new edit or acceptance decision. `idempotency_conflict` means the same key was sent with different input; preserve the original operation record.

## Confirm what callers can use

After the publication job completes, read the base revision and live topics. Check the selected facts, their channels and any suppression state. Editing a live topic suppresses its old answer during that edit; a source import alone does not replace previously accepted facts.

| Result | What to show |
| - | - |
| `needs_review` | The draft and the choices still required. |
| `ready` with publication result | Refresh the live list and confirm the chosen topics. |
| `ready` with unchanged input | No new publication; retain the existing facts. |
| `review_required` or `suspicious_review_required` | Return to explicit review, without auto-approving. |
| Job `failed` inside HTTP 200 | A failed operation, with its safe error and recovery choice. |

## Check the answer

* [Test knowledge answers](https://docs.nixflex.com/guides/developer/knowledge/test-and-troubleshoot.md)
* [Edit a live topic](https://docs.nixflex.com/api-reference/knowledge/patch-knowledge-bases-kb-topics-id.md)
* [Refresh sources and export facts](https://docs.nixflex.com/guides/developer/knowledge/refresh-and-export.md)

## Related dashboard and AI tasks

* [Add and review your business facts](https://docs.nixflex.com/guides/business/knowledge/add-facts.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.