Xeonr Developer Docs
API SpecificationWorkspaces

Read File

POST
/containers.api.v1.WorkspaceService/ReadFile

Server stream of a file's bytes in 64 KiB frames from a workspace or snapshot, with offset/length for partial reads (length 0 = to EOF; an offset past EOF yields a single empty EOF frame). On a miss in a live workspace, flushes that one path out of a mounting sandbox and retries before returning NotFound. Exactly one of workspace_id / snapshot_id must be set.

Access: namespace VIEWER or above (read); a workspace-scoped agent key may act only on the trees it was minted for

Authorization

BearerAuth
AuthorizationBearer <token>

A namespace-scoped API key (cpk_…) for machines, or a Xeonr Auth OIDC token for humans. The key's namespace and role are pinned server-side.

In: header

Header Parameters

Connect-Protocol-Version?number

Define the version of the Connect protocol

Connect-Timeout-Ms?number

Define the timeout, in ms

Request Body

application/connect+json

workspaceId?string
Lengthlength <= 128
path?string
Length1 <= length <= 4096
offset?string

validate:skip any offset accepted (past EOF reads nothing)

Formatint64
length?string

0 = to EOF; validate:skip any length accepted (clamped to EOF)

Formatint64
snapshotId?string

Address an immutable snapshot instead of a live workspace; exactly one of workspace_id / snapshot_id must be set. Serves static content straight from a snapshot with no workspace fork. (A9)

Lengthlength <= 128
[key: string]?never

Response Body

application/connect+json

application/connect+json

curl -X POST "https://containers.xeonr.io/containers.api.v1.WorkspaceService/ReadFile" \  -H "Connect-Protocol-Version: 1" \  -H "Connect-Timeout-Ms: 1000" \  -H "Content-Type: application/connect+json" \  -d ''
{
  "data": "string",
  "offset": "string",
  "eof": true
}
{
  "code": "not_found",
  "message": "string",
  "details": [
    {
      "type": "string",
      "value": "string",
      "debug": {}
    }
  ]
}