Skip to main content
File Manager is the single entry point for everything related to your uploaded files. It handles all file types — documents, images, videos, audio, PDFs, spreadsheets, code — and supports semantic search, content reading, organizing, tagging, renaming, and answering questions about what’s inside your files.

Basic Usage

Ask questions about your files through natural language:
import requests

response = requests.post(
    "https://api.zarkai.xyz/v1/chat",
    headers={
        "x-api-key": "your_api_key",
        "Content-Type": "application/json",
    },
    json={
        "messages": [
            {"role": "user", "content": "What files do I have?"}
        ],
        "workspace_id": "wks-xxxxx",
        "tools": ["file_manager"],
        "tool_choice": "auto",
    },
)

data = response.json()
print(data["response"])

Chat with a Specific File

Reference a file by ID to ask questions about its contents:
{
  "messages": [
    {"role": "user", "content": "Summarize this document"}
  ],
  "workspace_id": "wks-xxxxx",
  "tools": ["file_manager"],
  "file_ids": ["file-abc123"],
  "tool_choice": "auto"
}
Zark reads the file contents and generates a summary based on what’s inside. This works with any file type — PDFs, images, videos, spreadsheets, code files.

Multiple File Queries

Query across multiple files simultaneously:
{
  "messages": [
    {"role": "user", "content": "Compare the key points between these two documents"}
  ],
  "workspace_id": "wks-xxxxx",
  "tools": ["file_manager"],
  "file_ids": ["file-abc123", "file-def456"],
  "tool_choice": "auto"
}

Working with Folders

Reference folders to browse or search within a specific location:
{
  "messages": [
    {"role": "user", "content": "Show me all PDFs in this folder"}
  ],
  "workspace_id": "wks-xxxxx",
  "tools": ["file_manager"],
  "folder_ids": ["folder-xyz789"],
  "tool_choice": "auto"
}

Capabilities

ActionExample prompts
Search”Find all documents tagged ‘finance’” / “Search for files about marketing”
Browse”What files do I have?” / “Show me my videos” / “List files in this folder”
Read”What’s inside this document?” / “Show me the contents of this file”
Summarize”Summarize this PDF” / “Give me the key points from this report”
Organize”Move this file to the Projects folder” / “Create a new folder called Reports”
Tag”Tag this file as ‘important’” / “Add the ‘Q4’ tag to these files”
Rename”Rename this file to ‘Q4 Report Final’” / “Rename this folder to ‘Archive‘“
Favorite”Add this file to favorites” / “Unfavorite this folder”
Describe”Describe this image” / “What’s in this photo?”
Answer questions”What’s discussed in this video?” / “Which document mentions the budget?”

Multi-Type Queries

File Manager handles queries across multiple file types in a single request. “Show me images, videos, and PDFs” is one File Manager task — not separate tasks per type:
{
  "messages": [
    {"role": "user", "content": "Show me all images and videos from last week"}
  ],
  "workspace_id": "wks-xxxxx",
  "tools": ["file_manager"],
  "tool_choice": "auto"
}

Viewing Media Files

File Manager handles viewing and questioning video and audio files — you don’t need a separate tool:
{
  "messages": [
    {"role": "user", "content": "What's discussed in this video at the 15-minute mark?"}
  ],
  "workspace_id": "wks-xxxxx",
  "tools": ["file_manager"],
  "file_ids": ["file-vid123"],
  "tool_choice": "auto"
}
File Manager handles viewing and content questions about media files. For heavy-duty transcription and indexing operations (speech-to-text pipeline, visual scene analysis, segment indexing), use Media Processor.

Supported File Types

CategoryFormats
DocumentsPDF, Word (.docx, .doc), PowerPoint, 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, Excel (.xlsx, .xls), JSON, Parquet
CodePython, JavaScript, and other common programming formats

Streaming

Python
import requests
import json

response = requests.post(
    "https://api.zarkai.xyz/v1/chat",
    headers={"x-api-key": "your_api_key", "Content-Type": "application/json"},
    json={
        "messages": [{"role": "user", "content": "Find all my PDF files"}],
        "workspace_id": "wks-xxxxx",
        "tools": ["file_manager"],
        "stream": True,
    },
    stream=True,
)

for line in response.iter_lines():
    if line:
        event = json.loads(line.decode("utf-8").removeprefix("data: "))
        if event["type"] == "file_search_results":
            for f in event["files"]:
                print(f"Found: {f['name']}")
        elif event["type"] == "ai_chunk":
            print(event["content"], end="", flush=True)
        elif event["type"] == "ai_complete":
            print("\n\nDone.")

Streaming Events

EventDescription
file_search_resultsList of matching files with metadata
ai_chunkIncremental text content (summaries, descriptions, answers)
ai_completeFinal response

How File Manager Differs from Other Tools

ToolWhat it does
File ManagerReads, searches, and organizes existing files
Image GeneratorCreates new images — cannot search or list files
Video GeneratorCreates new video — cannot search or list files
Artifact CreatorCreates new code/documents — cannot browse uploads
Media ProcessorRuns heavy processing pipelines on audio/video

Examples

What files do I have?
Find all documents tagged "finance"
Summarize this PDF
Rename this file to "Q4 Report Final"
Show me images and PDFs from last week
What's inside this document?
Which video mentions the budget discussion?