POST

Add File Source

Uploads a document (PDF, DOCX, TXT, or Markdown) as a source.

POSThttps://api.vantaxai.com/v1/knowledge-bases/{knowledgebase_id}/sources/file

The uploaded file is parsed, chunked, and embedded. The source begins in the `processing` state while extraction runs and becomes `ready` once indexing completes.

multipart/form-data

This endpoint accepts a `multipart/form-data` body, not JSON. Send the binary file in the `file` field and an optional `title` field. Do not set a `Content-Type: application/json` header — your HTTP client sets the multipart boundary automatically.

Headers

  • Authorizationstringrequired

    Bearer authentication with your secret API key.

    example: Bearer vx_live_3fa9c2…

Path Parameters

  • knowledgebase_idstringrequired

    The knowledge base to add the source to.

    example: kb_71ac0

Body Parameters

  • filefilerequired

    The document to upload. Supported types: PDF, DOCX, TXT, Markdown (max 25 MB).

  • titlestringoptional

    Optional label. Defaults to the uploaded file name.

Request

curl -X POST https://api.vantaxai.com/v1/knowledge-bases/kb_71ac0/sources/file \
  -H "Authorization: Bearer vx_live_3fa9c2..." \
  -H "Content-Type: application/json" \
  -d '{
  "file": "string",
  "title": "string"
}'

Response

{
  "success": true,
  "message": "Source added successfully",
  "data": {
    "id": "doc_9a3c52",
    "knowledgebase_id": "kb_71ac0",
    "type": "file",
    "title": "Patient Handbook.pdf",
    "status": "processing",
    "created_at": "2026-01-14T10:30:00Z"
  }
}