# Repositories the connected access reaches.

> Through whichever GitHub access serves the workspace now: the App's installations (every repository each linked installation reaches, merged; `canPush` from that installation's permissions) or the legacy token (its 500 most recently pushed repositories, and for `search` also GitHub's own search).
> https://koi.dog/docs/api/github/list-git-hub-repos/

`GET /api/v1/github/repos` · Scope: `read`

Each with `defaultBranch`, `private`, `archived` and `canPush` (whether that access can push; null when GitHub did not say). Sorted by `fullName`, then `githubId`, in plain ASCII order; `search` matches part of `fullName`, ignoring ASCII case. Paged. With the legacy token only the workspace's owner, signed in, may read it: never an API key or a limited CLI sign-in, whatever its scopes (`403 not_allowed`). `409 github_access_required`, `503 github_unavailable`, `429 rate_limited` as for the accounts.

## Query parameters.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | `1–200` | no | Page size. Default `50`. |
| `order` | `enum` | no | Sort by creation time, then ID. `desc` newest, `asc` oldest. One of `asc`, `desc`. Default `asc`. |
| `cursor` | `string` | no | Previous page’s `nextCursor`. Keep filters and order. At least 1 character. |
| `search` | `string` | no | 1 to 100 characters. |

## Response.

200 OK · `data`: `object[]`. Pass `nextCursor` as `cursor` when `hasMore` is true.

## Request.

```sh
curl https://api.koi.dog/api/v1/github/repos \
    -H "Authorization: Bearer $KOIDOG_API_KEY"
```

```js
const res = await fetch("https://api.koi.dog/api/v1/github/repos", {
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_API_KEY}`,
  },
});
console.log(await res.json());
```

```python
import os

import requests

r = requests.get(
    "https://api.koi.dog/api/v1/github/repos",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_API_KEY']}",
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "data": [],
  "nextCursor": "string",
  "hasMore": false
}
```
