GitHub


GET /github/install-callback

GitHub App install callback

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

Auth: Bearer token required

Query parameters

NameTypeDescription
installation_idintegerGitHub installation ID (required)
setup_actioninstall | updateGitHub sends install on first install and update on re-installs, repo-selection changes and permission updates (required)
statestringSigned install-state JWT minted by install-url (required)

Responses

StatusDescriptionSchema
302Status 302object
400Bad RequestError
404Not FoundError
409ConflictError
503Service UnavailableError

POST /github/installations/recover

Recover an unclaimed GitHub installation

Org owner/admin only (checked in-handler via resolveOrgRoleForUser — no org segment in the path for a derived floor, see spec §15.4). Claims an installation that exists on GitHub but has no Terrantula row.

Auth: Bearer token required

Request body (application/json)

FieldTypeDescription
orgIdstringOrganization id or slug (required)
installationIdintegerGitHub installation ID (from the GitHub install URL) (required)

Responses

StatusDescriptionSchema
200OKRecoveredGitHubInstallation
401UnauthorizedError
403ForbiddenError
404Not FoundError
409ConflictError
503Service UnavailableError

GET /github/installations

List GitHub installations for an org

Org member only (checked in-handler via resolveOrgRoleForUser, see spec §15.4). ?orgId is required.

Auth: Bearer token required

Query parameters

NameTypeDescription
orgIdstringOrganization id or slug (required)

Responses

StatusDescriptionSchema
200OKGitHubInstallationList
400Bad RequestError
401UnauthorizedError
403ForbiddenError
503Service UnavailableError

GET /github/installations/{installationId}/repos

List an installation's granted repos

Org member only (checked in-handler via resolveOrgRoleForUser, see spec §15.4). Returns the cached granted_repos for the installation.

Auth: Bearer token required

Path parameters

NameTypeDescription
installationIdstringInstallation row ID

Responses

StatusDescriptionSchema
200OKGitHubGrantedRepoList
401UnauthorizedError
403ForbiddenError
404Not FoundError
503Service UnavailableError

DELETE /github/installations/{installationId}

Soft-delete a GitHub installation

Org owner/admin only (checked in-handler via resolveOrgRoleForUser, see spec §15.4). Marks the installation deleted in Terrantula; does not uninstall on GitHub.

Auth: Bearer token required

Path parameters

NameTypeDescription
installationIdstringInstallation row ID

Responses

StatusDescriptionSchema
200OKobject
401UnauthorizedError
403ForbiddenError
404Not FoundError
503Service UnavailableError

POST /{o}/{p}/github/install-url

Get a GitHub App install URL

Returns a GitHub installation URL carrying a signed state JWT for this project.

Auth: Bearer token required · Permission: tokens:manage

Path parameters

NameTypeDescription
ostring
pstring

Responses

StatusDescriptionSchema
200OKGitHubInstallUrl
401UnauthorizedError
403ForbiddenError
503Service UnavailableError

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

List project ↔ GitHub repo links

Read-only.

Auth: Bearer token required · Permission: catalog:read

Path parameters

NameTypeDescription
orgIdstringOrganization slug
projectIdstringProject name

Responses

StatusDescriptionSchema
200OKProjectGithubRepoLinkList
401UnauthorizedError
403ForbiddenError

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
orgIdstringOrganization slug
projectIdstringProject name

Request body (application/json)

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

Responses

StatusDescriptionSchema
201CreatedProjectGithubRepoLink
400Bad RequestError
401UnauthorizedError
403ForbiddenError
404Not FoundError
409ConflictError

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
orgIdstringOrganization slug
projectIdstringProject name
idstring(uuid)project_github_repos.id (UUID) — returned by linkRepo

Responses

StatusDescriptionSchema
200OKDeletedById
401UnauthorizedError
403ForbiddenError
404Not FoundError

Schemas

DeletedById

FieldTypeDescription
deletedtrue(required)
idstring(required)

Error

FieldTypeDescription
errorstring(required)
codestring

GitHubGrantedRepoList

Type: object[]

GitHubInstallUrl

FieldTypeDescription
urlstring(required)

GitHubInstallation

FieldTypeDescription
idstring(uuid)(required)
githubInstallationIdinteger(required)
githubOrgLoginstring(required)
statusstring(required)
installedAtstring | string(required)
updatedAtstring | string(required)

GitHubInstallationList

Type: GitHubInstallation[]

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

Type: ProjectGithubRepoLink[]

RecoveredGitHubInstallation

FieldTypeDescription
idstring(uuid)(required)
githubInstallationIdinteger(required)
githubOrgLoginstring(required)