Skip to main content
POST
Link GitHub App Repository
string
required
The API key for your account. You can find this in your account settings.
Requires an API key with the apps:deploy scope. This endpoint links an application to a GitHub repository and branch through the Square Cloud GitHub App, so every push to that branch deploys the application. It is the recommended alternative to Set GitHub Webhook: no personal access token is stored, and each deploy shows up as a Check Run on the commit. Before calling it, connect your GitHub account to Square Cloud and install the Square Cloud GitHub App on the repository. The repository must be covered by an installation your own GitHub account holds; otherwise the request fails with REPOSITORY_NOT_AVAILABLE. That GitHub account also needs write (push) or admin permission on the repository: read-only access fails with REPOSITORY_PERMISSION_REQUIRED. It works with an API key that has the apps:deploy scope, and only the application owner can call it. An application holds one GitHub App link at a time, so unlink the current repository before linking a different one. A repository and branch can be linked to only one application on the whole platform, whoever owns it. Linking invalidates the cached response from Get Current Deployment. Calls are rate limited to 3 per 60 seconds per user, shared with unlinking.

Parameters

string
required
The ID of the application. You can find this in the URL of your application’s dashboard.
string
required
The full name of the repository, in the owner/repository format.
string
required
The branch whose pushes deploy the application. Up to 256 characters, and it must exist in the repository with this exact name.

Response

string
Indicates whether the call was successful: success if it was, error if not.
object
The contents of the response.

Common errors