Knowledge Base
Upload a document
Upload a document to a knowledge base by providing a URL (web page or file) or raw text content. The document is processed asynchronously — the response confirms the document was accepted and queued for processing.
When uploading raw text that you've already extracted yourself (for example, from an internal wiki or an auth-gated page), you can optionally pass sourceUrl to record the original URL as the document's source for retrieval and citation.
Supported file formats: PDF, DOCX, DOC, TXT, CSV, XLSX, XLS, PPTX, PPT, MP3, WAV, OGG, M4A, WEBM, PNG, JPG, JPEG, GIF, WEBP
post/knowledge-bases/{id}/documents
Request
- Base URLhttps://api.markcopy.ai/api/v1
- AuthAPI key in header X-API-Key
Path parameters
idstring required
Example:kb_a8f3x9k2m4pQ
The external ID of the knowledge base (prefixed with kb_).
Request body
Example request
{
"url": "https://example.com/report.pdf",
"text": "Our company was founded in 2020...",
"name": "Q4 2025 Report",
"tags": [
"reports",
"quarterly"
],
"sourceUrl": "https://wiki.internal/page-1",
"mimeType": "text/markdown"
}Response
Document accepted and queued for processing.
Example response
{
"id": "doc_b7n4p1q8r3wX",
"jobId": "job_a8f3x9k2m4pQ",
"name": "Q4 2025 Report",
"tags": [
"reports",
"quarterly"
],
"sourceUrl": "https://wiki.internal/page-1",
"mimeType": "text/markdown"
}Changes
No recorded changes to this operation across all 1 revision of this API.