Workspace: File Edit
Agent Workspace
Workspace: File Edit
Edit a file in the agent’s workspace by replacing an exact text occurrence
POST
Workspace: File Edit
Edit a file in the per-agent workspace by replacing an exact text occurrence.
old_text must match the existing file content exactly, including whitespace and indentation.
Path Parameters
Agent ID (UUID)
Request Body
Path to the file to edit, relative to the workspace root.
Exact text to find and replace. Must match existing file content, including whitespace.
Replacement text. Use an empty string to delete the matched content.
Response
Result status (e.g.,
ok).Path of the file that was edited.
Example Request
Notes
- The match is exact and case-sensitive. If
old_textappears more than once in the file, the request fails — include additional surrounding context inold_textto make the match unique. - To apply several edits atomically, use Workspace: Multi Edit instead.
See Also
Authorizations
API Key for authentication
Path Parameters
Body
application/json
Relative path to the file to edit.
Example:
"app.py"
The exact text to find and replace. Must match the file content exactly (whitespace-sensitive).
Example:
"DEBUG = True"
The replacement text that will substitute old_text.
Example:
"DEBUG = False"

