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. With no `visibility` param it returns the widest view the granted scope allows — private repos included once the identity carries the `repo` scope (Tier 2), public-only before that — and reports which of the two happened via `can_list_private`. Passing `visibility=private`/`all` without the scope is a `403 NeedsScopeError` instead.
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