Skip to Content
Xeonr Developer Docs

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    stage

From 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.

ServiceWhat it coversTeam API keys
FunctionsServiceListFunctions, GetFunction, CreateFunction, UpdateFunction, DeleteFunction✓
VersionsServiceListVersions, GetVersion, CreateVersion (every deploy), SetActiveVersion (promote and roll back)✓
BuildLogsServiceGetBuildLog✓
StatsServiceGetFunctionStats✓
FilesServiceListFiles, GetFile, SetFile, CreateDirectory, UpdateFile (move), DeleteFile✓
RepositoriesServiceListRepositories, SetRepository, DeleteRepository✓
ConnectionsServiceListConnections, DeleteConnection✓
ApiKeysServiceCreateApiKey, ListApiKeys, RevokeApiKey✗ — session only
ActivityServiceListActivity✗ — 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.

RoleCalls
ViewerListFunctions, GetFunction, ListVersions, GetVersion, GetBuildLog, GetFunctionStats, ListFiles, GetFile, ListRepositories, ListConnections, ListActivity
Editoreverything above, plus CreateFunction, UpdateFunction, DeleteFunction, CreateVersion, SetActiveVersion, SetFile, CreateDirectory, UpdateFile, DeleteFile, SetRepository, DeleteRepository
Admineverything 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" }
CodeStatusTypically
invalid_argument400A malformed field, or one that does not apply to the function's kind.
unauthenticated401Missing or invalid credentials.
permission_denied403Your role is not enough for this call.
not_found404No such function, version or team — also what you get for one you may not see.
already_exists409Name collision.
failed_precondition400Valid call, wrong state — nothing to deploy, no repository connected.
unimplemented501Not available on this deployment, or not built yet.
unavailable503Something Functions depends on (its database, the platform, a git provider, Xeonr Auth) failed. Retry.
internal500A 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 for google.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. UpdateFunction only writes what updateMask names, 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"). UpdateFunction and UpdateFile refuse an empty mask or a path they cannot write with invalid_argument, rather than quietly doing nothing.
  • Paging is cursor plus limit on every List* call: limit 0 means the default of 50 and the most is 500; keep sending back nextCursor as cursor until it is empty. The cursor is opaque. ListFunctions also returns total: how many functions match ownerTeam and search across every page. limit and cursor do not change it, so a count needs only a limit of 1.
  • Deploys are one call, CreateVersion, with exactly one source: archive (a zip, base64 in zip, up to 64 MiB), workspace, git (a ref for this deploy only) or redeploy (clone a version, rebuilding or not). Rolling back is SetActiveVersion with an older version.

On this page