Terraform
GitHub App installations API reference
You can create a GitHub App installation using the HCP Terraform UI.
Learn how to create a GitHub App installation.
Requirements
To use this resource in Terraform Enterprise installations, you must configure the GitHub App in the site admin area.
You must have already authorized the Terraform Cloud GitHub App. Refer to GitHub app OAuth token for instructions.
List Installations
This endpoint lists GitHub App installations available to the current user.
GET /github-app/installations
Query Parameters
Queries only return GitHub App Installations that the current user has access to within GitHub.
Parameter | Description |
---|---|
filter[name] | Optional. If present, returns a list of available GitHub App installations that match the GitHub organization or login. |
filter[installation_id] | Optional. If present, returns a list of available GitHub App installations that match the installation ID within GitHub. (Not HCP Terraform) |
Sample Request
$ curl \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
https://app.terraform.io/api/v2/github-app/installations
Sample Response
{
"data": [
{
"id": "ghain-BYrbNeGQ8nAzKouu",
"type": "github-app-installations",
"attributes": {
"name": "octouser",
"installation-id": 54810170,
"icon-url": "https://avatars.githubusercontent.com/u/29916665?v=4",
"installation-type": "User",
"installation-url": "https://github.com/settings/installations/54810170"
}
}
]
}
Show Installation
GET /github-app/installation/:gh_app_installation_id
Parameter | Description |
---|---|
:gh_app_installation_id | The Github App Installation ID |
Sample Request
$ curl \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
https://app.terraform.io/api/v2/github-app/installation/ghain-R4xmKTaxnhLFioUq
Sample Response
{
"data": {
"id": "ghain-R4xmKTaxnhLFioUq",
"type": "github-app-installations",
"attributes": {
"name": "octouser",
"installation-id": 54810170,
"icon-url": "https://avatars.githubusercontent.com/u/29916665?v=4",
"installation-type": "User",
"installation-url": "https://github.com/settings/installations/54810170"
}
}
}