How to move files in and out of an AI agent's computer on Orgo
Upload inputs, drop a file in one exact folder, send large files in two steps, and export what the agent made.
Orgo's Files API moves files between your code and the computers your agents use. POST /files/upload sends a file of up to 10 MB to every running computer in a workspace, or to one folder on one computer. POST /files/uploads followed by POST /files/uploads/complete sends a larger file, up to 2 GB, to one computer. POST /files/export copies a file off a computer and returns a link that works for one hour. Large transfers must finish copying within 90 seconds, so files near 2 GB need a fast link.
Every call uses the same API key and base URL as the rest of the API, https://www.orgo.ai/api. Files that pass through workspace storage get a record you can list, download again and delete. Files placed straight into a folder do not.
Which call to use
| You want to | Endpoint | Size limit | Where the file lands | Stored in the workspace? |
|---|---|---|---|---|
| Give a small file to every running computer | POST /files/upload | 10 MB | The desktop folder of each running computer | Yes, with source upload |
| Put a small file in one folder on one computer | POST /files/upload with destPath | 10 MB | The folder you name, on one computer | No |
| Send a large file to one computer | POST /files/uploads, then POST /files/uploads/complete | 2 GB, copied within 90 s | The folder you name, on one computer | No |
| Get a file the agent made | POST /files/export | 2 GB, copied within 90 s | Workspace storage, plus a one-hour link | Yes, with source export |
The details below come from the Files API reference.
Uploading to every computer in a workspace
Send a multipart/form-data request to POST /files/upload with the file and a workspaceId. A desktopId associates the file with one computer but does not change where it goes (Upload file).
curl -X POST https://www.orgo.ai/api/files/upload \
-H "Authorization: Bearer $ORGO_API_KEY" \
-F "file=@./document.pdf" \
-F "workspaceId=$WORKSPACE_ID"- The file is stored in the workspace and pushed to the desktop folder of every Linux or Windows computer running at that moment. On Linux that is
/root/Desktop. - Computers that are stopped, or created later, do not receive it. Upload again to reach them.
- The push runs in the background and is best effort, so the response does not say whether each computer got the file.
- Each push sends the workspace's full set of uploaded files. A computer skips a file whose name already exists in its desktop folder rather than overwriting it.
The response is the stored record under file, including the id that the download and delete endpoints take. size_bytes is a decimal string, such as "102400", so parse it before doing arithmetic.
Putting a file in one folder on one computer
Add destPath and desktopId to the same request. The file lands at <destPath>/<file name> on that computer, and nothing else receives it. Use this when an agent expects its input in a particular place, such as a folder its script watches.
curl -X POST https://www.orgo.ai/api/files/upload \
-H "Authorization: Bearer $ORGO_API_KEY" \
-F "file=@./document.pdf" \
-F "workspaceId=$WORKSPACE_ID" \
-F "desktopId=$COMPUTER_ID" \
-F "destPath=/root/Documents"The response is {"ok": true, "placedIn": "/root/Documents"}.
destPathmust be an absolute folder, such as/root/Documentsor, on Windows,C:\Users\Public. The valuedesktopmeans the desktop folder of the computer's user.- A missing folder is created, on Linux and on Windows. A file of the same name is replaced.
- No file record is created, so the file does not appear in the list and cannot be downloaded or deleted through the API.
- If the computer does not confirm the write, or the request runs past 130 seconds, the answer is
502. If the computer can't be addressed, it is503with "Computer could not be reached." AdesktopIdthat is not inworkspaceIdalso gets that503, not a404, so check the pair first. - A computer locked for capacity takes no file and returns
402COMPUTER_LOCKED.
Uploading a file larger than 10 MB
Use the two-step upload, which takes up to 2 GB. The bytes go straight to storage and never pass through Orgo's API (Start large upload, Complete large upload).
- Start.
POST /files/uploadswithdesktopId,filenameandsize_bytes, and optionallydestPath. WithoutdestPath, the file lands on the computer's desktop. The answer has anupload_urland anupload_token. - PUT exactly
size_bytesbytes toupload_urlwithin 15 minutes. - Complete.
POST /files/uploads/completewith the samedesktopIdand theupload_token. The computer pulls the file into place.
SIZE=$(wc -c < ./dataset.zip | tr -d ' ')
START=$(curl -s -X POST https://www.orgo.ai/api/files/uploads \
-H "Authorization: Bearer $ORGO_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"desktopId\": \"$COMPUTER_ID\", \"filename\": \"dataset.zip\", \"size_bytes\": $SIZE, \"destPath\": \"/root/Documents\"}")
curl -T ./dataset.zip "$(echo "$START" | jq -r .upload_url)"
curl -X POST https://www.orgo.ai/api/files/uploads/complete \
-H "Authorization: Bearer $ORGO_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"desktopId\": \"$COMPUTER_ID\", \"upload_token\": \"$(echo "$START" | jq -r .upload_token)\"}"filenameis a plain name: no/or\, not.or.., and at most 255 characters.- The computer need not be running when you start, but it must be running when you complete. Otherwise the answer is
400with "Desktop is not running. Start it, then finish the upload." - Complete replaces a file of the same name, and creates a missing folder, on Linux and on Windows.
- The computer pulls the file with a 90 second limit, and returns
502"Could not place ..." if the copy doesn't finish. 2 GB in 90 seconds needs about 24 MB/s. - Start returns
upload_url,upload_token,method(PUT),expires_in(900) andnext. Complete returnsok,filename,placedInandsize_bytes. - The
upload_tokenis valid for one hour, for the same caller and computer only. If placing the file fails, the stored copy is kept, so you can call complete again with the same token. - As with a folder upload, the file lands on one computer and no record is written.
Getting a file off the computer
Call POST /files/export with the desktopId and the absolute path of the file. The computer sends it straight to storage, up to 2 GB (Export file).
curl -X POST https://www.orgo.ai/api/files/export \
-H "Authorization: Bearer $ORGO_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"desktopId\": \"$COMPUTER_ID\", \"path\": \"/root/Desktop/results.txt\"}"The answer has the stored file record and a signed url that expires after one hour. The export is recorded in the workspace with source set to export, so you can list it and get a fresh link later.
- The computer must be running. A stopped one returns
400with "Desktop is not running". pathmust be a regular file. A folder returns404with "No file at ...", so archive a folder into one file first, for example withtarthrough the bash endpoint.- A file over 2 GB returns
413. - The copy to storage must finish within 90 seconds, or the answer is
502"Could not copy ...". Compress large files when you can. - The path must match the computer's OS. A Linux path on a Windows computer, or the reverse, returns
400.
A round trip in Python
This places an input file in a folder on the agent's computer, then exports the agent's output and saves it locally. It follows the upload and export examples in the docs.
import os
import requests
API = "https://www.orgo.ai/api"
headers = {"Authorization": f"Bearer {os.environ['ORGO_API_KEY']}"}
workspace_id = os.environ["WORKSPACE_ID"]
computer_id = os.environ["COMPUTER_ID"]
# 1. Put the input in one folder on the agent's computer
with open("leads.csv", "rb") as f:
placed = requests.post(
f"{API}/files/upload",
headers=headers,
files={"file": f},
data={
"workspaceId": workspace_id,
"desktopId": computer_id,
"destPath": "/root/Documents",
},
)
placed.raise_for_status()
print(placed.json()["placedIn"])
# 2. Your agent works on /root/Documents/leads.csv and writes report.csv
# 3. Copy the result off the computer and save it
export = requests.post(
f"{API}/files/export",
headers=headers,
json={"desktopId": computer_id, "path": "/root/Documents/report.csv"},
)
export.raise_for_status()
body = export.json()
with open("report.csv", "wb") as out:
out.write(requests.get(body["url"]).content)
print("Stored file id:", body["file"].get("id"))If the export record could not be saved, the answer still carries a working url, but file has only filename, size_bytes, content_type and source. That is why the sample reads id with .get().
Listing, downloading again and deleting
Files with a record, from a workspace upload or an export, can be managed later.
- List.
GET /files?workspaceId=...returns the workspace's files, newest first. AdddesktopIdto filter to one computer. Each entry hassource,uploadorexport(List files). - Download.
GET /files/download?id=...returns a signed URL, not the bytes. The URL works in any HTTP client without an auth header, carries the original file name, and expires one hour after it is issued, so request a new one rather than storing it (Download file). - Delete.
DELETE /files/delete?id=...removes the file from storage and the workspace for good. Links issued before the delete stop working. A copy already pushed to a computer's desktop stays on that computer (Delete file).
Errors
| Status | Message or code | What it means | What to do |
|---|---|---|---|
400 | "File too large (max 10MB)" | A single-step upload was over 10 MB | Use the two-step upload |
400 | "destPath requires desktopId" | You named a folder but not a computer | Add desktopId |
400 | "Desktop is not running" | Export or complete needs a running computer | Start the computer, then retry |
400 | "This upload expired." or "Invalid upload token." | The upload_token is over an hour old or not valid | Start the upload again |
404 | "No file at ..." | The export path is missing or is a folder | Check the path, or archive the folder first |
409 | "Upload is ... bytes, expected ..." | The bytes you PUT don't match size_bytes | Start again with the right size |
409 | "Nothing uploaded yet. PUT the file to upload_url first." | Complete ran before the PUT | PUT the bytes, then complete |
409 | "A folder named ... already exists in ..." | The destination has a folder with that name | Start again with another file name |
413 | "File is ... bytes; the limit is 2147483648" | The file is over 2 GB | Split or compress it |
402 | COMPUTER_LOCKED | The computer is locked for capacity | Free capacity, then retry |
403 | workspace_read_only | The key belongs to a Can chat member | Ask the owner for Full access |
403 | workspace_scope_mismatch | A workspace-scoped key named another workspace | Use a key scoped to the right workspace |
502 | "Could not place ..." or "Could not copy ..." | The computer didn't finish in time (90 s for large transfers) | Retry on a faster link, or compress. A large upload keeps its stored copy, so reuse the token |
503 | "Computer not ready" or "Computer could not be reached." | Orgo can't address the computer | Retry shortly |
Can chat members can't upload, export or delete files through the API. Export, the two-step upload and delete return 403 with workspace_read_only; a single-step POST /files/upload returns 403 with "Access denied".
The CLI and MCP
- CLI.
orgo fileshaslist,upload,download,exportanddelete. Upload caps at 10 MB and there is no two-step upload command; for larger files use the REST or MCP start and complete calls, or pull the data in from inside the computer (CLI guide). - Local MCP server. The file tools are
orgo_upload_file,orgo_start_file_upload,orgo_complete_file_upload,orgo_list_files,orgo_export_file,orgo_download_fileandorgo_delete_file(MCP guide). - Hosted MCP server. An OAuth sign-in can list, export, download and delete files, and do the two-step upload.
orgo_upload_fileis not offered there, because it reads the file from the machine running the server, and with an API key it is refused. Use the local server for it, or the two-step upload.
For more on connecting an agent to Orgo over MCP, see Orgo MCP for AI agents.
Other details
- Same name. A workspace upload skips a file whose name already exists in the desktop folder. A folder upload and a completed large upload replace it.
- Windows. Use Windows paths such as
C:\Users\PublicfordestPathand export paths. A Linux path on a Windows computer returns400on export and on the two-step upload. A single-step upload does not check, so always send a Windows path there. - Stopped computers. Files on a computer's disk are kept across stop and start (Stop computer). Deleting the computer removes them, so export what you need first. With no plan, an hourly computer stopped because its credit ran out keeps its files for 7 days, then the computer and its files are deleted unless you add credit or choose a plan with room for it (pricing).
Related
- Orgo MCP for AI agents
- The Orgo computer use API
- Pause, fork, and clone an AI agent's computer
- How to scale AI agent computers to thousands on Orgo