Skip to Content
Xeonr Developer Docs
API SpecificationFiles

Read a file

POST
/xeonr.functions.v2.FilesService/GetFile

Reads one file from the workspace, or from a version's snapshot when versionId is set. Text comes back in content. A file containing a NUL byte is treated as binary and comes back base64-encoded in contentBase64, with binary set. Files over 2 MiB are refused with FAILED_PRECONDITION. A missing file is NOT_FOUND.

Needs the viewer role in the owning team. Callable with a console session or a team API key (Authorization: Bearer xk_…).

Required scopes: functions:functions:read

Authorization

BearerAuth
AuthorizationBearer <token>

A team API key, created by a team admin in the console and presented as Authorization: Bearer xk_…. Xeonr Auth issues and verifies it; the secret is shown once at creation and stored only as a hash, and a revoked key stops working within 30 seconds. An existing fnt_… token is accepted the same way.

In: header

Header Parameters

Connect-Protocol-Version*number

Define the version of the Connect protocol

Value in1
Connect-Timeout-Ms?number

Define the timeout, in ms

Request Body

application/json

functionId?string
Match^[A-Za-z0-9_-]+$
Length1 <= length <= 64
path?string
Length1 <= length <= 4096
versionId?string
Match^[A-Za-z0-9_-]*$
Lengthlength <= 64
[key: string]?never

Response Body

application/json

application/json

curl -X POST "https://functions.xeonr.io/xeonr.functions.v2.FilesService/GetFile" \  -H "Connect-Protocol-Version: 1" \  -H "Content-Type: application/json" \  -d '{}'
{
  "path": "src/server.js",
  "content": "console.log('hello');\n",
  "contentBase64": "iVBORw0KGgo=",
  "binary": "false"
}