Skip to content

Git API

18 operations. Every call needs a session cookie or an Authorization: Bearer nct_… token unless marked Public. Conventions, errors and scopes

GET/git/connections

List git connections

Connections to GitHub, GitLab, Gitea, Forgejo and Bitbucket. Credentials and secrets are never returned.

Response 200 · OK · application/json
ListConnectionsOutputBody
  • ConnectionView[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

POST/git/connections

Connect GitLab, Gitea, Forgejo or Bitbucket

Token connections are verified against the provider first (422 credentials_invalid). OAuth connections start pending and return an authorizeUrl to open in the browser; register oauth.redirectUri as the OAuth application's redirect URI. The response carries the webhook secret once; GitLab, Gitea and Forgejo webhooks are registered automatically when a service is linked, a Bitbucket webhook is created by hand (URL webhookUrl, this secret). Requires the admin scope.

Request body · application/json · required
CreateConnectionInputBody
  • authTypeenum: token | oauth
    token: a personal/group access token (needs api scope on GitLab; repository, webhook and status access on Gitea and Forgejo). oauth: an OAuth application. Ignored for Bitbucket.
  • baseUrlstring
    The instance's web URL. Required for Gitea and Forgejo; defaults to https://gitlab.com and https://bitbucket.org
  • clientIdstring
    OAuth application client id
  • clientSecretstring
    Write-only OAuth application client secret
  • namestring
    Defaults to the provider and host
  • providerenum: gitlab | gitea | forgejo | bitbucketrequired
    GitHub connects through a GitHub App: use POST /git/github/manifest
  • tokenstring
    Write-only access token (authType token; for Bitbucket an optional repository access token to clone private repositories)
Response 201 · Created · application/json
CreateConnectionResult
  • authorizeUrlstringrequired
  • ConnectionViewrequired
  • webhookSecretstringrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 409Conflict
  • 422Unprocessable Entitycredentials_invalid
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

GET/git/connections/{connectionId}

Get a git connection

ParameterInTypeDescription
connectionIdrequiredpathstring
Response 200 · OK · application/json
ConnectionView
  • accountLoginstringrequired
  • authTypeenum: github_app | oauth | token | webhook_onlyrequired
  • baseUrlstringrequired
  • canListReposbooleanrequired
  • createdAtstring (date-time)required
  • GitHubAppViewrequired
  • idstringrequired
  • manualWebhookbooleanrequired
  • namestringrequired
  • OAuthViewrequired
  • providerenum: github | gitlab | gitea | forgejo | bitbucketrequired
  • serviceCountinteger (int64)required
  • statusenum: pending | active | errorrequired
  • statusMessagestringrequired
  • supportsPreviewsbooleanrequired
  • updatedAtstring (date-time)required
  • webhookUrlstringrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

PATCH/git/connections/{connectionId}

Rename a git connection or replace its credentials

Requires the admin scope. Secrets are write-only.

ParameterInTypeDescription
connectionIdrequiredpathstring
Request body · application/json · required
UpdateConnectionInputBody
  • clientSecretstring
    Write-only; replaces the OAuth client secret
  • namestring
  • tokenstring
    Write-only; replaces the access token
Response 200 · OK · application/json
ConnectionView
  • accountLoginstringrequired
  • authTypeenum: github_app | oauth | token | webhook_onlyrequired
  • baseUrlstringrequired
  • canListReposbooleanrequired
  • createdAtstring (date-time)required
  • GitHubAppViewrequired
  • idstringrequired
  • manualWebhookbooleanrequired
  • namestringrequired
  • OAuthViewrequired
  • providerenum: github | gitlab | gitea | forgejo | bitbucketrequired
  • serviceCountinteger (int64)required
  • statusenum: pending | active | errorrequired
  • statusMessagestringrequired
  • supportsPreviewsbooleanrequired
  • updatedAtstring (date-time)required
  • webhookUrlstringrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

DELETE/git/connections/{connectionId}

Remove a git connection

Refused with 409 connection_in_use while services use it, unless force is set (it unlinks them). Webhooks NebulaCtrl registered are removed; a GitHub App stays installed at GitHub. Requires the admin scope.

ParameterInTypeDescription
connectionIdrequiredpathstring
forcequerybooleanAlso unlink the services that use the connection
Response 204 · No Content

No body.

Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflictconnection_in_use
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

GET/git/connections/{connectionId}/branches

List a repository's branches

ParameterInTypeDescription
connectionIdrequiredpathstring
reporequiredquerystringowner/name
Response 200 · OK · application/json
BranchesOutputBody
  • itemsstring[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error
  • 502Bad Gateway

Errors are RFC 9457 application/problem+json with a stable code field.

GET/git/connections/{connectionId}/deliveries

Webhook delivery log of a connection

The last 200 deliveries (14 days), newest first: event, outcome (processed, ignored, rejected, replayed, error), what they started. Headers are redacted. Requires the admin scope.

ParameterInTypeDescription
connectionIdrequiredpathstring
cursorquerystringOpaque cursor from a previous page's nextCursor
limitqueryinteger (int64)Page size (default 50, max 200)
Response 200 · OK · application/json
PageWebhookDeliveryView
  • WebhookDeliveryView[] | nullrequired
  • nextCursorstring
    Present when more items exist
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

POST/git/connections/{connectionId}/oauth/start

Start (or restart) the OAuth authorization of a connection

Returns the provider URL to open in the browser.

ParameterInTypeDescription
connectionIdrequiredpathstring
Response 200 · OK · application/json
AuthorizeOutputBody
  • authorizeUrlstringrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

POST/git/connections/{connectionId}/refresh

Look up a GitHub App's installation again

For an App installed without returning to NebulaCtrl: finds the installation through the GitHub API and verifies the connection.

ParameterInTypeDescription
connectionIdrequiredpathstring
Response 200 · OK · application/json
ConnectionView
  • accountLoginstringrequired
  • authTypeenum: github_app | oauth | token | webhook_onlyrequired
  • baseUrlstringrequired
  • canListReposbooleanrequired
  • createdAtstring (date-time)required
  • GitHubAppViewrequired
  • idstringrequired
  • manualWebhookbooleanrequired
  • namestringrequired
  • OAuthViewrequired
  • providerenum: github | gitlab | gitea | forgejo | bitbucketrequired
  • serviceCountinteger (int64)required
  • statusenum: pending | active | errorrequired
  • statusMessagestringrequired
  • supportsPreviewsbooleanrequired
  • updatedAtstring (date-time)required
  • webhookUrlstringrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

GET/git/connections/{connectionId}/repos

List the repositories a connection can access

The repository picker. 422 no_repo_api for Bitbucket (enter owner/name instead). Requires projects:write.

ParameterInTypeDescription
connectionIdrequiredpathstring
qquerystringFilter by name
limitqueryinteger (int64)
Response 200 · OK · application/json
ReposOutputBody
  • Repo[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entityno_repo_api
  • 500Internal Server Error
  • 502Bad Gateway

Errors are RFC 9457 application/problem+json with a stable code field.

POST/git/connections/{connectionId}/test

Test a git connection

Calls the provider with the stored credentials and records the outcome in status.

ParameterInTypeDescription
connectionIdrequiredpathstring
Response 200 · OK · application/json
ConnectionView
  • accountLoginstringrequired
  • authTypeenum: github_app | oauth | token | webhook_onlyrequired
  • baseUrlstringrequired
  • canListReposbooleanrequired
  • createdAtstring (date-time)required
  • GitHubAppViewrequired
  • idstringrequired
  • manualWebhookbooleanrequired
  • namestringrequired
  • OAuthViewrequired
  • providerenum: github | gitlab | gitea | forgejo | bitbucketrequired
  • serviceCountinteger (int64)required
  • statusenum: pending | active | errorrequired
  • statusMessagestringrequired
  • supportsPreviewsbooleanrequired
  • updatedAtstring (date-time)required
  • webhookUrlstringrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

POST/git/connections/{connectionId}/webhook-secret/rotate

Issue a new webhook secret (Bitbucket)

Only for providers whose webhook is created by hand (Bitbucket). The new secret is returned once; update the webhook at the provider.

ParameterInTypeDescription
connectionIdrequiredpathstring
Response 200 · OK · application/json
SecretOutputBody
  • webhookSecretstringrequired
    Shown once
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

POST/git/github/manifest

Start creating a GitHub App

Creates a pending GitHub connection and returns a manifest: submit it as the form field manifest with a POST to postUrl (the browser does this; GitHub asks the user to confirm). GitHub then redirects back to NebulaCtrl, which stores the App and sends the user to install it. The App gets read access to code and metadata and write access to pull requests and commit statuses, and subscribes to push and pull_request events. Needs NEBULACTRL_PUBLIC_URL (422 public_url_required). Requires the admin scope.

Request body · application/json · required
ManifestInputBody
  • baseUrlstring
    Web URL of a GitHub Enterprise Server (empty: github.com)
  • namestring
    Connection name (default GitHub)
  • ownerstring
    GitHub organization that should own the App (empty: your own account)
Response 200 · OK · application/json
ManifestStart
  • connectionIdstringrequired
  • manifeststringrequired
  • postUrlstringrequired
  • statestringrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 422Unprocessable Entitypublic_url_required
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

GET/services/{serviceId}/ssh

Get a git service's SSH deploy key and pinned host keys

The public key and fingerprint, the provider's "add deploy key" link when the host is a known public instance, and each pinned host key (with the refused key when the host's key changed). The private key is never returned. 422 not_git_source.

ParameterInTypeDescription
serviceIdrequiredpathstring
Response 200 · OK · application/json
StatusView
  • DeployKeyLink
  • hoststring
  • HostView[] | nullrequired
  • KeyView
  • usesSshUrlbooleanrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entitynot_git_source
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

POST/services/{serviceId}/ssh/host-keys/accept

Accept the SSH host key the git host presents now

Replaces the pinned host key of the service's git host after you reviewed the fingerprint of the refused key. 409 host_key_changed when the server presents yet another key, 502 host_unreachable when it cannot be reached. Needs projects:write.

ParameterInTypeDescription
serviceIdrequiredpathstring
Request body · application/json · required
AcceptInputBody
  • fingerprintstringrequired
    The SHA256 fingerprint of the host key you reviewed; the key is pinned only if the server still presents it
Response 200 · OK · application/json
StatusView
  • DeployKeyLink
  • hoststring
  • HostView[] | nullrequired
  • KeyView
  • usesSshUrlbooleanrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflicthost_key_changed
  • 422Unprocessable Entity
  • 500Internal Server Error
  • 502Bad Gatewayhost_unreachable

Errors are RFC 9457 application/problem+json with a stable code field.

POST/services/{serviceId}/ssh/key

Generate, upload or rotate the SSH deploy key

Without privateKey an Ed25519 key pair is generated; the public key goes on the repository as a deploy key. With privateKey your own unencrypted key is stored (write-only). An existing key is replaced only with rotate: true; otherwise 409 ssh_key_exists. Needs projects:write. Takes effect on the next deployment; nothing is staged.

ParameterInTypeDescription
serviceIdrequiredpathstring
Request body · application/json · required
SetKeyInputBody
  • privateKeystring
    Write-only. An unencrypted OpenSSH or PEM private key to use instead of a generated one; omit to generate an Ed25519 key
  • rotateboolean
    Replace the existing key. Without it an existing key is a 409 ssh_key_exists
Response 200 · OK · application/json
StatusView
  • DeployKeyLink
  • hoststring
  • HostView[] | nullrequired
  • KeyView
  • usesSshUrlbooleanrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflictssh_key_exists
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

DELETE/services/{serviceId}/ssh/key

Remove the SSH deploy key and the pinned host keys

Needs projects:write. A service whose git URL is an SSH URL cannot be deployed until a key is set again.

ParameterInTypeDescription
serviceIdrequiredpathstring
Response 204 · No Content

No body.

Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

POST/services/{serviceId}/ssh/test

Test the SSH connection to the repository

Fetches the configured branch over SSH with the deploy key. The first connection pins the host key; a changed key is refused and recorded. Always 200: ok and code (no_key, not_ssh_url, host_key_changed, git_unreachable) say what happened. Needs projects:write.

ParameterInTypeDescription
serviceIdrequiredpathstring
Response 200 · OK · application/json
TestResult
  • codestring
  • commitShastring
    The branch head, when the test succeeded
  • messagestring
  • okbooleanrequired
  • StatusViewrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.