Sources Endpoints

Sources are documents (files or URLs) that are ingested and indexed.

POST /sources/upload

Upload a file to be processed.

Headers: x-api-key: chat_... (Standard for programmatic ingestion)

Form Data:

FieldTypeDescription
filefilePDF, TXT, MD, or DOCX

Response (202):

{
  "id": "src_123",
  "type": "file",
  "status": "processing",
  "metadata": {
    "filename": "document.pdf"
  }
}

POST /sources/url

Add a URL to be scraped.

{
  "url": "https://example.com/support"
}

GET /sources/{id}

Get source details and status.

Source Status

StatusDescription
pendingWaiting to be processed
processingCurrently being parsed/chunked
completedSuccessfully indexed
failedProcessing failed

DELETE /sources/{id}

Delete a source and its chunks.

Supported File Types

TypeExtensionNotes
PDF.pdfUp to 1000 pages
Markdown.md
Text.txt
HTML.html, .htm