Create a function
Creates a function owned by ownerTeam (a team URN or slug) and assigns its hostname, <name>.fns.xnr.app. Names are never chosen. displayName is required (at most 64 characters, no control characters). kind is required (KIND_NODE, KIND_GO or KIND_STATIC) and cannot be changed later. Settings that do not apply to the kind are refused with INVALID_ARGUMENT: a port, entrypoint, packages or env on a static function, staticDir on a non-static one, mainPackage on a non-Go one.
source says where the code lives, once and for good. Left out, or SOURCE_MODE_PLATFORM, the workspace is scaffolded with a working hello-world project for the kind and is edited in the console. SOURCE_MODE_EXISTING_REPO attaches repo through a team connection, and SOURCE_MODE_NEW_REPO creates the repository through the provider and writes the scaffold into it. A first deploy starts in the background, so the returned function usually has no activeVersionId yet; follow the deploy with ListVersions or GetFunction.
A failure to apply source does not undo the function: it is created, and the reason comes back in sourceError with an OK status so the caller keeps the record. A function.create event is recorded in the team's activity feed.
Needs the editor role in the owning team. A team API key may leave ownerTeam empty to create in its own team, and needs the editor role there; a signed-in user must name the team. Callable with a console session or a team API key (Authorization: Bearer xk_…).
Required scopes: functions:functions:edit
Authorization
BearerAuth 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
Define the version of the Connect protocol
1Define the timeout, in ms
Request Body
application/json
display_name is what a human calls this function.
1 <= length <= 64kind is required: a build never has to guess, and a wrong guess would otherwise surface as a build failure rather than as a question.
"KIND_UNSPECIFIED" | "KIND_NODE" | "KIND_GO" | "KIND_STATIC"owner_team is the owning Xeonr team (URN or slug). Required for a signed-in user; an API key uses its own team when this is empty.
^[A-Za-z0-9:._-]*$length <= 255BuildConfig is the author's declared intent. Every field is optional, and each applies to only some kinds.
ScalingSpec is passed through to the platform. Ignored for static functions, which have nothing to scale. An unset field means the platform's default.
properties <= 128source says where the code lives. Left out, it is SOURCE_MODE_PLATFORM.
Response Body
application/json
application/json
curl -X POST "https://functions.xeonr.io/xeonr.functions.v2.FunctionsService/CreateFunction" \ -H "Connect-Protocol-Version: 1" \ -H "Content-Type: application/json" \ -d '{}'{
"function": "map[createdAt:2026-10-22T09:30:00Z displayName:Checkout API functionId:fn-3f9a2c71d4e8b605 kind:KIND_NODE name:amber-heron-3f9a ownerTeam:urn:xeonr:auth:team:0f6b5f8c-3d2a-4c1e-9b7a-6e2d1c4f8a90 updatedAt:2026-10-22T09:30:00Z]",
"sourceError": "the connection cannot see acme/checkout-api"
}Functions
Functions: create, read, configure and delete. Reachable with a team API key.
Delete a function POST
Deletes the function. Its hostname stops serving, and what it held on the platform is released: the App behind every version, and the workspace that owns their snapshots. The platform clean-up is best effort, so a platform outage does not block the delete. Needs the editor role in the owning team. A `function.delete` event is recorded in the activity feed. Callable with a console session or a team API key (`Authorization: Bearer xk_…`). **Required scopes:** `functions:functions:edit`