Skip to Content
Xeonr Developer Docs
API SpecificationVersions

Create a version (deploy)

POST
/xeonr.functions.v2.VersionsService/CreateVersion

Builds a new version from exactly one source, and makes it the active version unless skipActivate is set.

archive is an uploaded zip of at most 64 MiB (base64 in JSON), imported into the workspace first; an archive that is not a valid zip, or that the buildpack cannot build, is INVALID_ARGUMENT. workspace deploys what is already in the function's workspace; a function with no files yet is FAILED_PRECONDITION. git fetches the connected repository at ref (a branch, tag or commit) for this deploy only, falling back to the configured branch and then the repository's default branch; a function with no repository, a credential that cannot be obtained, or no branch to deploy is FAILED_PRECONDITION, and a fetch that fails is INTERNAL with the reason in the message. redeploy clones an existing version's stored snapshot: without rebuild the existing image is reused with the function's current environment and secrets (this is how an env or secret change goes live, and needs a VERSION_STATE_READY source version); with rebuild the snapshot is built again, which is how a failed build is retried. The source version is never changed, and one belonging to another function is NOT_FOUND. skipActivate applies to archive and workspace only; with the other sources they always activate.

A static version is VERSION_STATE_READY at once and activated before the response. A Node.js or Go version comes back VERSION_STATE_BUILDING: the image builds in the background (for up to 30 minutes) and the version is activated when the build succeeds, unless a newer version is already live. Follow it with GetVersion and GetBuildLog.

Needs the editor role in the owning team. A function.deploy or function.redeploy event is recorded. A deployment with no platform configured answers UNIMPLEMENTED. 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

Response Body

application/json

application/json

curl -X POST "https://functions.xeonr.io/xeonr.functions.v2.VersionsService/CreateVersion" \  -H "Connect-Protocol-Version: 1" \  -H "Content-Type: application/json" \  -d '{    "archive": "map[gitRef:v1.4.2 zip:UEsDBBQAAAAIAA==]"  }'
{
  "version": "map[createdAt:2026-10-22T09:30:00Z functionId:fn-3f9a2c71d4e8b605 gitCommit:9fceb02d0ae598e95dc970b74767f19372d61af8 gitRef:main snapshotId:snap-8d41b2e7c05a state:VERSION_STATE_BUILDING versionId:v-7c1e04b9a2d35f68]"
}