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

HeaderRequiredValue
AuthorizationYesBearer <key>: a private inference key (sk_live_...). See Authentication.
syntic-betaYes, while in previewagents-2026-11-01. Without it the call fails with 400 beta_required. See Versioning.
Content-TypeYesapplication/json

Path parameters

ParameterTypeDescription
session_idstringThe session id, starting with sesn_.
resource_idstringThe resource id, starting with sres_.

Body parameters

ParameterTypeRequiredNotes
read_onlybooleanNoNew mount mode.
gitobjectNoOnly 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"
}
FieldTypeDescription
idstringStarts with sres_.
kindstringfile, git_repository or memory_store.
file_idstringFor kind: file: the Files API id that is mounted.
gitobjectFor kind: git_repository: url, ref, the resolved commit, and the vault secret used to clone.
mount_pathstringAbsolute path under /workspace inside the session’s environment.
read_onlybooleanRead-only mounts reject writes from the agent’s tools.
statusstringpending, mounted, failed or removed.
errorobject or nullWhy 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:

StatustypecodeWhen
400invalid_request_errorbeta_requiredThe syntic-beta header is missing.
409conflict_errorsession_runningThe agent is mid-turn; wait for status: idle or interrupt first.
400invalid_request_errorfield_not_updatablekind, file_id, url and mount_path are fixed.
404not_found_errorresource_not_foundNo resource with this id on the session.
401authentication_errorinvalid_api_keyThe key is missing, unknown, revoked or expired.
429rate_limit_errorrate_limitedToo many requests; wait for Retry-After. See Rate-limit headers.
Was this page helpful?