Create or replace a file
Write a project file. Parent folders may be created explicitly before writing.
API 2.7.0 · Published service contract ↗
Request
Base URL: https://app.sym.so/v1/workspaces/{workspace_id}
Authentication: bearer. Required scope: files:write.
PUT /agents/{agent_id}/files/content
Write a project file. Parent folders may be created explicitly before writing.
| Parameter | Type | Description |
|---|---|---|
agent_idpath · required | string | Authorized Agent ID. |
pathquery · required | string | Relative destination path. |
If-Matchheader | string | Optional version token for conflict-safe replacement. |
curl --fail-with-body -X PUT "https://app.sym.so/v1/workspaces/$WORKSPACE_ID/agents/$AGENT_ID/files/content?path=$SYM_QUERY_PATH_URLENCODED" \
-H "Authorization: Bearer $SYM_WORKSPACE_API_KEY" \
-H "Content-Type: application/json" \
--data "{\"content\":\"# Updated brief\\n\",\"encoding\":\"utf-8\"}"{
"worker_id": "worker-example-001",
"org_id": "workspace_example",
"file": {
"path": "notes/brief.md",
"size": 16,
"version": "sha256:4f4a..."
},
"created": false,
"ok": true
}Authorization
{
"type": "bearer",
"scope": "files:write",
"transport": "Authorization: Bearer <workspace_api_key>"
}Errors
| Status | Description |
|---|---|
| 400 | The request body or parameters are invalid. |
| 401 | The workspace API key is missing, invalid, expired, or revoked. |
| 403 | The key lacks the required scope or its owner no longer has permission. |
| 404 | The resource is missing or intentionally hidden by authorization. |
| 429 | The key exceeded its current rate limit. |