Docs
Open the console →
API reference

API reference: Git connections

Snowtrol Git-connections API: connect GitHub, GitLab or Bitbucket with a PAT (encrypted, never echoed), pick a default repo/branch, validate, and disconnect.

Connect Git repositories for GitOps: an infra connection (default) is the Terraform hydrate target — connecting initializes the repo (branch + scaffold + the single-owner marker); an application connection is a pipeline source (marker only, no scaffold). Reads for any member; mutations need manage_cloud_accounts. The PAT is stored AES-256-GCM encrypted and never returned — responses carry tokenSet only.

POST/api/git/connectionsmanage_cloud_accounts

Connect a provider (github | gitlab | bitbucket) with { provider, host?, token, repo?, branch?, repoType? }. The token is validated live; connecting a repo+branch already owned by another org is refused 409 (single-owner marker).

Errors
StatusWhen
400Bad provider/host/token shape (https-only hosts).
403Caller lacks manage_cloud_accounts.
409The repo+branch is already connected by another organization (code repo_already_connected).
503The Git provider is unreachable or rejected the token (the provider's reason is surfaced).

GET /api/git/connections lists connections (health, default repo/branch, repoType, tokenSet); PATCH /api/git/connections/{id} sets the default repo/branch; POST …/{id}/validate re-checks the token; GET …/{id}/repos lists the provider's repositories for the picker; DELETE …/{id} disconnects and scrubs the stored token. Audits: git.connection_created/validated/default_set/disconnected plus git.repo_written/repo_write_failed/repo_pruned from the Terraform hydrate path.