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

# Get knowledge draft

> Read proposed knowledge pieces, flags, reminders and the draft revision before editing or approving the selected content.

**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)

Read proposed pieces, review flags, reminders and draft revision.

Method: **GET** · Success: **200** · Scope: **Owning account**

**The important part**

* Read the draft and its current revision before editing or accepting.
* A preview scan is not publication clearance; review flagged content.

[Business guide](https://docs.nixflex.com/guides/business/knowledge.md) · [Developer guide](https://docs.nixflex.com/guides/developer/knowledge.md) · [Glossary](https://docs.nixflex.com/guides/glossary.md)

## Authentication

Send Authorization: Bearer KEY\_ID:KEY\_SECRET using the owning account’s server-side API credential. API keys have Owner authority. With a personal dashboard session, Owner, Admin and Member may read visible knowledge; membership is checked before and after the read. Personal dashboard visibility can hide API-origin agents.

## Request fields

| Field | Type | Required | Default | Limits and meaning |
| - | - | - | - | - |
| `kb` (path) | string | Yes | None | Opaque identifier. Keep it as a string. Format: uuid. |
| `id` (path) | string | Yes | None | Opaque identifier. Keep it as a string. Format: uuid. |

Do not send a request body.

This GET projects legacy normalization and repairs without saving them. Piece IDs are stable within the draft. Explicit save or accept persists the same repair through the write path. Keep the returned data.edit\_revision before editing or accepting.

## Response fields

`200 OK` returns the fields below. Where this operation queues work, follow the job and current revision until it finishes ([accepted is not confirmed](https://docs.nixflex.com/guides/glossary.md#saved-accepted-and-confirmed)).

| Field | Type | Meaning |
| - | - | - |
| `id` | string | Opaque identifier. Keep it as a string. Format: uuid. |
| `owner` | string | Owning account ID. |
| `kb` | string | Opaque identifier. Keep it as a string. Format: uuid. |
| `expected_rev` | integer | Latest integer revision read from this resource; it must still match when the request runs. Minimum 1. |
| `data` | object | Saved value. |
| `data.format` | string | Current format is pieces-v1. |
| `data.topics` | array of object | Saved value. |
| `data.topics[].id` | string | Opaque identifier. Keep it as a string. Format: uuid. |
| `data.topics[].title` | string | Displayed piece title. |
| `data.topics[].facts` | string | Piece text. |
| `data.topics[].questions` | array of string | Labels kept from manual entry or earlier imports; new imports do not generate questions. |
| `data.topics[].evidence` | array of object | Saved value. |
| `data.topics[].evidence[].source` | string | Opaque identifier. Keep it as a string. Format: uuid. |
| `data.topics[].evidence[].segment` | integer | Source segment index. |
| `data.topics[].evidence[].quote` | string | Original evidence text. |
| `data.topics[].evidence[].quote_hash` | string | Digest used by a deletion record. |
| `data.topics[].evidence[].topic_id` | string | Opaque identifier. Keep it as a string. Format: uuid. |
| `data.topics[].evidence[].revision` | string | Opaque identifier. Keep it as a string. Format: uuid. |
| `data.topics[].evidence[].title` | string | Title snapshot at answer time. |
| `data.topics[].manual` | boolean | True when manually written or corrected. |
| `data.topics[].valid_from` | string or null | UTC timestamp. Format: date-time. |
| `data.topics[].valid_until` | string or null | UTC timestamp. Format: date-time. |
| `data.topics[].suppressed` | boolean | True while an edited old piece must not be used. |
| `data.topics[].origin` | string | Optional origin marker from earlier imports. |
| `data.topics[].position` | object | Stable display-order metadata. |
| `data.topics[].position.added_at` | string | UTC timestamp. Format: date-time. |
| `data.topics[].position.source` | integer | Saved value. |
| `data.topics[].position.segment` | integer | Saved value. |
| `data.topics[].page_name` | string | Optional source page label. |
| `data.topics[].title_page` | string | Optional label used to distinguish similar automatic titles. |
| `data.topics[].review_flags` | array of string | Allowed items: `"agent_instructions"`, `"suspicious_link"`, `"payment_details"`, `"sensitive_data"`, `"website_junk"`, `"code_example"`. |
| `data.topics[].check_required` | boolean | A flagged topic needs explicit individual approval. |
| `data.topics[].check_reasons` | array of string | Saved value. |
| `data.topics[].check_reason` | string | Compatibility joined review reasons. |
| `data.topics[].keyterms` | object | Read-only metadata. Refresh scheduling is still being checked separately; do not send it in writes. |
| `data.topics[].keyterms.version` | integer | Stored automatic-term format version. |
| `data.topics[].keyterms.fingerprint` | string | Digest of the source text used to validate cached terms. |
| `data.topics[].keyterms.terms` | array of string | Stored suggested terms. |
| `data.topics[].keyterms.ranks` | object | Keys are normalized terms; each value records score (1–4) and essential (boolean). |
| `data.entries` | array of object | Saved value. |
| `data.entries[].id` | string | Opaque identifier. Keep it as a string. Format: uuid. |
| `data.entries[].rev` | integer | Latest integer revision read from this resource; it must still match when the request runs. Minimum 1. |
| `data.entries[].object_id` | string | Opaque identifier. Keep it as a string. Format: uuid. |
| `data.entries[].type` | string | Allowed: `"text"`, `"file"`, `"url"`. |
| `data.entries[].title` | string | Saved value. |
| `data.entries[].url` | string | Saved value. |
| `data.entries[].filename` | string | Saved value. |
| `data.entries[].text` | string | Extracted original text, never raw uploaded file bytes. |
| `data.entries[].tokens` | integer | Saved value. |
| `data.entries[].parsed` | boolean | Saved value. |
| `data.entries[].added_at` | string | UTC timestamp. Format: date-time. |
| `data.entries[].source_order` | integer | Saved value. |
| `data.warnings` | array of string | Saved value. |
| `data.summary` | object | Saved value. |
| `data.summary.pages` | integer | Website pages processed. |
| `data.summary.pieces` | integer | Prepared pieces. |
| `data.summary.duplicates_skipped` | integer | Duplicate pieces or repeated source skipped. |
| `data.job_id` | string | Opaque identifier. Keep it as a string. Format: uuid. |
| `data.edit_revision` | integer | Draft edit revision; an omitted value means 0. Minimum 0. |
| `created_at` | string | UTC timestamp. Format: date-time. |

## Example request

These examples target Node/CLI 0.11.0 and Python 0.4.0; confirm the installed version supports the method before use. The cURL tab uses Bash; CLI uses PowerShell. Python shows sync usage; AsyncNixflex uses the same JSON methods with async with and await. Set the account credential in `NIXFLEX_API_KEY` and the owned path identifiers shown below in environment variables. Keep private responses out of logs.

```bash cURL (Bash) theme={"dark"}
curl --request GET \
  --url "https://api.nixflex.com/v1/knowledge-bases/$(node -p 'encodeURIComponent(process.env.NXF_KNOWLEDGE_BASE_ID)')/drafts/$(node -p 'encodeURIComponent(process.env.NXF_RESOURCE_ID)')" \
  --header "Authorization: Bearer $NIXFLEX_API_KEY"
```

```javascript Node theme={"dark"}
import Nixflex from 'nixflex';
const c = new Nixflex({apiKey:process.env.NIXFLEX_API_KEY,baseUrl:'https://api.nixflex.com',maxRetries:0});
const result = await c.knowledge.getDraft(process.env.NXF_KNOWLEDGE_BASE_ID, process.env.NXF_RESOURCE_ID);
// Keep knowledge and private results out of logs.
```

```python Python theme={"dark"}
import os
from nixflex import Nixflex

with Nixflex(api_key=os.environ["NIXFLEX_API_KEY"], base_url="https://api.nixflex.com", max_retries=0) as c:
    result = c.knowledge.get_draft(os.environ["NXF_KNOWLEDGE_BASE_ID"], os.environ["NXF_RESOURCE_ID"])
    # Keep knowledge and private results out of logs.
```

```powershell CLI (PowerShell) theme={"dark"}
nixflex knowledge getDraft "$env:NXF_KNOWLEDGE_BASE_ID" "$env:NXF_RESOURCE_ID" --json --base-url "https://api.nixflex.com"
```

MCP does not offer this operation in MCP 0.5.0. The server read is now non-persisting, but an engine deployment does not register a new MCP tool. Use the documented SDK or HTTP read; check installed tool schemas before use.

## Example response

Illustrative response; identifiers are placeholders and optional fields can be absent.

```json Response theme={"dark"}
{
  "id": "11111111-1111-4111-8111-111111111111",
  "owner": "owner_fixture",
  "kb": "11111111-1111-4111-8111-111111111111",
  "expected_rev": 1,
  "data": {
    "topics": [],
    "entries": [],
    "warnings": []
  },
  "created_at": "2026-11-02T12:00:00Z"
}
```

## Errors

Failures use `error.type`, `error.code`, `error.message`, `error.doc_url` and optional `error.details`. Knowledge failures include a request ID in details when available. Read the safe message as text. A job can return HTTP 200 with state `failed` and `error`; that is a job failure, not an HTTP error. Source failures can arise during preparation after the initial accepted response.

| Status | Code | Meaning | What to do |
| - | - | - | - |
| 400 | [`invalid_input`](https://docs.nixflex.com/api-reference/errors#invalid_input) | Check the information and try again. | Correct the named fields or reduce the input before retrying. |
| 404 | [`not_found`](https://docs.nixflex.com/api-reference/errors#not_found) | That topic is not available. | Check the owned identifier and feature availability. |
| 409 | [`deleting`](https://docs.nixflex.com/api-reference/errors#deleting) | This knowledge base is being deleted. | Read current state and resolve the conflict before sending a new request. |
| 503 | [`unavailable`](https://docs.nixflex.com/api-reference/errors#unavailable) | Knowledge is unavailable right now. Your saved information is safe. Try again. | Retry reads with bounded backoff; reconcile writes before repeating. |
| 503 | [`knowledge_unconfigured`](https://docs.nixflex.com/api-reference/errors#knowledge_unconfigured) | Knowledge is not available yet. | Retry reads with bounded backoff; reconcile writes before repeating. |
| 503 | [`knowledge_not_released`](https://docs.nixflex.com/api-reference/errors#knowledge_not_released) | Knowledge is not released yet. | Retry reads with bounded backoff; reconcile writes before repeating. |
| 403 | [`permission_denied`](https://docs.nixflex.com/api-reference/errors#permission_denied) | Your personal role does not allow this action. | Use a permitted personal account; do not share the organisation key. |
| 403 | [`membership_revoked`](https://docs.nixflex.com/api-reference/errors#membership_revoked) | Your membership has ended. | Use a permitted personal account; do not share the organisation key. |
| 401 | [`unauthorized`](https://docs.nixflex.com/api-reference/errors#unauthorized) | The credential is missing or invalid. | Check the full account credential. |
| 429 | [`rate_limit_exceeded`](https://docs.nixflex.com/api-reference/errors#rate_limit_exceeded) | The account request limit was reached. | Wait for the stated retry/reset time. |

## Retry and idempotency

Use bounded retries for temporary read failures. This deployed GET does not persist repairs. Read the current edit revision before any deliberate save or acceptance; writes still need their own revision and idempotency checks.

## Related endpoints

* [Get knowledge capabilities](https://docs.nixflex.com/api-reference/knowledge/get-knowledge-capabilities.md)
* [List knowledge agents](https://docs.nixflex.com/api-reference/knowledge/get-knowledge-targets.md)
* [Errors and recovery](https://docs.nixflex.com/api-reference/errors.md#error-envelope)


## OpenAPI

````yaml api-reference/public.openapi.json GET /knowledge-bases/{kb}/drafts/{id}
openapi: 3.1.0
info:
  title: Nixflex public API
  version: 1.0.0
  description: >-
    Nixflex API reference for agents, calls, messaging, knowledge, organisations
    and integrations. Authenticate with the owning account and follow each
    operation’s permissions, response and retry contract.
servers:
  - url: https://api.nixflex.com/v1
security:
  - bearerAuth: []
paths:
  /knowledge-bases/{kb}/drafts/{id}:
    get:
      tags:
        - Knowledge
      summary: Get knowledge draft
      description: >-
        Read a draft without persisting repairs. Legacy normalization is
        projected with stable draft-scoped piece IDs; an explicit save or accept
        persists it. Keep the returned edit revision before editing.
      operationId: get_knowledge_bases_kb_drafts_id_
      parameters:
        - name: kb
          in: path
          required: true
          schema:
            type: string
            description: Opaque identifier. Keep it as a string.
            format: uuid
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: Opaque identifier. Keep it as a string.
            format: uuid
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Opaque identifier. Keep it as a string.
                    format: uuid
                  owner:
                    type: string
                    description: Owning account ID.
                  kb:
                    type: string
                    description: Opaque identifier. Keep it as a string.
                    format: uuid
                  expected_rev:
                    type: integer
                    description: >-
                      Latest integer revision read from this resource; it must
                      still match when the request runs.
                    minimum: 1
                  data:
                    type: object
                    properties:
                      format:
                        type: string
                        description: Current format is pieces-v1.
                      topics:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: Opaque identifier. Keep it as a string.
                              format: uuid
                            title:
                              type: string
                              description: Displayed piece title.
                            facts:
                              type: string
                              description: Piece text.
                            questions:
                              type: array
                              items:
                                type: string
                                description: ''
                              description: >-
                                Labels kept from manual entry or earlier
                                imports; new imports do not generate questions.
                            evidence:
                              type: array
                              items:
                                type: object
                                properties:
                                  source:
                                    type: string
                                    description: Opaque identifier. Keep it as a string.
                                    format: uuid
                                  segment:
                                    type: integer
                                    description: Source segment index.
                                  quote:
                                    type: string
                                    description: Original evidence text.
                                  quote_hash:
                                    type: string
                                    description: Digest used by a deletion record.
                                  topic_id:
                                    type: string
                                    description: Opaque identifier. Keep it as a string.
                                    format: uuid
                                  revision:
                                    type: string
                                    description: Opaque identifier. Keep it as a string.
                                    format: uuid
                                  title:
                                    type: string
                                    description: Title snapshot at answer time.
                                additionalProperties: true
                                description: >-
                                  Evidence fields vary by source, topic or
                                  answer. IDs identify supplied context, not
                                  proof that every piece affected an answer.
                              description: ''
                            manual:
                              type: boolean
                              description: True when manually written or corrected.
                            valid_from:
                              type:
                                - string
                                - 'null'
                              description: UTC timestamp.
                              format: date-time
                            valid_until:
                              type:
                                - string
                                - 'null'
                              description: UTC timestamp.
                              format: date-time
                            suppressed:
                              type: boolean
                              description: True while an edited old piece must not be used.
                            origin:
                              type: string
                              description: Optional origin marker from earlier imports.
                            position:
                              type: object
                              properties:
                                added_at:
                                  type: string
                                  description: UTC timestamp.
                                  format: date-time
                                source:
                                  type: integer
                                  description: ''
                                segment:
                                  type: integer
                                  description: ''
                              additionalProperties: true
                              description: Stable display-order metadata.
                            page_name:
                              type: string
                              description: Optional source page label.
                            title_page:
                              type: string
                              description: >-
                                Optional label used to distinguish similar
                                automatic titles.
                            review_flags:
                              type: array
                              items:
                                type: string
                                description: ''
                                enum:
                                  - agent_instructions
                                  - suspicious_link
                                  - payment_details
                                  - sensitive_data
                                  - website_junk
                                  - code_example
                              description: ''
                            check_required:
                              type: boolean
                              description: >-
                                A flagged topic needs explicit individual
                                approval.
                            check_reasons:
                              type: array
                              items:
                                type: string
                                description: Fixed plain-language review reason.
                              description: ''
                            check_reason:
                              type: string
                              description: Compatibility joined review reasons.
                            keyterms:
                              type: object
                              properties:
                                version:
                                  type: integer
                                  description: Stored automatic-term format version.
                                fingerprint:
                                  type: string
                                  description: >-
                                    Digest of the source text used to validate
                                    cached terms.
                                terms:
                                  type: array
                                  items:
                                    type: string
                                    description: Source-spelled automatic term.
                                  description: Stored suggested terms.
                                ranks:
                                  type: object
                                  description: >-
                                    Keys are normalized terms; each value
                                    records score (1–4) and essential (boolean).
                                  additionalProperties:
                                    type: object
                                    properties:
                                      score:
                                        type: integer
                                        description: Stored importance.
                                        minimum: 1
                                        maximum: 4
                                      essential:
                                        type: boolean
                                        description: Central identity marker.
                                    required:
                                      - score
                                      - essential
                                    additionalProperties: true
                                    description: ''
                              additionalProperties: true
                              description: >-
                                Read-only metadata. Refresh scheduling is still
                                being checked separately; do not send it in
                                writes.
                          required:
                            - id
                            - title
                            - facts
                            - questions
                            - evidence
                            - manual
                            - valid_from
                            - valid_until
                          additionalProperties: true
                          description: ''
                        description: ''
                      entries:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: Opaque identifier. Keep it as a string.
                              format: uuid
                            rev:
                              type: integer
                              description: >-
                                Latest integer revision read from this resource;
                                it must still match when the request runs.
                              minimum: 1
                            object_id:
                              type: string
                              description: Opaque identifier. Keep it as a string.
                              format: uuid
                            type:
                              type: string
                              description: ''
                              enum:
                                - text
                                - file
                                - url
                            title:
                              type: string
                              description: ''
                            url:
                              type: string
                              description: ''
                            filename:
                              type: string
                              description: ''
                            text:
                              type: string
                              description: >-
                                Extracted original text, never raw uploaded file
                                bytes.
                            tokens:
                              type: integer
                              description: ''
                            parsed:
                              type: boolean
                              description: ''
                            added_at:
                              type: string
                              description: UTC timestamp.
                              format: date-time
                            source_order:
                              type: integer
                              description: ''
                          required:
                            - id
                            - rev
                            - object_id
                            - type
                            - title
                          additionalProperties: true
                          description: >-
                            Accepted/staged source metadata. Older versions may
                            retain additional metadata.
                        description: ''
                      warnings:
                        type: array
                        items:
                          type: string
                          description: Plain review reminder.
                        description: ''
                      summary:
                        type: object
                        properties:
                          pages:
                            type: integer
                            description: Website pages processed.
                          pieces:
                            type: integer
                            description: Prepared pieces.
                          duplicates_skipped:
                            type: integer
                            description: Duplicate pieces or repeated source skipped.
                        additionalProperties: true
                        description: ''
                      job_id:
                        type: string
                        description: Opaque identifier. Keep it as a string.
                        format: uuid
                      edit_revision:
                        type: integer
                        description: Draft edit revision; an omitted value means 0.
                        minimum: 0
                        default: 0
                    required:
                      - topics
                      - entries
                      - warnings
                    additionalProperties: true
                    description: ''
                  created_at:
                    type: string
                    description: UTC timestamp.
                    format: date-time
                required:
                  - id
                  - owner
                  - kb
                  - expected_rev
                  - data
                  - created_at
                additionalProperties: true
                description: ''
        '400':
          description: 'invalid_input: Check the information and try again.'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: object
                        additionalProperties: true
        '401':
          description: 'unauthorized: The credential is missing or invalid.'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: object
                        additionalProperties: true
        '403':
          description: >-
            permission_denied: Your personal role does not allow this action.
            membership_revoked: Your membership has ended.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: object
                        additionalProperties: true
        '404':
          description: 'not_found: That topic is not available.'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: object
                        additionalProperties: true
        '409':
          description: 'deleting: This knowledge base is being deleted.'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: object
                        additionalProperties: true
        '429':
          description: 'rate_limit_exceeded: The account request limit was reached.'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: object
                        additionalProperties: true
        '503':
          description: >-
            unavailable: Knowledge is unavailable right now. Your saved
            information is safe. Try again. knowledge_unconfigured: Knowledge is
            not available yet. knowledge_not_released: Knowledge is not released
            yet.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - doc_url
                      - type
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: object
                        additionalProperties: true
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        KEY_ID:KEY_SECRET from the owning account. Keep it server-side. A
        verified personal dashboard Bearer session may be used where the
        operation documents role-based access.

````

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