Patch File
curl --request PATCH \
--url https://api.app.shinzo.ai/v1/agent/{agentId}/filesystem/files/{path} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operation": "<string>",
"content": "<string>",
"position": 123,
"length": 123
}
'Agent Filesystem
Patch File
Apply a partial update to a file in an agent’s workspace.
PATCH
/
v1
/
agent
/
{agentId}
/
filesystem
/
files
/
{path}
Patch File
curl --request PATCH \
--url https://api.app.shinzo.ai/v1/agent/{agentId}/filesystem/files/{path} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operation": "<string>",
"content": "<string>",
"position": 123,
"length": 123
}
'Authentication
Requires JWT token or Platform API key.string
required
Agent UUID
string
required
File path within the agent workspace (wildcard segment)
string
required
Patch operation:
append, prepend, or replacestring
required
Content to apply
number
Byte offset for
replace operationsnumber
Length for
replace operationsExample Request
Append content to the end of a file:curl -X PATCH "https://api.app.shinzo.ai/v1/agent/agt_abc123/filesystem/files/workspace/logs/app.log" \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: application/json" \
-d '{
"operation": "append",
"content": "\n2025-01-20 12:30:00 INFO Task completed"
}'
curl -X PATCH "https://api.app.shinzo.ai/v1/agent/agt_abc123/filesystem/files/workspace/data/config.txt" \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: application/json" \
-d '{
"operation": "replace",
"content": "new_value",
"position": 128
}'
Response
{
"path": "/workspace/logs/app.log",
"size": 2048,
"updated_at": "2025-01-20T12:30:00Z"
}
Response Fields
| Field | Type | Description |
|---|---|---|
path | string | Absolute path of the patched file |
size | number | New file size in bytes |
updated_at | string | Update timestamp (ISO 8601) |
Status Codes
| Code | Description |
|---|---|
200 | File patched successfully |
400 | Invalid request body or operation |
401 | Invalid authentication |
403 | Access denied |
404 | Agent or file not found |

