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.
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. 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, and the same repository and branch cannot be linked to two of your applications. 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.

Response

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

Common errors