Reference
View as MarkdownGit API
18 operations. Every call needs a session cookie or an Authorization: Bearer nct_… token unless marked Public. Conventions, errors and scopes
/git/connectionsList git connections
Connections to GitHub, GitLab, Gitea, Forgejo and Bitbucket. Credentials and secrets are never returned.
Response 200 · OK · application/json
- ConnectionView[] | nullrequired
401Unauthorized403Forbidden500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/git/connectionsConnect 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
- authTypeenum: token | oauthtoken: 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.
- baseUrlstringThe instance's web URL. Required for Gitea and Forgejo; defaults to https://gitlab.com and https://bitbucket.org
- clientIdstringOAuth application client id
- clientSecretstringWrite-only OAuth application client secret
- namestringDefaults to the provider and host
- providerenum: gitlab | gitea | forgejo | bitbucketrequiredGitHub connects through a GitHub App: use POST /git/github/manifest
- tokenstringWrite-only access token (authType token; for Bitbucket an optional repository access token to clone private repositories)
Response 201 · Created · application/json
- authorizeUrlstringrequired
- ConnectionViewrequired
- webhookSecretstringrequired
401Unauthorized403Forbidden409Conflict422Unprocessable Entitycredentials_invalid500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/git/connections/{connectionId}Get a git connection
| Parameter | In | Type | Description |
|---|---|---|---|
connectionIdrequired | path | string |
Response 200 · OK · application/json
- 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
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/git/connections/{connectionId}Rename a git connection or replace its credentials
Requires the admin scope. Secrets are write-only.
| Parameter | In | Type | Description |
|---|---|---|---|
connectionIdrequired | path | string |
Request body · application/json · required
- clientSecretstringWrite-only; replaces the OAuth client secret
- namestring
- tokenstringWrite-only; replaces the access token
Response 200 · OK · application/json
- 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
401Unauthorized403Forbidden404Not Found409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/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.
| Parameter | In | Type | Description |
|---|---|---|---|
connectionIdrequired | path | string | |
force | query | boolean | Also unlink the services that use the connection |
Response 204 · No Content
No body.
401Unauthorized403Forbidden404Not Found409Conflictconnection_in_use422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/git/connections/{connectionId}/branchesList a repository's branches
| Parameter | In | Type | Description |
|---|---|---|---|
connectionIdrequired | path | string | |
reporequired | query | string | owner/name |
Response 200 · OK · application/json
- itemsstring[] | nullrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error502Bad Gateway
Errors are RFC 9457 application/problem+json with a stable code field.
/git/connections/{connectionId}/deliveriesWebhook 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.
| Parameter | In | Type | Description |
|---|---|---|---|
connectionIdrequired | path | string | |
cursor | query | string | Opaque cursor from a previous page's nextCursor |
limit | query | integer (int64) | Page size (default 50, max 200) |
Response 200 · OK · application/json
- WebhookDeliveryView[] | nullrequired
- nextCursorstringPresent when more items exist
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/git/connections/{connectionId}/oauth/startStart (or restart) the OAuth authorization of a connection
Returns the provider URL to open in the browser.
| Parameter | In | Type | Description |
|---|---|---|---|
connectionIdrequired | path | string |
Response 200 · OK · application/json
- authorizeUrlstringrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/git/connections/{connectionId}/refreshLook 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.
| Parameter | In | Type | Description |
|---|---|---|---|
connectionIdrequired | path | string |
Response 200 · OK · application/json
- 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
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/git/connections/{connectionId}/reposList the repositories a connection can access
The repository picker. 422 no_repo_api for Bitbucket (enter owner/name instead). Requires projects:write.
| Parameter | In | Type | Description |
|---|---|---|---|
connectionIdrequired | path | string | |
q | query | string | Filter by name |
limit | query | integer (int64) |
Response 200 · OK · application/json
- Repo[] | nullrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entityno_repo_api500Internal Server Error502Bad Gateway
Errors are RFC 9457 application/problem+json with a stable code field.
/git/connections/{connectionId}/testTest a git connection
Calls the provider with the stored credentials and records the outcome in status.
| Parameter | In | Type | Description |
|---|---|---|---|
connectionIdrequired | path | string |
Response 200 · OK · application/json
- 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
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/git/connections/{connectionId}/webhook-secret/rotateIssue 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.
| Parameter | In | Type | Description |
|---|---|---|---|
connectionIdrequired | path | string |
Response 200 · OK · application/json
- webhookSecretstringrequiredShown once
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/git/github/manifestStart 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
- baseUrlstringWeb URL of a GitHub Enterprise Server (empty: github.com)
- namestringConnection name (default GitHub)
- ownerstringGitHub organization that should own the App (empty: your own account)
Response 200 · OK · application/json
- connectionIdstringrequired
- manifeststringrequired
- postUrlstringrequired
- statestringrequired
401Unauthorized403Forbidden422Unprocessable Entitypublic_url_required500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/sshGet 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.
| Parameter | In | Type | Description |
|---|---|---|---|
serviceIdrequired | path | string |
Response 200 · OK · application/json
- DeployKeyLink
- hoststring
- HostView[] | nullrequired
- KeyView
- usesSshUrlbooleanrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entitynot_git_source500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/ssh/host-keys/acceptAccept 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.
| Parameter | In | Type | Description |
|---|---|---|---|
serviceIdrequired | path | string |
Request body · application/json · required
- fingerprintstringrequiredThe SHA256 fingerprint of the host key you reviewed; the key is pinned only if the server still presents it
Response 200 · OK · application/json
- DeployKeyLink
- hoststring
- HostView[] | nullrequired
- KeyView
- usesSshUrlbooleanrequired
401Unauthorized403Forbidden404Not Found409Conflicthost_key_changed422Unprocessable Entity500Internal Server Error502Bad Gatewayhost_unreachable
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/ssh/keyGenerate, 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.
| Parameter | In | Type | Description |
|---|---|---|---|
serviceIdrequired | path | string |
Request body · application/json · required
- privateKeystringWrite-only. An unencrypted OpenSSH or PEM private key to use instead of a generated one; omit to generate an Ed25519 key
- rotatebooleanReplace the existing key. Without it an existing key is a 409 ssh_key_exists
Response 200 · OK · application/json
- DeployKeyLink
- hoststring
- HostView[] | nullrequired
- KeyView
- usesSshUrlbooleanrequired
401Unauthorized403Forbidden404Not Found409Conflictssh_key_exists422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/ssh/keyRemove 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.
| Parameter | In | Type | Description |
|---|---|---|---|
serviceIdrequired | path | string |
Response 204 · No Content
No body.
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/ssh/testTest 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.
| Parameter | In | Type | Description |
|---|---|---|---|
serviceIdrequired | path | string |
Response 200 · OK · application/json
- codestring
- commitShastringThe branch head, when the test succeeded
- messagestring
- okbooleanrequired
- StatusViewrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.