---
title: "List the repositories a connection can see"
url: https://docs.corefinity.com/api/reference/deployments/list-site-deployment-repositories
type: endpoint
last_updated: 2026-11-13
feature: deployments
related:
  - https://docs.corefinity.com/guides/sites/code-and-deployments/connect-a-repository.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_repositories_list.md
---
# List the repositories a connection can see

Asks the git provider for the repositories the connection's account can see, most recently updated first, at
most 50. `q` searches part of their names. You must be someone who may deploy the site.

```http
GET /api/corestack/sites/{site}/deployments/repositories
```

- Scope: `read`
- Two-factor: required on your account (all)
- Rate limit: 30 a minute
- Try it in the console: on

## Path parameters

- `site` (integer, required): The id of a site row. A website's production site and each of its environments has its own id. Digits only.

## Query parameters

- `connection` (integer, required): The id of a repository connection you may use on this site, as the settings list them in `connections`.
- `q` (string): Part of a repository's name.

## Request

### curl

```bash
curl 'https://manage.corefinity.com/api/corestack/sites/1042/deployments/repositories?connection=4217' \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->get('https://manage.corefinity.com/api/corestack/sites/1042/deployments/repositories?connection=4217');

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/deployments/repositories?connection=4217', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
  },
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.get(
    "https://manage.corefinity.com/api/corestack/sites/1042/deployments/repositories?connection=4217",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
)

data = res.json() if res.content else None
```

## Responses

### 200 The repositories.

```json
{
  "repositories": [
    {
      "admin": true,
      "default_branch": "main",
      "name": "harbourandfinch",
      "repo": "northwind-digital/harbourandfinch",
      "url": "https://gitlab.example.com/northwind-digital/harbourandfinch"
    },
    {
      "admin": false,
      "default_branch": "main",
      "name": "harbourandfinch-theme",
      "repo": "northwind-digital/harbourandfinch-theme",
      "url": "https://gitlab.example.com/northwind-digital/harbourandfinch-theme"
    }
  ]
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the scope (`scope_required`, with the `scope` to use), or your company requires two-factor authentication and you have not set it up. For routes outside Managed Clusters.

```json
{
  "code": "company_unavailable",
  "message": "Your company is unavailable.",
  "reason": "company_unavailable"
}
```

### 404 The site does not exist or is one you cannot deploy, `connection` is not a connection you may use on this site, or deployments are not on for your company (`feature_off`).

```json
{
  "message": "Not found."
}
```

### 409 The git provider no longer accepts the connection (`needs_reauth`). Reconnect the account in the Control Panel.

```json
{
  "code": "needs_reauth",
  "message": "The GitLab connection needs re-authorising",
  "reason": "needs_reauth"
}
```

### 422 `connection` is missing or `q` is too long (`invalid`), or the git provider's address cannot be reached (a message only).

```json
{
  "code": "invalid",
  "errors": {
    "connection": [
      "The connection field is required."
    ]
  },
  "field": "connection",
  "message": "The connection field is required.",
  "reason": "invalid"
}
```

### 429 Too many requests (`rate_limited`). Wait for the number of seconds in `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

### 502 A provider the request depends on did not answer. Nothing was changed; try again.

```json
{
  "message": "GitLab did not answer. Try again."
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | Send a valid token as `Authorization: Bearer <token>`. |
| 403 | `company_unavailable` | Your company is unavailable. |
| 403 | `scope_required` | Use a token with the scope named in `scope`. |
| 403 | `two_factor_required` | Turn on two-factor on your account, then send again. |
| 404 |  | Check the id. You see only what your account can reach. |
| 409 | `needs_reauth` | The repository's connection is gone or needs authorising again. Reconnect the repository. |
| 422 | `invalid` | Fix the field named in `field`; `errors` says why. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |
| 502 |  | Read the message; it says what happened. |

## The same task elsewhere

- Guide: [Connect a repository](https://docs.corefinity.com/guides/sites/code-and-deployments/connect-a-repository.md)
- MCP tool: [`corestack_deployments_repositories_list`](https://docs.corefinity.com/mcp/tools/corestack_deployments_repositories_list.md)
