curl --request POST \
--url "https://api.nixflex.com/v1/knowledge-bases/$(node -p 'encodeURIComponent(process.env.NXF_KNOWLEDGE_BASE_ID)')/topic-search" \
--header "Authorization: Bearer $NIXFLEX_API_KEY" \
--header "Content-Type: application/json" \
--data '{"query":"appointment times"}'
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.searchTopics(process.env.NXF_KNOWLEDGE_BASE_ID, {"query":"appointment times"});
// Keep knowledge and private results out of logs.
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.search_topics(os.environ["NXF_KNOWLEDGE_BASE_ID"], {
"query": "appointment times"
})
# Keep knowledge and private results out of logs.
# Save the JSON below privately as request-117.json.
nixflex knowledge searchTopics "$env:NXF_KNOWLEDGE_BASE_ID" --body '@request-117.json' --confirm --json --base-url "https://api.nixflex.com"
{
"name": "search_knowledge_topics",
"arguments": {
"kb": "kb/example",
"query": "Example question"
}
}
{
"items": [],
"revision": 1
}
Knowledge
Search knowledge topics
Find related current topics in one knowledge base for management. Search results do not predict an agent’s answer on a real call.
POST
/
knowledge-bases
/
{kb}
/
topic-search
curl --request POST \
--url "https://api.nixflex.com/v1/knowledge-bases/$(node -p 'encodeURIComponent(process.env.NXF_KNOWLEDGE_BASE_ID)')/topic-search" \
--header "Authorization: Bearer $NIXFLEX_API_KEY" \
--header "Content-Type: application/json" \
--data '{"query":"appointment times"}'
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.searchTopics(process.env.NXF_KNOWLEDGE_BASE_ID, {"query":"appointment times"});
// Keep knowledge and private results out of logs.
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.search_topics(os.environ["NXF_KNOWLEDGE_BASE_ID"], {
"query": "appointment times"
})
# Keep knowledge and private results out of logs.
# Save the JSON below privately as request-117.json.
nixflex knowledge searchTopics "$env:NXF_KNOWLEDGE_BASE_ID" --body '@request-117.json' --confirm --json --base-url "https://api.nixflex.com"
{
"name": "search_knowledge_topics",
"arguments": {
"kb": "kb/example",
"query": "Example question"
}
}
{
"items": [],
"revision": 1
}
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:
Send a JSON object.
This POST performs a semantic search, not public call retrieval. It needs no Idempotency-Key and does not change topics. Up to 30 related pieces are returned; use local word filtering when semantic search is unnecessary. Only similarities of at least 0.25 are returned, ordered highest first. An empty live base returns an empty items array and the revision.
MCP has 97 registered tools, including 19 Knowledge tools. This example uses a registered tool; configure its credentials and permissions separately.
sources 50 · kbTokens 100,000 · topics 1,000.
Read the compact AI rules
Find related current topics for knowledge management.
Method: POST ·
Success: 200 ·
Scope: Owning account
The important part
- Search the chosen base with a bounded query.
- A search result does not confirm how an agent will answer a real call.
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
| Field | Type | Required | Default | Limits and meaning |
|---|---|---|---|---|
kb (path) | string | Yes | None | Opaque identifier. Keep it as a string. Format: uuid. |
| Field | Type | Required | Default | Limits and meaning |
|---|---|---|---|---|
query | string | Yes | None | Trimmed management search text. Maximum 200 characters. Minimum 2 characters. |
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).
| Field | Type | Meaning |
|---|---|---|
items | array of object | Saved value. |
items[].id | string | Opaque identifier. Keep it as a string. Format: uuid. |
items[].title | string | Displayed piece title. |
items[].facts | string | Piece text. |
items[].questions | array of string | Labels kept from manual entry or earlier imports; new imports do not generate questions. |
items[].evidence | array of object | Saved value. |
items[].evidence[].source | string | Opaque identifier. Keep it as a string. Format: uuid. |
items[].evidence[].segment | integer | Source segment index. |
items[].evidence[].quote | string | Original evidence text. |
items[].evidence[].quote_hash | string | Digest used by a deletion record. |
items[].evidence[].topic_id | string | Opaque identifier. Keep it as a string. Format: uuid. |
items[].evidence[].revision | string | Opaque identifier. Keep it as a string. Format: uuid. |
items[].evidence[].title | string | Title snapshot at answer time. |
items[].manual | boolean | True when manually written or corrected. |
items[].valid_from | string or null | UTC timestamp. Format: date-time. |
items[].valid_until | string or null | UTC timestamp. Format: date-time. |
items[].suppressed | boolean | True while an edited old piece must not be used. |
items[].origin | string | Optional origin marker from earlier imports. |
items[].position | object | Stable display-order metadata. |
items[].position.added_at | string | UTC timestamp. Format: date-time. |
items[].position.source | integer | Saved value. |
items[].position.segment | integer | Saved value. |
items[].page_name | string | Optional source page label. |
items[].title_page | string | Optional label used to distinguish similar automatic titles. |
items[].review_flags | array of string | Allowed items: "agent_instructions", "suspicious_link", "payment_details", "sensitive_data", "website_junk", "code_example". |
items[].check_required | boolean | A flagged topic needs explicit individual approval. |
items[].check_reasons | array of string | Saved value. |
items[].check_reason | string | Compatibility joined review reasons. |
items[].keyterms | object | Read-only metadata. Refresh scheduling is still being checked separately; do not send it in writes. |
items[].keyterms.version | integer | Stored automatic-term format version. |
items[].keyterms.fingerprint | string | Digest of the source text used to validate cached terms. |
items[].keyterms.terms | array of string | Stored suggested terms. |
items[].keyterms.ranks | object | Keys are normalized terms; each value records score (1–4) and essential (boolean). |
items[].score | number | Similarity diagnostic, not correctness. |
revision | integer | Current knowledge-base revision; not a pagination cursor. Minimum 1. |
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 inNIXFLEX_API_KEY and the owned path identifiers shown below in environment variables. Submit this calculation deliberately.
request-117.json
{
"query": "appointment times"
}
curl --request POST \
--url "https://api.nixflex.com/v1/knowledge-bases/$(node -p 'encodeURIComponent(process.env.NXF_KNOWLEDGE_BASE_ID)')/topic-search" \
--header "Authorization: Bearer $NIXFLEX_API_KEY" \
--header "Content-Type: application/json" \
--data '{"query":"appointment times"}'
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.searchTopics(process.env.NXF_KNOWLEDGE_BASE_ID, {"query":"appointment times"});
// Keep knowledge and private results out of logs.
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.search_topics(os.environ["NXF_KNOWLEDGE_BASE_ID"], {
"query": "appointment times"
})
# Keep knowledge and private results out of logs.
# Save the JSON below privately as request-117.json.
nixflex knowledge searchTopics "$env:NXF_KNOWLEDGE_BASE_ID" --body '@request-117.json' --confirm --json --base-url "https://api.nixflex.com"
{
"name": "search_knowledge_topics",
"arguments": {
"kb": "kb/example",
"query": "Example question"
}
}
Example response
Illustrative response; identifiers are placeholders and optional fields can be absent.{
"items": [],
"revision": 1
}
Errors
Failures useerror.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 | Check the information and try again. | Correct the named fields or reduce the input before retrying. |
| 404 | not_found | That topic is not available. | Check the owned identifier and feature availability. |
| 409 | deleting | This knowledge base is being deleted. | Read current state and resolve the conflict before sending a new request. |
| 503 | 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 | Knowledge is not available yet. | Retry reads with bounded backoff; reconcile writes before repeating. |
| 503 | knowledge_not_released | Knowledge is not released yet. | Retry reads with bounded backoff; reconcile writes before repeating. |
| 403 | permission_denied | Your personal role does not allow this action. | Use a permitted personal account; do not share the organisation key. |
| 403 | membership_revoked | Your membership has ended. | Use a permitted personal account; do not share the organisation key. |
| 401 | unauthorized | The credential is missing or invalid. | Check the full account credential. |
| 429 | rate_limit_exceeded | The account request limit was reached. | Wait for the stated retry/reset time. |
| 503 | index_version | This knowledge index needs updating before it can be searched. | Retry reads with bounded backoff; reconcile writes before repeating. |
| 409 | knowledge_updating | Knowledge is still changing. Your test is saved; ask again in a moment. | Read current state and resolve the conflict before sending a new request. |
| 503 | index_unavailable | The search index could not be prepared. | Retry reads with bounded backoff; reconcile writes before repeating. |
| 400 | invalid_body | The request body could not be read. | Correct the named fields or reduce the input before retrying. |
| 413 | invalid_body | The request body is too large. | Keep the transport body within 10 MiB. |
Retry and idempotency
This is a read or calculation. GET requests may retry transient connection failures once with bounded backoff; respect Retry-After. Do not retry invalid input or ownership errors unchanged. POST calculations are not automatically retried.Related endpoints
Authorizations
Body
application/json