Add knowledge source
curl --request POST \
--url https://prod-platform-core-api.20x.business/api/v1/knowledge-bases/{id}/sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceType": "<string>",
"sourceName": "<string>"
}
'import requests
url = "https://prod-platform-core-api.20x.business/api/v1/knowledge-bases/{id}/sources"
payload = {
"sourceType": "<string>",
"sourceName": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sourceType: '<string>', sourceName: '<string>'})
};
fetch('https://prod-platform-core-api.20x.business/api/v1/knowledge-bases/{id}/sources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Knowledge Bases
Add knowledge source
Ingest text, FAQs, or documents into a knowledge base for RAG context retrieval
POST
/
knowledge-bases
/
{id}
/
sources
Add knowledge source
curl --request POST \
--url https://prod-platform-core-api.20x.business/api/v1/knowledge-bases/{id}/sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceType": "<string>",
"sourceName": "<string>"
}
'import requests
url = "https://prod-platform-core-api.20x.business/api/v1/knowledge-bases/{id}/sources"
payload = {
"sourceType": "<string>",
"sourceName": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sourceType: '<string>', sourceName: '<string>'})
};
fetch('https://prod-platform-core-api.20x.business/api/v1/knowledge-bases/{id}/sources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Adds a new document or text knowledge source to an existing knowledge base. The platform automatically breaks the text into chunks, generates vector embeddings, and indexes them for RAG retrieval during agent calls.
Path parameters
string
required
UUID of the target knowledge base
Body parameters
string
required
Type of the source —
text, url, or filestring
required
Human-readable title (e.g.
Refund Policy 2026 or Company FAQ)string
The text content to ingest (required when
sourceType is text)string
The webpage URL to scrape and index (required when
sourceType is url)curl -X POST https://prod-comms-engine-api.20x.business/api/v1/knowledge-bases/KB_ID/sources \
-H "Authorization: Bearer $AGENTIC_OS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sourceType": "text",
"sourceName": "Product Pricing & Terms",
"rawText": "Our basic plan starts at $49/mo and includes 500 voice minutes. Enterprise plans include custom LLM fine-tuning and dedicated support."
}'
import os, requests
resp = requests.post(
"https://prod-comms-engine-api.20x.business/api/v1/knowledge-bases/KB_ID/sources",
headers={
"Authorization": f"Bearer {os.environ['AGENTIC_OS_API_KEY']}",
"Content-Type": "application/json",
},
json={
"sourceType": "text",
"sourceName": "Product Pricing & Terms",
"rawText": "Our basic plan starts at $49/mo and includes 500 voice minutes. Enterprise plans include custom LLM fine-tuning and dedicated support.",
},
)
print(resp.json())
await fetch("https://prod-comms-engine-api.20x.business/api/v1/knowledge-bases/KB_ID/sources", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AGENTIC_OS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
sourceType: "text",
sourceName: "Product Pricing & Terms",
rawText: "Our basic plan starts at $49/mo and includes 500 voice minutes. Enterprise plans include custom LLM fine-tuning and dedicated support.",
}),
});
Response
{
"id": "source_789012",
"knowledgeBaseId": "kb_123456",
"sourceName": "Product Pricing & Terms",
"sourceType": "text",
"status": "PROCESSING",
"createdAt": "2026-08-15T12:00:00.000Z"
}

