Skip to main content
The Files API lets you manage files and folders within a workspace.

Listing files

Uploading files

Upload a file using multipart form data:
For large files, the API also supports a multipart upload (/files/upload/initiate, /part, /complete, /abort).
The TypeScript SDK handles this for you: files.upload() automatically switches to a resilient multipart upload for large files (chunking, bounded concurrency, per-part retry, and progress), downloadStream() streams without buffering, and move / copy / delete work in batches.

Downloading files

Reading and writing file content

For text files, you can read and write content directly without downloading:

Read file content

Response:
Binary files come back with "encoding": "base64". Very large files must be downloaded instead. protection is non-null when the file is locked, and revision is what you pass back on a conditional write.

Update file content

Writing without clobbering someone else

A plain write overwrites whatever is there. When an agent, a collaborator, or another job might be editing the same file, write conditionally instead:
The two cannot be combined.

File management

Create a folder

Move or rename

Delete files

Versions

When versioning is on for the workspace, every write keeps the previous copy.

Referring to a file that might move

Paths change; ids do not. Ask for a file’s stable id once and store that instead, then resolve it back to a path when you need to read the file.
Ids look like argfile_… and survive renames and moves. Documents that embed other files use them for exactly this reason - see list references and what points at a file. The optional kind is file by default. Send {"path":"/sites/portfolio","kind":"folder"} when the referenced node is a folder.

Locking a file

Lock a file to stop writes while something else owns it - a long import, a review window. The lock is enforced on every write path, agents included.
Release it with /files/unlock, and list active locks with /files/protections.

File sharing

Create a public download link for a file:
Shared files can be accessed without authentication. See the Sharing API for details.