curl --request GET \
--url "https://api.nixflex.com/v1/agents/$(node -p 'encodeURIComponent(process.env.NXF_AGENT_ID)')/knowledge-base" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
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.getScope(process.env.NXF_AGENT_ID);
// 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.get_scope(os.environ["NXF_AGENT_ID"])
# Keep knowledge and private results out of logs.
nixflex knowledge getScope "$env:NXF_AGENT_ID" --json --base-url "https://api.nixflex.com"
{
"name": "get_agent_knowledge",
"arguments": {
"target": "target/example"
}
}
{
"mode": "own",
"own": null,
"effective": null,
"policy_revision": 0
}
Knowledge
Get agent knowledge
Read an agent’s own knowledge base, settings and current revision. Keep a missing base distinct from an unavailable read.
GET
/
agents
/
{target}
/
knowledge-base
curl --request GET \
--url "https://api.nixflex.com/v1/agents/$(node -p 'encodeURIComponent(process.env.NXF_AGENT_ID)')/knowledge-base" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
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.getScope(process.env.NXF_AGENT_ID);
// 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.get_scope(os.environ["NXF_AGENT_ID"])
# Keep knowledge and private results out of logs.
nixflex knowledge getScope "$env:NXF_AGENT_ID" --json --base-url "https://api.nixflex.com"
{
"name": "get_agent_knowledge",
"arguments": {
"target": "target/example"
}
}
{
"mode": "own",
"own": null,
"effective": null,
"policy_revision": 0
}
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:
Do not send a request body.
An agent without knowledge returns own:null and effective:null. Knowledge belongs only to agents; there is no number inheritance.
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
Read the agent’s own knowledge base, settings and current revision.
Method: GET ·
Success: 200 ·
Scope: Owning account
The important part
- Read this agent’s own knowledge base, settings and current revision.
- A missing base is different from a failed read; preserve that distinction.
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 |
|---|---|---|---|---|
target (path) | string | Yes | None | Owned agent ID. URL-encode it as a path segment. |
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 |
|---|---|---|
mode | string | Value: "own". |
own | object or null | Saved value. |
own.id | string | Opaque identifier. Keep it as a string. Format: uuid. |
own.owner | string | Owning account identifier; it never grants access when sent by a caller. |
own.kind | string | Knowledge belongs to an agent. Value: "agent". |
own.target | string | Owning agent ID. |
own.rev | integer | Latest integer revision read from this resource; it must still match when the request runs. Minimum 1. |
own.active | string or null | Active published index revision, or null before publication. Format: uuid. |
own.state | string | Lifecycle state. Allowed: "ready", "deleting", "deleted". |
own.settings | object | Only channels, match and not_found may be supplied. Omitted settings retain the saved value on update. |
own.settings.channels | array of string | Enabled knowledge channels. An empty list turns knowledge off for all channels. Allowed items: "inbound", "outbound", "web_voice", "web_chat", "sms". |
own.settings.match | string | Answer matching mode. Allowed: "Strict", "Normal". |
own.settings.not_found | string | Nonblank response when suitable knowledge is missing. Maximum 500 characters. Minimum 1 characters. |
own.tombstones | array of object | Records that prevent refreshed sources restoring removed pieces. |
own.tombstones[].id | string | Opaque identifier. Keep it as a string. Format: uuid. |
own.tombstones[].subject_hash | string | Normalized title digest. |
own.tombstones[].evidence | array of object | Saved value. |
own.tombstones[].evidence[].source | string | Opaque identifier. Keep it as a string. Format: uuid. |
own.tombstones[].evidence[].segment | integer | Source segment index. |
own.tombstones[].evidence[].quote | string | Original evidence text. |
own.tombstones[].evidence[].quote_hash | string | Digest used by a deletion record. |
own.tombstones[].evidence[].topic_id | string | Opaque identifier. Keep it as a string. Format: uuid. |
own.tombstones[].evidence[].revision | string | Opaque identifier. Keep it as a string. Format: uuid. |
own.tombstones[].evidence[].title | string | Title snapshot at answer time. |
own.created_at | string | UTC timestamp. Format: date-time. |
effective | object or null | Saved value. |
effective.id | string | Opaque identifier. Keep it as a string. Format: uuid. |
effective.owner | string | Owning account identifier; it never grants access when sent by a caller. |
effective.kind | string | Knowledge belongs to an agent. Value: "agent". |
effective.target | string | Owning agent ID. |
effective.rev | integer | Latest integer revision read from this resource; it must still match when the request runs. Minimum 1. |
effective.active | string or null | Active published index revision, or null before publication. Format: uuid. |
effective.state | string | Lifecycle state. Allowed: "ready", "deleting", "deleted". |
effective.settings | object | Only channels, match and not_found may be supplied. Omitted settings retain the saved value on update. |
effective.settings.channels | array of string | Enabled knowledge channels. An empty list turns knowledge off for all channels. Allowed items: "inbound", "outbound", "web_voice", "web_chat", "sms". |
effective.settings.match | string | Answer matching mode. Allowed: "Strict", "Normal". |
effective.settings.not_found | string | Nonblank response when suitable knowledge is missing. Maximum 500 characters. Minimum 1 characters. |
effective.tombstones | array of object | Records that prevent refreshed sources restoring removed pieces. |
effective.tombstones[].id | string | Opaque identifier. Keep it as a string. Format: uuid. |
effective.tombstones[].subject_hash | string | Normalized title digest. |
effective.tombstones[].evidence | array of object | Saved value. |
effective.tombstones[].evidence[].source | string | Opaque identifier. Keep it as a string. Format: uuid. |
effective.tombstones[].evidence[].segment | integer | Source segment index. |
effective.tombstones[].evidence[].quote | string | Original evidence text. |
effective.tombstones[].evidence[].quote_hash | string | Digest used by a deletion record. |
effective.tombstones[].evidence[].topic_id | string | Opaque identifier. Keep it as a string. Format: uuid. |
effective.tombstones[].evidence[].revision | string | Opaque identifier. Keep it as a string. Format: uuid. |
effective.tombstones[].evidence[].title | string | Title snapshot at answer time. |
effective.created_at | string | UTC timestamp. Format: date-time. |
policy_revision | integer | Compatibility value; zero for agent-only knowledge. Value: 0. |
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. Keep private responses out of logs.
curl --request GET \
--url "https://api.nixflex.com/v1/agents/$(node -p 'encodeURIComponent(process.env.NXF_AGENT_ID)')/knowledge-base" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
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.getScope(process.env.NXF_AGENT_ID);
// 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.get_scope(os.environ["NXF_AGENT_ID"])
# Keep knowledge and private results out of logs.
nixflex knowledge getScope "$env:NXF_AGENT_ID" --json --base-url "https://api.nixflex.com"
{
"name": "get_agent_knowledge",
"arguments": {
"target": "target/example"
}
}
Example response
Illustrative response; identifiers are placeholders and optional fields can be absent.{
"mode": "own",
"own": null,
"effective": null,
"policy_revision": 0
}
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. |