Update a session resource
⚠️
Preview — this feature is being built; the design below is the spec.
PATCH https://app.syntic.ai/v1/sessions/{session_id}/resources/{resource_id}Switch a resource between read-only and writable, or move a repository to another ref. Changing git.ref fetches and checks out the new ref in place; uncommitted changes in the working copy are discarded, so commit or export them first.
For how this fits into a full workflow, see Session resources.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer <key>: a private inference key (sk_live_...). See Authentication. |
syntic-beta | Yes, while in preview | agents-2026-11-01. Without it the call fails with 400 beta_required. See Versioning. |
Content-Type | Yes | application/json |
Path parameters
| Parameter | Type | Description |
|---|---|---|
session_id | string | The session id, starting with sesn_. |
resource_id | string | The resource id, starting with sres_. |
Body parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
read_only | boolean | No | New mount mode. |
git | object | No | Only ref may change. |
Response
200 OK, Content-Type: application/json
{
"id": "sres_01JCB2E4G6J8L0N2Q4S6",
"type": "session_resource",
"session_id": "sesn_01JC7M2K4P6R8T0V2X4Z",
"kind": "git_repository",
"git": {
"url": "https://git.example.com/acme/billing-service.git",
"ref": "release/2026.11",
"commit": "9b07e3d",
"vault_secret": "git-read-token"
},
"mount_path": "/workspace/repo",
"read_only": false,
"status": "mounted",
"error": null,
"created_at": "2026-11-05T10:01:10Z",
"updated_at": "2026-11-05T10:20:00Z"
}| Field | Type | Description |
|---|---|---|
id | string | Starts with sres_. |
kind | string | file, git_repository or memory_store. |
file_id | string | For kind: file: the Files API id that is mounted. |
git | object | For kind: git_repository: url, ref, the resolved commit, and the vault secret used to clone. |
mount_path | string | Absolute path under /workspace inside the session’s environment. |
read_only | boolean | Read-only mounts reject writes from the agent’s tools. |
status | string | pending, mounted, failed or removed. |
error | object or null | Why mounting failed: code and message. |
Examples
curl -sS -X PATCH "https://app.syntic.ai/v1/sessions/sesn_01JC7M2K4P6R8T0V2X4Z/resources/sres_01JCB1D3F5H7K9M1P3R5" \
-H "Authorization: Bearer $SYNTIC_API_KEY" \
-H "syntic-beta: agents-2026-11-01" \
-H "Content-Type: application/json" \
-d '{
"git": {
"ref": "release/2026.11"
}
}'Errors
Errors use the error envelope and carry a request_id. Codes specific to this operation:
| Status | type | code | When |
|---|---|---|---|
| 400 | invalid_request_error | beta_required | The syntic-beta header is missing. |
| 409 | conflict_error | session_running | The agent is mid-turn; wait for status: idle or interrupt first. |
| 400 | invalid_request_error | field_not_updatable | kind, file_id, url and mount_path are fixed. |
| 404 | not_found_error | resource_not_found | No resource with this id on the session. |
| 401 | authentication_error | invalid_api_key | The key is missing, unknown, revoked or expired. |
| 429 | rate_limit_error | rate_limited | Too many requests; wait for Retry-After. See Rate-limit headers. |
Was this page helpful?