Skip to Content
Xeonr Developer Docs
API SpecificationFunctions

Update a function

POST
/xeonr.functions.v2.FunctionsService/UpdateFunction

Applies a partial update: only the fields named in updateMask are written, and everything else is left alone. An empty mask is INVALID_ARGUMENT, and so is a path that is not writable: the writable paths are display_name, owner_team, build, scaling, env, git_branch, git_subdirectory, git_access_token, git_webhook_secret, set_secrets and clear_secrets. displayName is validated as at creation. build and scaling each replace their whole block when named. env replaces the whole map. set_secrets merges into the stored secrets and clear_secrets removes secrets by name; secret values are stored encrypted and only their names come back, in secretKeys. Settings that do not apply to the function's kind are refused with INVALID_ARGUMENT.

git_branch and git_subdirectory change where a connected repository deploys from. A function with no repository is FAILED_PRECONDITION. git_access_token and git_webhook_secret are write-only: an empty string clears them. A running version keeps the environment it was created with, so env and secret changes go live with the next version (CreateVersion with a redeploy source).

Needs the editor role in the owning team. Moving the function with owner_team also needs the admin role in the destination team. A function.update event records which settings and secret names changed, never their values. 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
displayName?|
Length1 <= length <= 64
ownerTeam?|

owner_team moves the function to another team (URN or slug). Requires the functions admin role in BOTH teams, and the destination must be entitled to the product.

Match^[A-Za-z0-9:._-]+$
Length1 <= length <= 255
build?

BuildConfig is the author's declared intent. Every field is optional, and each applies to only some kinds.

scaling?

ScalingSpec is passed through to the platform. Ignored for static functions, which have nothing to scale. An unset field means the platform's default.

env?

env is replaced wholesale, because a client can round-trip it.

Propertiesproperties <= 128
setSecrets?

set_secrets is merged in rather than replacing, because a client can never read a secret back and so has nothing to send in a whole-map write. Secrets win over env on a key collision.

Propertiesproperties <= 128
clearSecrets?array<>

clear_secrets removes secrets by name.

Itemsitems <= 128
gitBranch?|

git_branch changes the branch of a connected repository that deploys.

Lengthlength <= 255
gitSubdirectory?|

git_subdirectory changes the path within the repository that builds.

Lengthlength <= 255
gitAccessToken?|

git_access_token and git_webhook_secret are write-only: stored encrypted and never read back. An empty string clears.

Lengthlength <= 512
gitWebhookSecret?|
Lengthlength <= 512
updateMask*string

update_mask names the fields above to write, by their proto names (display_name, owner_team, build, scaling, env, git_branch, git_subdirectory, git_access_token, git_webhook_secret, set_secrets, clear_secrets). Required: an empty mask, or one naming anything else, is INVALID_ARGUMENT.

[key: string]?never

Response Body

application/json

application/json

curl -X POST "https://functions.xeonr.io/xeonr.functions.v2.FunctionsService/UpdateFunction" \  -H "Connect-Protocol-Version: 1" \  -H "Content-Type: application/json" \  -d '{    "updateMask": "displayName,scaling"  }'
{
  "function": "map[activeVersionId:v-7c1e04b9a2d35f68 createdAt:2026-10-22T09:30:00Z displayName:Checkout API (prod) functionId:fn-3f9a2c71d4e8b605 kind:KIND_NODE name:amber-heron-3f9a ownerTeam:urn:xeonr:auth:team:0f6b5f8c-3d2a-4c1e-9b7a-6e2d1c4f8a90 updatedAt:2026-10-23T09:30:00Z]"
}