# list_github_accounts

Source: https://modulify.ai/docs/api/workspaces/list-github-accounts

Lists the GitHub accounts connected to a workspace, with the id that create_site and move_site_code_to_github take.

- Title: List the GitHub accounts of a workspace
- Scope: `workspaces:read`
- Access: Read only
- Endpoint: `POST /v1/list_github_accounts`

These are the accounts on the **GitHub** tab of the workspace settings, oldest first, including any where the Modulify app is suspended. Every member of the workspace can read them. The `_id` of a row is the `installationId` that `create_site` takes inside `repository` and that `move_site_code_to_github` takes on its own, not the number GitHub gives the installation.

`AccountType` is `Organization` or `User`. Modulify can create a new repository in an organisation, and in a personal account while `Granted_At` is set and `Grant_Expires_At` is empty or still ahead. Verifying a personal account sets them, and verifying it again renews them. Until then a site can only go into a repository the personal account already has. `RepositorySelection` is `all` when the Modulify app reaches every repository of the account, and `selected` when it only reaches the ones picked on GitHub. An account takes a site only while its `Status` is `active` and once `Verified_At` is set. Connecting and verifying an account happens in the browser, see [Connect a GitHub account to the workspace](https://modulify.ai/docs/editor/move-code-to-github#connect-a-github-account-to-the-workspace).

## Request

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

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

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

Over MCP, the same method is the [list_github_accounts tool](https://modulify.ai/docs/mcp/workspaces/list-github-accounts).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `workspaceId` | string | Yes | The workspace id, from `list_workspaces`. |

## 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.