API v1
Agents
Agents Workspace

Workspace: File Write

Write (create or overwrite) a file in the agent's workspace filesystem.

post/v1/agents/{agent_id}/workspace/file_write

Request

  • Base URL
    https://api.xpander.ai (the document declares no server; this is the origin it was published from)
  • Auth
    API key in header x-api-key

Path parameters

agent_idstring required

Request body

pathstring required

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

create_dirsboolean

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

Example request

{
  "path": "output/report.txt"
}

Response

Successful Response

pathstring required

The path where the file was written

bytes_writteninteger

Number of bytes written to the file

createdboolean

True if this was a new file, False if overwritten

Example response

{
  "bytes_written": 12
}

Changes

No recorded changes to this operation across all 5 revisions of this API.