Using the API
Base URLs, authentication, error codes and the role each call requires.
The Functions control plane is a Connect API. Every
call is a POST to /<package>.<Service>/<Method> with a JSON body, which
works over plain HTTP/1.1 from curl, a browser or any language; the
generated clients can also speak binary protobuf.
https://functions.xeonr.io production
https://functions.xeonr.dev stageFrom TypeScript or a shell, prefer the SDK and CLI — it handles the conventions below, and waits for builds that finish after the call that started them returns. This page is what it speaks, and what to implement against in another language.
Per-method request and response shapes are in the API specification, generated from the proto the server implements.
The package is xeonr.functions.v2; one service per resource.
| Service | What it covers | Team API keys |
|---|---|---|
FunctionsService | ListFunctions, GetFunction, CreateFunction, UpdateFunction, DeleteFunction | ✓ |
VersionsService | ListVersions, GetVersion, CreateVersion (every deploy), SetActiveVersion (promote and roll back) | ✓ |
BuildLogsService | GetBuildLog | ✓ |
StatsService | GetFunctionStats | ✓ |
FilesService | ListFiles, GetFile, SetFile, CreateDirectory, UpdateFile (move), DeleteFile | ✓ |
RepositoriesService | ListRepositories, SetRepository, DeleteRepository | ✓ |
ConnectionsService | ListConnections, DeleteConnection | ✓ |
ApiKeysService | CreateApiKey, ListApiKeys, RevokeApiKey | ✗ — session only |
ActivityService | ListActivity | ✗ — session only |
Each path is /xeonr.functions.v2.<Service>/<Method>, for example
/xeonr.functions.v2.VersionsService/CreateVersion.
Authentication
Every call takes Authorization: Bearer <token>, where the token is either a
Xeonr Auth access token (what the console, a CLI or another service holds; the
console's own session cookie is turned into this header for you) or a
team API key:
curl -X POST https://functions.xeonr.io/xeonr.functions.v2.FunctionsService/ListFunctions \
-H "Authorization: Bearer xk_…" \
-H "content-type: application/json" \
-d '{"limit": 50}'A key authenticates every service above except ApiKeysService and
ActivityService. Presenting one to those is refused with permission_denied,
whatever the key's role. An unknown,
revoked or expired key is unauthenticated; if Xeonr Auth cannot be reached
to check it, the answer is unavailable, so retry. A team API token from
before keys moved to Xeonr Auth (fnt_…) is accepted the same way.
A key bound to specific resources rather than the whole team reaches only
those: a function it is not bound to is not_found, and team-wide calls
(listing, creating functions) need a binding to the team itself.
Your role in a team is checked with Xeonr Auth on every call, as you. If your
membership changed since your token was issued, the call is unauthenticated
and signing in again (or refreshing the token) picks up the change; if Xeonr
Auth cannot be reached, the call is unavailable, never answered from a stale
token.
From an AI assistant (MCP)
Functions is a product on the Xeonr MCP server at https://mcp.xeonr.io/mcp.
Connect an assistant there once, choose Functions, the teams it may act in,
and the access (read, write, admin for deletes and revoking keys, and
credentials to let it mint team API keys, whose secret it then sees), and it
calls this API as you. Tool names are functions_<tool>, e.g. functions_list_functions,
functions_deploy_function, functions_set_active_version. The tools are
listed, unauthenticated, at
POST /xeonr.platform.mcp.v1.ManifestService/GetManifest on either base URL.
Each call carries a token Xeonr Auth exchanged for you, so your role decides it exactly as above, and the audit log records you as the actor and the MCP server as the delegator. It reaches only the teams you connected, and never carries the platform-admin bypass. Archive uploads, binary file writes, git credentials and moving a function between teams are not offered as tools.
Roles
The spec does not carry authorisation, so it is here. Every call resolves your role in the team that owns the thing you are acting on.
| Role | Calls |
|---|---|
| Viewer | ListFunctions, GetFunction, ListVersions, GetVersion, GetBuildLog, GetFunctionStats, ListFiles, GetFile, ListRepositories, ListConnections, ListActivity |
| Editor | everything above, plus CreateFunction, UpdateFunction, DeleteFunction, CreateVersion, SetActiveVersion, SetFile, CreateDirectory, UpdateFile, DeleteFile, SetRepository, DeleteRepository |
| Admin | everything above, plus DeleteConnection, the API key calls, and moving a function to another team with UpdateFunction's ownerTeam (admin in both teams) |
Listing keys requires admin as well as creating them — the list is a map of
what would have to be rotated. ApiKey.apiKeyId is the key's URN
(urn:xeonr:auth:api-key:…); pass it to RevokeApiKey to revoke.
Errors
Errors come back as a JSON object with a Connect code and a message, alongside the matching HTTP status:
{ "code": "failed_precondition", "message": "no repository is connected to this function" }| Code | Status | Typically |
|---|---|---|
invalid_argument | 400 | A malformed field, or one that does not apply to the function's kind. |
unauthenticated | 401 | Missing or invalid credentials. |
permission_denied | 403 | Your role is not enough for this call. |
not_found | 404 | No such function, version or team — also what you get for one you may not see. |
already_exists | 409 | Name collision. |
failed_precondition | 400 | Valid call, wrong state — nothing to deploy, no repository connected. |
unimplemented | 501 | Not available on this deployment, or not built yet. |
unavailable | 503 | Something Functions depends on (its database, the platform, a git provider, Xeonr Auth) failed. Retry. |
internal | 500 | A bug on our side. The message is always internal error. |
unimplemented is a real answer, not a bug. A deployment configured without a
platform client, a git provider or an encryption key reports the capability as
unavailable rather than failing obscurely. A call that fails request validation
(a missing required field, a value out of bounds, an enum left at
UNSPECIFIED, a CreateVersion with no source) is invalid_argument and
names the field.
Conventions
- Timestamps are RFC 3339 strings (
2026-10-22T09:30:00Z) — the protobuf JSON mapping forgoogle.protobuf.Timestamp. Request times (CreateApiKeyRequest.expiresAt) take the same form; leave one out for "never". - Enums travel as their proto names:
KIND_NODE,VERSION_STATE_READY,API_KEY_ROLE_EDITOR. Zero (…_UNSPECIFIED) is never a valid input. - 64-bit integers (
offsetBytes,rangeSec, the stats counters) are strings in JSON. - Write-only fields — git credentials and secret values — are never returned.
UpdateFunctiononly writes whatupdateMasknames, so omitting one leaves it alone; naming it with an empty string clears it. - Partial updates take an
updateMask: a comma-separated list of the request's field names ("displayName,scaling").UpdateFunctionandUpdateFilerefuse an empty mask or a path they cannot write withinvalid_argument, rather than quietly doing nothing. - Paging is
cursorpluslimiton everyList*call:limit0 means the default of 50 and the most is 500; keep sending backnextCursorascursoruntil it is empty. The cursor is opaque.ListFunctionsalso returnstotal: how many functions matchownerTeamandsearchacross every page.limitandcursordo not change it, so a count needs only alimitof 1. - Deploys are one call,
CreateVersion, with exactly onesource:archive(a zip, base64 inzip, up to 64 MiB),workspace,git(a ref for this deploy only) orredeploy(clone a version, rebuilding or not). Rolling back isSetActiveVersionwith an older version.