Skip to Content
Xeonr Developer Docs
API SpecificationFiles

Write a file

POST
/xeonr.functions.v2.FilesService/SetFile

Creates or overwrites one file in the workspace, from content (text) or contentBase64 (binary, which wins if both are sent). Files are limited to 2 MiB. The change goes live with the next deploy. A function that deploys from a repository has a read-only workspace (filesReadOnly) and is refused with FAILED_PRECONDITION.

Needs the editor role in the owning team. Edits are recorded as files.edit activity events, coalesced to one per ten-minute window. Callable with a console session or a team API key (Authorization: Bearer xk_…).

Required scopes: functions:functions:edit

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
content?string

Exactly one of content or content_base64; content_base64 wins if both are sent. At most 2 MiB.

Lengthlength <= 2097152
contentBase64?string
Lengthlength <= 2796204
[key: string]?never

Response Body

application/json

application/json

curl -X POST "https://functions.xeonr.io/xeonr.functions.v2.FilesService/SetFile" \  -H "Connect-Protocol-Version: 1" \  -H "Content-Type: application/json" \  -d '{}'
{
  "path": "src/server.js",
  "size": "1842"
}