Skip to main content

Overview

Every agent on the Shinzo Platform has a persistent workspace — an isolated filesystem where it can store configuration, data, and generated artifacts. The Filesystem API gives you full programmatic access to read, write, search, and organize files within any agent’s workspace. All filesystem endpoints follow the pattern:
File and directory paths are specified as wildcard parameters in the URL. For example, to read a file at workspace/config.json, you would call:

File Operations

Read a File

Retrieve the contents of a file from an agent’s workspace:
You can request the response in utf-8 (default) or base64 encoding by passing the encoding query parameter. Use base64 for binary files such as images or compiled assets.

Create a File

Create a new file in the agent workspace:

Update a File

Replace the contents of an existing file:

Delete a File

Remove a file from the workspace:

Patch a File

Apply partial updates to a file without replacing its entire contents. Supported operations are append, prepend, insert, and replace.

Directory Operations

List a Directory

List the contents of a directory in the agent workspace:

Create a Directory

Set recursive to true to create parent directories that do not exist yet.

Delete a Directory

Deleting a directory with recursive: true permanently removes all files and subdirectories within it. This cannot be undone.

Bulk Operations

Copy

Copy a file or directory to a new location within the workspace:

Move

Move or rename a file or directory:
Search for files by name, content, or both within an agent’s workspace:

Archives

Create an Archive

Package files and directories into a compressed archive:
Supported formats: zip, tar, tar.gz, tar.bz2.

Extract an Archive

Extract an archive into a target directory:

File Metadata

Get Metadata

Retrieve metadata for a file or directory, including size, permissions, and timestamps:

Update Metadata

Update file permissions, ownership, or tags:

Practical Examples

Seeding an Agent Workspace

After creating an agent, populate its workspace with configuration and data files:
You can also seed files at agent creation time using the initial_files parameter. See the Agent Configuration guide for details.

Backing Up Agent Data

Create a compressed archive of important workspace data:

Best Practices

  • Use initial_files for bootstrapping. Provide configuration and seed data at agent creation time rather than making separate API calls afterward.
  • Use base64 encoding for binary files. Text files work with the default utf-8, but images, compiled assets, and other binary content require base64.
  • Prefer patch over full updates for large files. Appending log entries or inserting content at a specific position is more efficient than re-uploading the entire file.
  • Set overwrite: false as a safety measure. This prevents accidental data loss when creating or copying files.
  • Organize workspaces with clear directory structures. Use consistent paths like config/, data/, and output/ across your agents.

Next Steps

Agent Configuration

Configure agent workspaces, memory, and initial files.

Agent Messaging

Send messages to agents and retrieve conversation history.