Skip to main content
POST
/
api
/
knowledge-base
Upload Document
curl --request POST \
  --url https://api.example.com/api/knowledge-base \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "text": "<string>",
  "agent_id": "<string>"
}
'
{
  "documentation_id": "doc_123",
  "name": "FAQ.pdf",
  "type": "file",
  "message": "File 'FAQ.pdf' uploaded and syncing to knowledge base",
  "ingestion_job_id": "job_abc"
}
Upload a document (File or Text) to the knowledge base. This triggers an ingestion process to make the content searchable by agents.
name
string
required
The name of the document.
file
file
The file to upload (e.g., PDF, DOCX, TXT). Required if text is not provided.
text
string
Raw text content. Required if file is not provided.
agent_id
string
Optional Agent ID to immediately attach this document to.

Response

documentation_id
string
The unique identifier of the created document.
ingestion_job_id
string
ID of the background job processing the document.
{
  "documentation_id": "doc_123",
  "name": "FAQ.pdf",
  "type": "file",
  "message": "File 'FAQ.pdf' uploaded and syncing to knowledge base",
  "ingestion_job_id": "job_abc"
}