Skip to Content
Xeonr Developer Docs
API Specification

Files

A function's workspace as a file tree. Reachable with a team API key.

postCreate a directory

Creates a directory in the workspace, and any missing parents, and returns its cleaned path. A path that escapes the root, or the root itself, is `INVALID_ARGUMENT`. A function that deploys from a repository has a read-only workspace and is refused with `FAILED_PRECONDITION`. Needs the editor role in the owning team. Recorded as a `files.edit` activity event. Callable with a console session or a team API key (`Authorization: Bearer xk_…`). **Required scopes:** `functions:functions:edit`

postRemove a file or directory

Removes a file or directory from the workspace and returns its cleaned path. The root cannot be removed (`INVALID_ARGUMENT`). Versions already deployed keep their own snapshots and are not affected. A function that deploys from a repository has a read-only workspace and is refused with `FAILED_PRECONDITION`. Needs the editor role in the owning team. Recorded as a `files.edit` activity event. Callable with a console session or a team API key (`Authorization: Bearer xk_…`). **Required scopes:** `functions:functions:edit`

postRead a file

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`

postList files

Lists the entries under `path` in the function's workspace, sorted by path, with size, SHA-256 and modification time. An empty `path` or `.` is the root, and `recursive` walks the whole subtree. With `versionId`, the version's frozen snapshot is listed instead. Pages default to 50 entries and are capped at 500 (`limit`); pass `nextCursor` back as `cursor` until it comes back empty. A path that escapes the root, or a version of another function, is `INVALID_ARGUMENT`; a missing directory is `NOT_FOUND`. Needs the viewer role in the owning team. A function with no workspace yet gets an empty one. Callable with a console session or a team API key (`Authorization: Bearer xk_…`). **Required scopes:** `functions:functions:read`

postWrite a file

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`

postMove or rename a path

Moves or renames a file or directory within the workspace. The only writable path in `updateMask` is `new_path`: an empty mask, or a mask naming anything else, is `INVALID_ARGUMENT`. Neither `path` nor `newPath` can be the root or escape it (`INVALID_ARGUMENT`), and `newPath` is required when it is masked. Returns both cleaned paths. A function that deploys from a repository has a read-only workspace and is refused with `FAILED_PRECONDITION`. Needs the editor role in the owning team. Recorded as a `files.edit` activity event. Callable with a console session or a team API key (`Authorization: Bearer xk_…`). **Required scopes:** `functions:functions:edit`