Skip to Content
Xeonr Developer Docs
API SpecificationAPI keys

Create a team API key

POST
/xeonr.functions.v2.ApiKeysService/CreateApiKey

Creates a team-owned API key in Xeonr Auth for CI and returns it with its secret (xk_…). The secret appears only in this response, because Xeonr Auth stores it hashed. role must be API_KEY_ROLE_EDITOR (scopes functions:functions:read and functions:functions:edit) or API_KEY_ROLE_VIEWER (functions:functions:read). name is required (at most 64 characters), description is at most 512 characters, and expiresAt must be in the future, or unset for a key that never expires. Xeonr Auth may refuse an expiry beyond the application's maximum lifetime.

Needs the admin role in the team, held by a signed-in member of it: the key is created on their behalf. Needs a signed-in user: team API keys are refused on every method of this service (PERMISSION_DENIED). A token.create event is recorded in the activity feed.

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

ownerTeam?string

owner_team is the team's URN.

Match^[A-Za-z0-9:._-]+$
Length1 <= length <= 255
name?string
Length1 <= length <= 64
role?not unknown

role must be API_KEY_ROLE_EDITOR or API_KEY_ROLE_VIEWER. Never owner or admin: a key that could mint more keys would make revocation meaningless.

Value in"API_KEY_ROLE_UNSPECIFIED" | "API_KEY_ROLE_EDITOR" | "API_KEY_ROLE_VIEWER"
description?string

description is what the key is for, up to 512 characters.

Lengthlength <= 512
expiresAt?string

expires_at is when the key stops working; unset is never. Xeonr Auth refuses one beyond the application's maximum lifetime, if it sets one.

Formatdate-time
[key: string]?never

Response Body

application/json

application/json

curl -X POST "https://functions.xeonr.io/xeonr.functions.v2.ApiKeysService/CreateApiKey" \  -H "Connect-Protocol-Version: 1" \  -H "Content-Type: application/json" \  -d '{}'
{
  "apiKey": "map[apiKeyId:urn:xeonr:auth:api-key:6d1b2c9e-84f3-4a07-b5e1-3c9a7d2f0e48 createdAt:2026-10-22T09:30:00Z keyPrefix:7Hq2 name:checkout-ci role:API_KEY_ROLE_EDITOR]",
  "secret": "xk_live_…"
}