GET /v1/github/repos
List repositories visible to the registered GitHub App installation.
GET
/v1/github/reposPhase 1stable
- Auth
- Bearer
- Scope
- github:admin
Proxies GitHub's installation-repos endpoint with a short-lived installation token. Use this to render a "pick a repository" step in your onboarding UI before calling POST /v1/projects/:id/ingest/github.
The list reflects exactly what the installation can see on GitHub. If a user expected a repo to appear and it doesn't, they usually need to reconfigure the App to grant access to that repo — Layers can't expand scope server-side.
Query
cursorstringoptionalOpaque pagination token from a previous response's nextCursor.limitintegeroptionaldefault: 30Page size, 1–200.searchstringoptionalCase-insensitive substring match on repo full name.
Example request
curl "https://api.layers.com/v1/github/repos?limit=30" \
-H "Authorization: Bearer lp_live_01HX9Y6K7EJ4T2_4QZpN..."const { items, nextCursor } = await layers.github.listRepos({ limit: 30 });result = layers.github.list_repos(limit=30)Response
200OK
{
"items": [
{
"repoId": 612908344,
"fullName": "acme-coffee/ios-app",
"owner": "acme-coffee",
"private": true,
"defaultBranch": "main",
"language": "Swift",
"primaryLanguage": "Swift",
"htmlUrl": "https://github.com/acme-coffee/ios-app"
},
{
"repoId": 612908745,
"fullName": "acme-coffee/marketing-site",
"owner": "acme-coffee",
"private": false,
"defaultBranch": "main",
"language": "TypeScript",
"primaryLanguage": "TypeScript",
"htmlUrl": "https://github.com/acme-coffee/marketing-site"
}
],
"nextCursor": null
}language and primaryLanguage are duplicates — primaryLanguage is the modern field; language is kept for older clients. Either is safe to read.
Errors
| Status | Code | When |
|---|---|---|
| 422 | VALIDATION | limit out of range, cursor malformed, or installation was uninstalled on GitHub and Layers cannot create a token. |
| 401 | UNAUTHENTICATED | Missing or invalid key. |
| 403 | FORBIDDEN_SCOPE | Key lacks github:admin. |
| 404 | NOT_FOUND | No installation registered. Call POST /v1/github/installation first. |
| 429 | RATE_LIMITED | Read budget or upstream GitHub rate limit — Retry-After is honored. |
See also
POST /v1/projects/:id/ingest/github— start an ingest against a chosen repoGET /v1/github/installation— verify installation liveness