Organization API: Organization deployments: Git
The 4 Organization API operations for git.
Part of Organization deployments.
Operations
Section titled Operations| Method | Path | Summary |
|---|---|---|
| GET | /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/git |
Get the repository connection |
| PUT | /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/git |
Build the deployment from a repository one of the owner's GitHub App installations reaches |
| PATCH | /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/git |
Change the repository settings |
| DELETE | /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/git |
Stop cloning through the GitHub App |
Get the repository connection
Section titled Get the repository connectionGET /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/git
The deployment's repository, its branch and directory, and whether it
is reached through the GitHub App (connected) or as a pasted address.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
deployment_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Build the deployment from a repository one of the owner's GitHub App installations reaches
Section titled Build the deployment from a repository one of the owner's GitHub App installations reachesPUT /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/git
Build the deployment from a repository one of the owner's GitHub App installations reaches. Its pasted token, if it had one, is deleted: the App clones from now on. 404 for another owner's installation, 409 while it is suspended, 422 when it cannot reach the repository. The next release builds from it.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
deployment_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
installation |
integer | yes | The installation's id here (GET /git/github/installations) |
repo_id |
integer | yes | GitHub's id of the repository |
branch |
string or null | no | The production branch; the repository's default when left out |
root_dir |
string or null | no | The app's directory in the repository |
dockerfile_path |
string or null | no | Refused with 422 dockerfile_unsupported when set: Dockerfiles are not built on the platform |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Change the repository settings
Section titled Change the repository settingsPATCH /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/git
Change the branch that deploys to production, the app's directory,
previews, pull request comments, watch paths or the ignore command.
Only what the body names changes; null clears root_dir,
watch_paths and ignore_command. Turning previews on answers
402 when the plan of the account the deployment bills to does not
include them (an organization's owner now, as for a push); turning it
off leaves the live previews serving until they are closed.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
deployment_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
branch |
string or null | no | |
root_dir |
string or null | no | null for the repository's root |
previews |
boolean or null | no | Make a preview of each push to another branch and each pull request |
pr_comments |
boolean or null | no | Comment each pull request's preview addresses on it |
watch_paths |
array of string or null | no | null or [] builds every push |
ignore_command |
string or null | no | null for none |
dockerfile_path |
string or null | no | Refused with 422 dockerfile_unsupported when set: Dockerfiles are not built on the platform |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Stop cloning through the GitHub App
Section titled Stop cloning through the GitHub AppDELETE /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/git
Stop cloning through the GitHub App. The deployment keeps its repository address and builds as a pasted repository would, which needs a token for a private one.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
deployment_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |