# get_site_repository

Source: https://modulify.ai/docs/api/code/get-site-repository

Reads whether the code of a site lives with Modulify or in a GitHub account of the workspace, and how a move stands.

- Title: Read where the code of a site lives
- Scope: `code:read`
- Access: Read only
- Endpoint: `POST /v1/get_site_repository`

This is the **Repository** section of the site's **Settings** tab, see [Move your code to GitHub](https://modulify.ai/docs/editor/move-code-to-github). `CurrentFullName` names the repository the site is edited and published from, and `CustomerOwned` says whether that repository is in your GitHub. `OriginFullName` always names the repository Modulify manages for the site, the one `move_site_code_to_modulify` copies the code back into, so it matches `CurrentFullName` while the code lives with Modulify.

`Repository` carries the move itself. Its `Status` is `pending` while the code is being copied into your GitHub, `connected` once it lives there, `returning` while it moves back, `failed` with the reason in `Error`, and `access-required` or `deleted` when Modulify lost access to the repository or it was deleted on GitHub, which `AccessIssue` explains. `PublishBranch` is the branch every publish writes to and builds from.

`Installations` lists the GitHub accounts connected to the workspace, each with the `_id` that `move_site_code_to_github` takes, and an account can take the code only once `Verified_At` is set. Connecting or verifying an account happens in the browser, in the **GitHub** tab of the workspace settings.

`CanMigrate` and `CanReturn` say whether you may move the code there and back, with `Reason` when you may not. Moving it to GitHub needs a paid plan and the **Transfer projects** permission, and moving it back needs only the permission. Read this again after `move_site_code_to_github` or `move_site_code_to_modulify`, because the copy finishes in the background.

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/get_site_repository`, sending the inputs below as a JSON object. The token needs the `code:read` scope.

It only reads and changes nothing, so retrying it is safe.

```bash
curl -X POST https://api.modulify.ai/v1/get_site_repository \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID"}'
```

Over MCP, the same method is the [get_site_repository tool](https://modulify.ai/docs/mcp/code/get-site-repository).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.