How to Use Fastio API for Batch File Operations
The Fastio API batch file operations guide shows developers how to handle multiple file uploads, downloads, and management tasks at scale. Build on workspaces, shares, and chunked upload sessions to process batches efficiently in agent workflows. This tutorial covers authentication, key endpoints, error handling, and optimization tips grounded in official API docs.
### What Are Batch File Operations with the Fastio API?
Batch file operations involve uploading, downloading, or processing multiple files programmatically via the Fastio API. This is common in agentic workflows where AI agents need to ingest datasets, media libraries, or document collections into shared workspaces.
Fastio workspaces provide the foundation for batch operations. Each workspace supports file organization, inline previews, semantic search, and AI chat over indexed content. Shares extend this for external collaboration.
Key API capabilities include POST https://api.fast.io/current/upload/batch/ for up to 200 files (4MB each, 100MB total), chunked sessions on POST https://api.fast.io/current/upload/ for larger files, file locks for concurrent access control, and activity polling to track batch progress without constant polling of individual files.
### How to Set Up Authentication and Start Batch Uploads
Start with authentication. Create an API key in Settings > Devices & Agents > API Keys, or with POST https://api.fast.io/current/user/auth/key/. Authenticated calls send Authorization: Bearer {api_key} against https://api.fast.io/current/. Keep the trailing slashes. Workspace IDs are 19-digit numeric strings.
For a batch of small files (up to 200 files, 4MB each, 100MB total), post to the batch route:
POST https://api.fast.io/current/upload/batch/
Authorization: Bearer {api_key}
Content-Type: multipart/form-data
Uploads use multipart/form-data. For larger files, create a session with POST https://api.fast.io/current/upload/ (multipart fields name, size, action=create, instance_id={workspace_id}, folder_id=root; omit the chunk field). Then POST https://api.fast.io/current/upload/{id}/chunk/?order=N&size=N with multipart chunk, POST https://api.fast.io/current/upload/{id}/complete/, and GET https://api.fast.io/current/upload/{id}/details/?wait=60 until the session returns status and new_file_id. A single small file that includes the chunk bytes in the create request returns HTTP 201 with result, id, and new_file_id.
Agent integrations can use the MCP upload tool (actions batch, create-session, chunk, finalize) at https://mcp.fast.io/mcp, or https://mcp.fast.io/mcp/key with a Bearer header.
Implement Batch File Operations with Fastio API
Open a workspace, create an API key, and move file batches with POST /current/upload/batch/ or the MCP upload tool. Built for agent workflows that ingest datasets, media, and document collections.
### Best Practices for Large-Scale Batch Operations
Parallelize uploads across multiple connections to maximize throughput. Enable intelligence on workspaces for automatic indexing post-upload. This supports semantic search and RAG chat with Ripley (the built-in RAG agent) over your batch files. When you receive HTTP 429 with error code 1671, back off until the x-ve-limit-expires header, then retry. After the batch lands, invite teammates with POST /current/workspace/{workspace_id}/members/{email_or_user_id}/ and share folders through Send, Receive, or Exchange. Workspace intelligence. For optimal performance, test concurrency limits and adjust based on your observed throughput.
### Common Errors and Troubleshooting Batch Jobs
Rate limits return HTTP 429 with error code 1671. Back off until the x-ve-limit-expires header, then retry. Other codes include 1605 Invalid Input, 1609 Not Found, 1650 Auth Invalid, 1680 Access Denied, 1685 Feature Limit, and 1654 Internal Error. For a failed chunk, resend POST /current/upload/{id}/chunk/?order=N&size=N with the same order, then POST /current/upload/{id}/complete/ and GET /current/upload/{id}/details/?wait=60. Confirm workspace membership before you write. Implement structured logging so you can correlate failures across a batch.
Frequently Asked Questions
How do I upload multiple files in batch using Fastio API?
POST https://api.fast.io/current/upload/batch/ for up to 200 files (4MB each, 100MB total). For larger files, create a session with POST https://api.fast.io/current/upload/, send chunks to /current/upload/{id}/chunk/, then complete and poll details. Agents can call the MCP upload tool with action batch.
What are the limits for batch file operations?
POST /current/upload/batch/ accepts up to 200 files, 4MB each, and 100MB total. Larger files use a chunked session on POST /current/upload/, then /chunk/, /complete/, and /details/.
Can agents perform batch operations autonomously?
Yes. Connect the agent to the MCP server at https://mcp.fast.io/mcp (or https://mcp.fast.io/mcp/key with a Bearer header) and call the upload tool with action batch. The same work is available over REST at POST https://api.fast.io/current/upload/batch/ and POST https://api.fast.io/current/upload/.
How to handle concurrent batch uploads?
Lock a file with POST /current/workspace/{workspace_id}/storage/{node_id}/lock/ and send lock/heartbeat/ while you write. Unlock with DELETE on the same lock route. Watch progress with GET /current/activity/poll/{entityId}?wait=95&lastactivity={timestamp} or review the audit log at GET /current/events/search/.
Related Resources
Implement Batch File Operations with Fastio API
Open a workspace, create an API key, and move file batches with POST /current/upload/batch/ or the MCP upload tool. Built for agent workflows that ingest datasets, media, and document collections.