Skip to content

Knowledge

Manage your Knowledge Base programmatically so chat and intel can ground answers on your own material.

POST /api/knowledge

Add a source by URL or by text. The source is queued for indexing and becomes usable once its status reaches indexed.

FieldTypeDescription
urlstringIndex a single web page.
textstringIndex raw text you provide.
namestringOptional display name.
Terminal window
# Add a URL
curl https://ai.mixerlead.com/api/knowledge \
-H "Authorization: Bearer $MIXERLEAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com/whitepaper", "name": "Whitepaper" }'
Response (200)
{ "id": "kb_…", "status": "indexing" }

To upload a file, send a multipart/form-data request with a file field:

Terminal window
curl https://ai.mixerlead.com/api/knowledge \
-H "Authorization: Bearer $MIXERLEAD_API_KEY" \
-F "file=@./brand-guidelines.pdf"

POST /api/knowledge/crawl

FieldTypeRequiredDescription
seedUrlstringThe starting URL to crawl.
maxPagesnumberMaximum pages to index.
Terminal window
curl https://ai.mixerlead.com/api/knowledge/crawl \
-H "Authorization: Bearer $MIXERLEAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "seedUrl": "https://example.com/docs", "maxPages": 12 }'
Response (200)
{ "crawlId": "", "status": "indexing", "maxPages": 12 }

GET /api/knowledge

Response (200)
{
"sources": [
{
"id": "kb_…",
"type": "url",
"source_url_or_path": "https://example.com/whitepaper",
"status": "indexed",
"chunk_count": 42,
"enabled": 1,
"created_at": "2026-06-11T10:00:00Z",
"indexed_at": "2026-06-11T10:01:12Z",
"last_error": null
}
]
}

PATCH /api/knowledge/{id}

Only enabled sources are used for grounding. Disable a source to remove it from answers without deleting it.

Terminal window
curl -X PATCH https://ai.mixerlead.com/api/knowledge/kb_123 \
-H "Authorization: Bearer $MIXERLEAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "enabled": false }'

POST /api/knowledge/{id}/reindex

Re‑runs indexing for a single source (to pick up changes or recover from an error).

DELETE /api/knowledge/{id}

Terminal window
curl -X DELETE https://ai.mixerlead.com/api/knowledge/kb_123 \
-H "Authorization: Bearer $MIXERLEAD_API_KEY"