Skip to Content
Xeonr Developer Docs
API SpecificationRepositories

Set the repository a function deploys from

POST
/xeonr.functions.v2.RepositoriesService/SetRepository

Points the function at one repository from ListRepositories, with the branch that deploys (the repository's default branch when empty) and an optional subdirectory. The function must already have a provider connected (FAILED_PRECONDITION otherwise).

For GitLab this also registers the push webhook and provisions a project access token. That needs Maintainer access on the project (PERMISSION_DENIED otherwise) and a connect session that has not expired (FAILED_PRECONDITION). outcome is REPOSITORY_OUTCOME_CONNECTED, or REPOSITORY_OUTCOME_CONNECTED_NO_TOKEN when the webhook was registered but no deploy token could be created. For GitHub, the App installation supplies the credential and the webhook, and outcome is REPOSITORY_OUTCOME_CONNECTED.

Needs the editor role in the owning team. A git.select_repo event is recorded. 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
repo?string

repo is the provider-native identifier from ListRepositories.

Length1 <= length <= 255
branch?string
Lengthlength <= 255
subdirectory?string
Lengthlength <= 255
[key: string]?never

Response Body

application/json

application/json

curl -X POST "https://functions.xeonr.io/xeonr.functions.v2.RepositoriesService/SetRepository" \  -H "Connect-Protocol-Version: 1" \  -H "Content-Type: application/json" \  -d '{}'
{
  "function": "map[displayName:Checkout API filesReadOnly:true functionId:fn-3f9a2c71d4e8b605 git:map[branch:main provider:GIT_PROVIDER_GITHUB repo:acme/checkout-api] kind:KIND_NODE name:amber-heron-3f9a]",
  "outcome": "REPOSITORY_OUTCOME_CONNECTED"
}