GitHub


POST /github/install-url

Get a GitHub App install URL

Session-authed. Returns a GitHub installation URL carrying a signed state JWT for the caller's project.

Auth: Bearer token required

Request body (application/json)

FieldTypeDescription
projectIdstring(required)

Responses

StatusDescriptionSchema
200Install URLGitHubInstallUrl
401UnauthorizedError
403Not a project memberError
503GitHub App not configuredError

GET /github/install-callback

GitHub App install callback

Public redirect target from GitHub. Authenticated by the signed state JWT in the ?state query param — no session or Bearer token. Persists the installation and 302-redirects to project settings.

Auth: Bearer token required

Responses

StatusDescriptionSchema
302Redirect to project settings
400Missing/invalid params or stateError
404Project no longer existsError
409Installation claimed by another tenantError
503GitHub App not configuredError

POST /github/installations/recover

Recover an unclaimed GitHub installation

Session-authed (org owner/admin). Claims an installation that exists on GitHub but has no Terrantula row.

Auth: Bearer token required

Request body (application/json)

FieldTypeDescription
orgIdstring(required)
installationIdinteger(required)

Responses

StatusDescriptionSchema
200Claimed installationobject
401UnauthorizedError
403Forbidden (member role)Error
404Installation not found on GitHubError
409Installation already claimedError
503GitHub App not configuredError

GET /github/installations

List GitHub installations for an org

Session-authed (org member). ?orgId is required.

Auth: Bearer token required

Responses

StatusDescriptionSchema
200Active installationsGitHubInstallationList
400orgId requiredError
401UnauthorizedError
403Not an org memberError
503GitHub App not configuredError

GET /github/installations/{installationId}/repos

List an installation's granted repos

Session-authed (org member). Returns the cached granted_repos for the installation.

Auth: Bearer token required

Path parameters

NameTypeDescription
installationIdstring

Responses

StatusDescriptionSchema
200Granted reposGitHubGrantedRepoList
401UnauthorizedError
403Not an org memberError
404Installation not foundError
503GitHub App not configuredError

DELETE /github/installations/{installationId}

Soft-delete a GitHub installation

Session-authed (org owner/admin). Marks the installation deleted in Terrantula; does not uninstall on GitHub.

Auth: Bearer token required

Path parameters

NameTypeDescription
installationIdstring

Responses

StatusDescriptionSchema
200Deletedobject
401UnauthorizedError
403Forbidden (member role)Error
404Installation not foundError
503GitHub App not configuredError

GET /orgs/{orgId}/projects/{projectId}/github-repos

List project ↔ GitHub repo links

Read-only; gated by project membership (no extra permission).

Auth: Bearer token required

Path parameters

NameTypeDescription
orgIdstring
projectIdstring

Responses

StatusDescriptionSchema
200Repo linksProjectGithubRepoLinkList

POST /orgs/{orgId}/projects/{projectId}/github-repos

Link a GitHub repo to the project

Requires tokens:manage. Validates the installation belongs to the org and the repo is granted; resolves the repo node id server-side.

Auth: Bearer token required · Permission: tokens:manage

Path parameters

NameTypeDescription
orgIdstring
projectIdstring

Request body (application/json)

FieldTypeDescription
installationIdstring(uuid)(required)
repoFullNamestring(required)

Responses

StatusDescriptionSchema
201Created linkProjectGithubRepoLink
400Installation not activeError
404Repo not found or not grantedError
409Repo already linkedError

DELETE /orgs/{orgId}/projects/{projectId}/github-repos/{id}

Unlink a GitHub repo from the project

Requires tokens:manage.

Auth: Bearer token required · Permission: tokens:manage

Path parameters

NameTypeDescription
orgIdstring
projectIdstring
idstring

Responses

StatusDescriptionSchema
200Deleted linkobject
404Link not foundError

Schemas

Error

FieldTypeDescription
errorstring(required)
codestring

GitHubGrantedRepoList

Type: object[]

GitHubInstallUrl

FieldTypeDescription
urlstring(required)

GitHubInstallationList

Type: object[]

FieldTypeDescription
idstring(uuid)(required)
installationIdstring(uuid)(required)
repoFullNamestring(required)
repoNodeIdstring(required)
linkedAtstring | string
linkedBystring,null

Type: ProjectGithubRepoLink[]