Skip to main content
POST
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 Prepare replacement source text while preserving the accepted version until publication.
Method: POST ·
Success: 202 ·
Scope: Owning account
The important part
  • Keep the expected revision and intended source identity.
  • Review the replacement job; accepted work is not completed publication.

Authentication

Send Authorization: Bearer KEY_ID:KEY_SECRET using the owning account’s server-side API credential. API keys have Owner authority. Personal Owner and Admin may perform this action; Member is refused. Personal dashboard visibility can hide API-origin agents. Never send owner fields to select another account.

Request fields

Send a JSON object. expected_revision belongs to the source. Raw replacement upload uses X-Expected-Revision. Manual edits and deletion records are protected; an unselected proposed replacement retains the old live piece. Raw upload: Content-Type application/octet-stream, X-Filename, optional X-Source-Title and X-Review; replacements also require X-Expected-Revision. File maximum 10 MiB; PDF maximum 200 pages. Accept clean UTF-8 text, PDF with selectable text, or DOCX. No raw base64/path input, RTF, executable or active-content documents. Preview scan status is not publication clearance. Without a configured scanner, local_checks_only permits bounded local checks. With a configured scanner, PDF/DOCX need a clean result; clean UTF-8 text can use local checks during an outage. Infected files never bypass. Imports may wait at safety_check/safety_waiting with next_retry_at; after 24 hours scan_expired requires a new upload. Raw files are private and never downloaded; accepted storage retains extracted text.

Response fields

202 Accepted returns the fields below. Where this operation queues work, follow the job and current revision until it finishes (accepted is not confirmed).

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. Set NXF_IDEMPOTENCY_KEY to a new valid key for one intended operation. This operation changes state. Review the request and disable automatic write retries.
request-115.json
MCP does not offer this operation because this operation is outside the approved tool permissions. Use the documented Node, Python, CLI or HTTP operation with the required authority.

Example response

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

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.

Retry and idempotency

Use a new Idempotency-Key for each intended change. The same key with the identical operation and payload replays the stored result; a different payload conflicts. Do not automatically repeat an uncertain write. Read the current job/resource first, then reconcile with the original key. Check expected_revision against current state; a fresh key does not bypass revision checks.

Authorizations

Authorization
string
header
required

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.

Headers

Idempotency-Key
string
required

Unique 8–128-character operation key: letters, numbers, dot, underscore, colon or hyphen. The prompt: prefix is reserved. Reuse only with the identical operation and payload.

Required string length: 8 - 128
Pattern: ^[A-Za-z0-9_.:-]{8,128}$
X-Filename
string

Required for a raw upload; filename up to 200 characters. Use a genuine PDF, DOCX or UTF-8 text file.

Maximum string length: 200
X-Source-Title
string

Optional source title, at most 200 characters; defaults to filename.

Maximum string length: 200
X-Review
string

For imports: exactly true requests review; other/omitted values mean false for API requests.

X-Expected-Revision
string

Required for a raw replacement; current source integer revision.

Path Parameters

kb
string<uuid>
required

Opaque identifier. Keep it as a string.

id
string<uuid>
required

Opaque identifier. Keep it as a string.

Body

source
object
required
expected_revision
integer
required

Latest integer revision read from this resource; it must still match when the request runs.

Required range: x >= 1
review
boolean
default:false

Response

Accepted; inspect the job before claiming completion.

id
string<uuid>
required

Opaque identifier. Keep it as a string.

kb
string<uuid>
required

Opaque identifier. Keep it as a string.

kind
string
required

Work type; includes import, discovery, publish, manual, export, delete and automatic-term maintenance.

state
enum<string>
required
Available options:
pending,
running,
needs_review,
ready,
failed,
cancelled,
deleted
stage
string
required

Current work stage, including reading, preparing, indexing, safety_check or safety_waiting.

progress
object
required
result
object | null
required

Fields depend on job kind. Poll the job until a terminal state or needs_review; ready alone is not a claim that new text was published.

error
object | null
required
next_retry_at
string<date-time> | null
required

UTC timestamp.

paid_work_started
boolean
required

Whether paid preparation work began; not an invoice or an additional charge.

created_at
string<date-time>
required

UTC timestamp.