---
title: "Link a GitHub repository via the Square Cloud GitHub App"
method: POST
path: "/v2/apps/{appId}/deploy/github-app"
tags: ["Deployments"]
---

# Link a GitHub repository via the Square Cloud GitHub App

`POST /v2/apps/{appId}/deploy/github-app`

Associates the application with a GitHub repository + branch installed through the Square Cloud GitHub App. The branch must be ≤256 chars and the (repository, branch) pair must not already be linked to another application owned by the caller.

Requires a session token. Rate limited to 3 calls per 60s per user.

## Path parameters

- `appId` string, required

## Request body

- object
  - `repositoryName` string, required — Full repository name (e.g. `octocat/hello-world`).
  - `repositoryBranch` string, required

## Response `200`

Repository linked.

- object
  - `status` 'success', required
  - `response` object, required
    - `repository` object, required
      - `id` integer, required
      - `full_name` string, required
      - `branch` string, required

## Other responses

- `400` — The request failed validation or the application already has a Git repository configured.
- `401` — This endpoint requires a session token (JWT). API keys are not accepted.
- `404` — The application does not exist or is not owned by the caller.
- `409` — Another application already links the same (repository, branch) pair.
- `413` — The request body is larger than the maximum allowed size (100MB).
- `429` — The endpoint enforces its own rate limit and the caller hit the cooldown.
- `500` — Repository validation failed.
- `504` — The repository validation service (auth) timed out.

---

[API](https://skmtc.dev/squarecloud/apis/square-cloud-api.md) · [All operations](https://skmtc.dev/squarecloud/apis/square-cloud-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/squarecloud/square-cloud-api/revisions/54b7733a6b95/schema)
