List the authenticated user's GitHub repositories
GET/api/github/repos
listGithubRepos
Lists repos from the caller's linked GitHub identity for the import picker. Which listing runs depends on the identity's `token_kind`. Under a GitHub **App** user-to-server token the list is every repository of every App installation the user can see (`installations` names them, grouped by `account_login`); such a token has no scopes, so `can_list_private` is always `true`, a `visibility` filter is applied to the result rather than asked of GitHub, and the way to widen the list is to install the App on more repositories — `install_url`. Under a classic OAuth token (or a link that pre-dates the kind) it is the account's own `/user/repos`: with no `visibility` param it returns the widest view the granted scope allows — private repos included once the identity carries the `repo` scope, public-only before that — and reports which via `can_list_private`; passing `visibility=private`/`all` without the scope is a `403 NeedsScopeError`. On either path a token locked to specific repositories or workspaces never gains private enumeration: an unqualified request stays public-only, and an explicit `private`/`all` from such a token is `403 forbidden` on the App path.
Requires authentication using a session cookie or a bearer token — see tokens and scopes.
curl
curl -X GET 'https://neosource.dev/api/github/repos' \
-H 'Authorization: Bearer $NEOSOURCE_TOKEN'fetch
fetch("https://neosource.dev/api/github/repos", {
method: "GET",
headers: {
Authorization: "Bearer $NEOSOURCE_TOKEN",
},
});Query parameters
visibilityOne of `public`, `private`, `all`. Omitted means **auto**: the widest view the granted scope allows — `all` when the linked identity carries the `repo` scope (Tier 2), `public` otherwise. Asking for `private`/`all` *explicitly* is a demand rather than a preference, so it returns `403 NeedsScopeError` when the scope is missing instead of silently degrading to public-only.
Responses
200GitHub repositories
application/json
403Forbidden — one of: forbidden, needs_scope
application/json
Standard errors
Bodies documented once for the whole API — see standard errors.
- 400Bad Request — one of: invalid_input
- 401Authentication required
- 429Rate limited — retry after the `Retry-After` header
- 500Internal server error
- 502Bad Gateway — one of: upstream
- 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
- 504Gateway timeout — the request exceeded the server's handling budget
Schemas
Referenced above. Listed here rather than expanded inline, so the same definition is not repeated at every level.
GithubInstallationAccountType
Whether an installation sits on a GitHub user or an organization.
"user""organization"
GithubRepositorySelection
Whether the installation covers every repository on the account or an explicitly selected subset (`installation.repository_selection`).
"all""selected"