Get the installation URL for the GitHub App
GET /api
Query Parameters
redirectUristring (required)
Response
200 — OK
Get the settings for the GitHub App
GET /api
Response
200 — Success
CanUseGitHubAppbooleanCanUseTrustedFlowboolean
Example Response
{
"CanUseGitHubApp": true,
"CanUseTrustedFlow": true
}Get the status of the registration between Octopus Server and the GitHub App
GET /api
Response
200 — Response containing the status of the registration between Octopus Server and the GitHub App
Statusstring
The status of the GitHub App registration. Valid values are: Connected, RegistrationInvalid, Error. Minimum length 1.
Example Response
{
"Status": "string"
}Get GitHub App connections for the space
GET /api
Also reachable at /api.
Path Parameters
spaceIdstring (required)
Query Parameters
skipinteger (required)
Number of items to skip. Defaults to zero. Minimum0.takeinteger (required)
Number of items to take. Defaults to 30. Minimum0.
Response
200 — All GitHub App connections for the space
Connectionsarray of objectIdstringInstallationobjectStatusenum
Allowed values:ConnectionNotFound,InstallationNotFound,InstallationSuspended,Connected,Error.
ItemsPerPageintegerNumberOfPagesintegerTotalResultsinteger
Example Response
{
"Connections": [
{
"Id": "string",
"Installation": {
"AccountAvatarUrl": "string",
"AccountId": "string",
"AccountLogin": "string",
"AccountType": "string",
"AllRepositories": true,
"InstallationId": "string"
},
"Status": "ConnectionNotFound"
}
],
"ItemsPerPage": 0,
"NumberOfPages": 0,
"TotalResults": 0
}Create a new GitHub App connection for an installation
POST /api
Also reachable at /api.
Path Parameters
spaceIdstring (required)
Request Body
InstallationIdstring (required)
Minimum length 1.RepositoryIdsarray of string (required)SpaceIdstring (required)
Response
201 — Created
Example Request
{
"InstallationId": "string",
"RepositoryIds": [
"string"
],
"SpaceId": "Spaces-1"
}Example Response
"string"Get the GitHub repositories for the current connection
GET /api
Also reachable at /api.
Path Parameters
connectionIdstring (required)spaceIdstring (required)
Response
200 — GitHub repositories available for the current connection
Repositoriesarray of objectDefaultBranchstringGitUrlstringIsAdminbooleanIsPrivatebooleanLanguagestringRepositoryIdstringRepositoryNamestringVisibilitystring
Example Response
{
"Repositories": [
{
"DefaultBranch": "string",
"GitUrl": "string",
"IsAdmin": true,
"IsPrivate": true,
"Language": "string",
"RepositoryId": "string",
"RepositoryName": "string",
"Visibility": "string"
}
]
}Get a single GitHub app connection by id
GET /api
Also reachable at /api.
Path Parameters
idstring (required)spaceIdstring (required)
Response
200 — A GitHub app connection
IdstringInstallationobjectAccountAvatarUrlstringAccountIdstringAccountLoginstringAccountTypestringAllRepositoriesboolean
true if the installation has access to all repositories in the account, false if it has access to only selected repositories.InstallationIdstring
Repositoriesarray of objectDefaultBranchstringGitUrlstringIsAdminbooleanIsPrivatebooleanLanguagestringRepositoryIdstringRepositoryNamestringVisibilitystring
SpaceIdstringStatusstring
Minimum length 1.StatusUserMessagestringUnknownRepositoriesarray of object
Repositories IDs that are configured on the connection but do not have a matching repository returned from GitHub.RepositoryIdstringRepositoryNamestring
Example Response
{
"Id": "string",
"Installation": {
"AccountAvatarUrl": "string",
"AccountId": "string",
"AccountLogin": "string",
"AccountType": "string",
"AllRepositories": true,
"InstallationId": "string"
},
"Repositories": [
{
"DefaultBranch": "string",
"GitUrl": "string",
"IsAdmin": true,
"IsPrivate": true,
"Language": "string",
"RepositoryId": "string",
"RepositoryName": "string",
"Visibility": "string"
}
],
"SpaceId": "Spaces-1",
"Status": "string",
"StatusUserMessage": "string",
"UnknownRepositories": [
{
"RepositoryId": "string",
"RepositoryName": "string"
}
]
}Update a GitHub App connection with a new set of repositories
PUT /api
Also reachable at /api.
Path Parameters
idstring (required)spaceIdstring (required)
Request Body
Idstring (required)RepositoryIdsarray of string (required)SpaceIdstring (required)
Response
200 — GitHub app connection modified result
Example Request
{
"Id": "string",
"RepositoryIds": [
"string"
],
"SpaceId": "Spaces-1"
}Example Response
{}Delete a GitHub App Connection
DELETE /api
Also reachable at /api.
Path Parameters
idstring (required)
Id of the GitHub connection to delete.spaceIdstring (required)
The ID of the space containing the resource(s).
Response
200 — Used to indicate that a GitHub App Connection has been deleted
Example Response
{}Recover GitHub App connection after the registration has changed
POST /api
Also reachable at /api.
Path Parameters
idstring (required)spaceIdstring (required)
Request Body
Idstring (required)RepositoryIdsarray of string (required)SpaceIdstring (required)
Response
200 — GitHub app connection recovery result
Example Request
{
"Id": "string",
"RepositoryIds": [
"string"
],
"SpaceId": "Spaces-1"
}Example Response
{}Recover GitHub App connection after the installation was not found
POST /api
Also reachable at /api.
Path Parameters
idstring (required)spaceIdstring (required)
Request Body
Idstring (required)InstallationIdstring (required)RepositoryIdsarray of string (required)SpaceIdstring (required)
Response
200 — GitHub app connection not-found recovery result
Example Request
{
"Id": "string",
"InstallationId": "string",
"RepositoryIds": [
"string"
],
"SpaceId": "Spaces-1"
}Example Response
{}Refresh the GitHub App connection token
POST /api
Also reachable at /api.
Path Parameters
idstring (required)spaceIdstring (required)
Response
200 — GitHub app connection has been refreshed
Example Response
{}Get a list of GitHub organisations accessible to the current GitHub OAuth user. Request will fail if the user does not have a valid GitHub OAuth token
GET /api
Also reachable at /api.
Path Parameters
spaceIdstring (required)
Query Parameters
excludeConnectedboolean
Response
200 — List of GitHub organisations accessible to the current GitHub OAuth user
Installationsarray of objectAccountAvatarUrlstringAccountIdstringAccountLoginstringAccountTypestringAllRepositoriesboolean
true if the installation has access to all repositories in the account, false if it has access to only selected repositories.InstallationIdstring
Example Response
{
"Installations": [
{
"AccountAvatarUrl": "string",
"AccountId": "string",
"AccountLogin": "string",
"AccountType": "string",
"AllRepositories": true,
"InstallationId": "string"
}
]
}Handle the response from GitHub after an application has been installed or updated
GET /api
Query Parameters
installation_idstringredirectUristring (required)
Response
200 — OK
Get the GitHub repositories for an installation visible to the current user https://docs.github.com/en/rest/apps/installations?apiVersion=2022-11-28#list-repositories-accessible-to-the-user-access-token
GET /api
Path Parameters
installationIdstring (required)
Query Parameters
skipinteger (required)
Number of items to skip. Defaults to zero. Minimum0.takeinteger (required)
Number of items to take. Defaults to 30. Minimum0.
Response
200 — Success
ItemTypestringItemsarray of objectDefaultBranchstringGitUrlstringIsAdminbooleanIsPrivatebooleanLanguagestringRepositoryIdstringRepositoryNamestringVisibilitystring
ItemsPerPageintegerLastPageNumberintegerNumberOfPagesintegerTotalResultsinteger
Example Response
{
"ItemType": "string",
"Items": [
{
"DefaultBranch": "string",
"GitUrl": "string",
"IsAdmin": true,
"IsPrivate": true,
"Language": "string",
"RepositoryId": "string",
"RepositoryName": "string",
"Visibility": "string"
}
],
"ItemsPerPage": 0,
"LastPageNumber": 0,
"NumberOfPages": 0,
"TotalResults": 0
}Reset the GitHub app registration for this Octopus instance. This is a destructive command and will break all existing GitHub app connections across the instance. This should only be used as a last resort to recover connectivity with GitHub
POST /api
Response
200 — GitHub app registration was successfully deleted
Example Response
{}Search for GitHub repositories for an account visible to the current user https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28#search-repositories
GET /api
Path Parameters
accountNamestring (required)
Query Parameters
keywordstringskipinteger (required)
Number of items to skip. Defaults to zero. Minimum0.takeinteger (required)
Number of items to take. Defaults to 30. Minimum0.
Response
200 — Success
ItemTypestringItemsarray of objectDefaultBranchstringGitUrlstringIsAdminbooleanIsPrivatebooleanLanguagestringRepositoryIdstringRepositoryNamestringVisibilitystring
ItemsPerPageintegerLastPageNumberintegerNumberOfPagesintegerTotalResultsinteger
Example Response
{
"ItemType": "string",
"Items": [
{
"DefaultBranch": "string",
"GitUrl": "string",
"IsAdmin": true,
"IsPrivate": true,
"Language": "string",
"RepositoryId": "string",
"RepositoryName": "string",
"Visibility": "string"
}
],
"ItemsPerPage": 0,
"LastPageNumber": 0,
"NumberOfPages": 0,
"TotalResults": 0
}Get status of the users current authorization
GET /api
Query Parameters
includeUserDetailsboolean
Response
200 — Get the status of the user’s current authorization.
CanAuthorizebooleanIsAuthorizedbooleanUserDetailsobjectAvatarUrlstringLoginstringNamestringPrimaryEmailstringRefreshTokenValidTostring
Formatdate-time.TokenValidTostring
Formatdate-time.
Example Response
{
"CanAuthorize": true,
"IsAuthorized": true,
"UserDetails": {
"AvatarUrl": "string",
"Login": "string",
"Name": "string",
"PrimaryEmail": "string",
"RefreshTokenValidTo": "2020-01-01T00:00:00.000Z",
"TokenValidTo": "2020-01-01T00:00:00.000Z"
}
}Authorize the current user with the Octopus GitHub app
POST /api
Request Body
RedirectUristring (required)
Minimum length 1.
Response
200 — GitHub URL to authorize the GitHub app
AuthorizeUristring
Minimum length 1.
Example Request
{
"RedirectUri": "string"
}Example Response
{
"AuthorizeUri": "string"
}Exchange a GitHub App authorization code for an access token and store in the instance
POST /api
Request Body
Codestring (required)
Minimum length 1.
Response
200 — Reports the success of exchanging a GitHub App authorization code for an access token
ErrorMessagestringStatusstring
Minimum length 1.
Example Request
{
"Code": "string"
}Example Response
{
"ErrorMessage": "string",
"Status": "string"
}Exchange a GitHub App authorization code for an access token and store in the instance
GET /api
Query Parameters
codestring (required)redirectUristring (required)
Response
200 — OK
Deauthorize the GitHub app for the current user, removing this users GitHub tokens from Octopus
DELETE /api
Response
200 — Deauthorized GitHub app user
Example Response
{}Refresh the GitHub current app user. Refreshing the users token and cached GitHub account details
POST /api
Response
200 — GitHub App user has been successfully refreshed
Example Response
{}Test connectivity to GitHub using the provided credentials
POST /api
Request Body
BaseUrlstring (required)
The GitHub base URL to test connectivity to. Minimum length 1.Passwordstring
The GitHub personal access token or password for authentication. If not provided, will be retrieved from configuration.UserNamestring
The GitHub username for authentication.
Response
200 — Result of testing connectivity to GitHub
Messagesarray of object
Messages from the connectivity check.Categoryenum
Allowed values:Info,Warning,Error.Messagestring
Minimum length 1.
Example Request
{
"BaseUrl": "string",
"Password": "string",
"UserName": "string"
}Example Response
{
"Messages": [
{
"Category": "Info",
"Message": "string"
}
]
}