Knowledge API
Manage documents in the RAG (Retrieval-Augmented Generation) knowledge base.
List Files
GET /v1/knowledge?agent_id=optional_filter
Scope required: files
Response
{
"files": [
{
"id": "doc_faq",
"filename": "faq.txt",
"content_summary": "Company FAQ document",
"status": "ready",
"size_bytes": 4521,
"agent_id": "agent_soporte",
"uploaded_at": "2026-05-01T10:00:00Z"
}
]
}
Ingest Document
POST /v1/knowledge/ingest
Upload text content to an agent's knowledge base. The document is queued for embedding and vectorization.
Request
{
"agent_id": "agent_soporte",
"filename": "returns_policy.txt",
"content": "Our return policy allows returns within 30 days of purchase..."
}
Response
{
"file_id": "doc-1715100000000-api-a1b2c3d4",
"status": "pending",
"message": "Document queued for RAG ingestion. Use GET /v1/knowledge to check status."
}
tip
The ingestion pipeline runs asynchronously. Check the file status by polling GET /v1/knowledge. Status transitions: pending → processing → ready.