AgentConnect
Agent workspace

Download a workspace file

Return the original bytes of one workspace file as an attachment. Pass sessionId to read a visible session’s working root — its isolated worktree, or the agent’s checkout when the session shares it — and repo (owner/repo) for one of the agent’s authorized additional repositories; omit both for the agent’s primary workspace. Pass root (uploads or outputs) with sessionId to address that area of the session’s files directory instead of a checkout: it needs only the session’s visibility, so a session sharing the agent’s checkout qualifies too; root without sessionId, or with repo, is 400, and a daemon too old to serve session files yields 409 DAEMON_FEATURE_MISSING. Containment, the .git rule and symlink refusal are the workspace read’s. Pass sha256, the digest prefix a shared file’s transcript marker records, to require the bytes still match it (409 WORKSPACE_FILE_CHANGED otherwise). The control plane assembles the file from bounded byte slices it proxies live from the owning daemon and stores none of it; a file over the download ceiling is refused with 413 WORKSPACE_FILE_TOO_LARGE — use the transfer route for those. 409 when the daemon or the agent’s sandbox is too old to serve bytes, 503 when the agent is unplaced or its daemon is offline.

GET
/v1/orgs/{orgId}/agents/{id}/workspace/file/download

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

orgId*string
id*string

Query Parameters

repo?string
Length1 <= length <= 256
sessionId?string
Length1 <= length
root?string

Value in

  • "uploads"
  • "outputs"
path*string
Length1 <= length <= 4096
sha256?string
Match^[0-9a-fA-F]{16,64}$

Response Body

application/octet-stream

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/orgs/string/agents/string/workspace/file/download?path=string"
"string"