Skip to main content
Files can be uploaded to your Space through the web interface or programmatically via the API. Once uploaded, files are processed automatically and become available for search, AI interaction, and sharing.

Via the UI

Upload files through the Space interface using drag-and-drop or the file picker:
  • Upload Files — select individual files from your device
  • Upload Folder — upload an entire folder and its contents
  • Create a Folder — organize files into folders before or after uploading
Multiple files can be uploaded simultaneously. Upload progress is shown in real time.
After upload, files are indexed for search and become available for AI interaction. Most documents and images process within seconds. Large media files take longer.

Via the API

Upload a file programmatically using a multipart form request:
import requests

with open("report.pdf", "rb") as f:
    response = requests.post(
        "https://api.zarkai.xyz/v1/storage/files",
        headers={"x-api-key": "your_api_key"},
        files={"file": ("report.pdf", f, "application/pdf")},
    )

data = response.json()
print(data["fileId"])  # e.g. "file-55f3fa40-9883-45d5-a877-a68264d58929"

Response

{
  "fileId": "file-55f3fa40-9883-45d5-a877-a68264d58929"
}
The returned fileId is used to reference this file in subsequent API calls — chat requests, file management, and deletion.

Using Uploaded Files in Chat

Once a file is uploaded, reference it in chat requests via the file_ids parameter:
{
  "messages": [
    {"role": "user", "content": "Summarize this document"}
  ],
  "workspace_id": "wks-xxxxx",
  "file_ids": ["file-55f3fa40-9883-45d5-a877-a68264d58929"],
  "tool_choice": "auto"
}
Zark detects the file type and routes to the appropriate tool — File Manager for reading and summarization, Database Queries for data files, Media Processor for transcription.

Processing by File Type

Different file types are processed differently after upload:
File typeProcessing
Documents (PDF, Word, etc.)Text and structure extracted. Tables preserved as queryable data. Scanned documents processed with OCR
Images (PNG, JPG, etc.)Visual content analyzed. Text extracted via OCR. Objects, scenes, and context identified
Data files (CSV, Excel, etc.)Structure parsed, columns detected, data types inferred, formatting cleaned. Becomes a queryable table
Audio (MP3, WAV, etc.)Available for AI questions immediately. Full transcription via Media Processor
Video (MP4, MOV, etc.)Available for AI questions immediately. Full transcription and visual analysis via Media Processor
Code (Python, JS, etc.)Content indexed for search and AI interaction

Supported Formats

CategoryFormats
DocumentsPDF, Word (.docx, .doc), PowerPoint (.pptx, .ppt), Markdown, HTML, plain text, RTF
ImagesPNG, JPG, JPEG, SVG, GIF, WebP, BMP, TIFF, HEIC
VideosMP4, MOV, AVI, MKV, WebM
AudioMP3, WAV, M4A, FLAC, OGG
DataCSV, TSV, Excel (.xlsx, .xls), JSON, Parquet
CodePython, JavaScript, and other common formats