# List the GitHub App installations the caller can use and their repositories.

`GET /o/{org}/github`

Without `state`: the installations the caller owns plus those GitHub grants them
(`GithubInstallations`). With `state`: the status of the caller's own pending connect
(`GithubConnectStatus`).

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org` | path | string | yes | The org's slug or id. A caller with no role in the org gets `404`. |
| `state` | query | string | no | A `state` minted by `POST /o/{org}/github` (43 base64url characters). Switches the response to the connect status. |

## Example request

```bash
curl "https://api.prix.dev/o/$RUSH_ORG/github" \
  -H "Authorization: Bearer $RUSH_TOKEN"
```

```typescript
const org = process.env.RUSH_ORG;

const res = await fetch(`https://api.prix.dev/o/${org}/github`, {
  headers: {
    Authorization: `Bearer ${process.env.RUSH_TOKEN}`,
  },
});

console.log(res.status, await res.json());
```

```python
import os

import requests

org = os.environ["RUSH_ORG"]

res = requests.get(
    f"https://api.prix.dev/o/{org}/github",
    headers={"Authorization": f"Bearer {os.environ['RUSH_TOKEN']}"},
)

print(res.status_code, res.json())
```

## Responses

### 200

Installations (no `state`) or connect status (with `state`).


### 400

`state` is not 43 base64url characters.

### 401

No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.

### 404

Org not found, or `state` is not one of the caller's pending connects.

## Example response (200)

```json
{
  "installations": [
    {
      "id": 0,
      "account_login": "string",
      "account_type": "string",
      "repositories": [
        {
          "id": 0,
          "name": "string",
          "full_name": "string",
          "private": true
        }
      ],
      "suspended": true,
      "created_at": "2026-10-06T12:00:00Z",
      "settings_url": "https://example.com",
      "owned": true
    }
  ],
  "github_authorization": "authorized",
  "github_logins": [
    "string"
  ],
  "pending_requests": [
    {
      "account_login": "string",
      "account_type": "string",
      "requested_by": "string",
      "requested_at": "2026-10-06T12:00:00Z"
    }
  ],
  "installable_orgs": [
    {
      "login": "string",
      "install_url": "https://example.com"
    }
  ],
  "refresh": {
    "complete": true
  }
}
```
