Skip to main content
POST
Workspace: File Write
Create or overwrite a file in the per-agent workspace filesystem. When create_dirs is true, any missing parent directories are created automatically.

Path Parameters

string
required
Agent ID (UUID)

Request Body

string
required
Destination file path relative to the workspace root.
string
required
Full file content. Existing files are overwritten.
boolean
default:true
When true, missing parent directories are created automatically.

Response

string
Result status (e.g., ok).
string
Path of the file that was written.

Example Request

Notes

  • file_write overwrites existing files. To modify an existing file in place, prefer File Edit or Multi Edit.
  • Paths must be relative to the workspace root.

See Also

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

agent_id
string
required

Body

application/json
path
string
required

Relative path where the file should be written. Creates or overwrites the file.

Example:

"output/report.txt"

content
required

Complete content to write. A string is written verbatim; a JSON object/array is auto-serialized to pretty JSON.

Example:

"Hello World\n"

create_dirs
boolean
default:true

If true, creates parent directories automatically if they don't exist.

Response

Successful Response

path
string
required

The path where the file was written

bytes_written
integer
default:0

Number of bytes written to the file

Example:

12

created
boolean
default:false

True if this was a new file, False if overwritten