Layers
Partner APIAPI referenceGitHub

GET /v1/github/repos

List repositories visible to the registered GitHub App installation.

View as Markdown
GET/v1/github/repos
Phase 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
  • cursor
    stringoptional
    Opaque pagination token from a previous response's nextCursor.
  • limit
    integeroptionaldefault: 30
    Page size, 1–200.
  • search
    stringoptional
    Case-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

StatusCodeWhen
422VALIDATIONlimit out of range, cursor malformed, or installation was uninstalled on GitHub and Layers cannot create a token.
401UNAUTHENTICATEDMissing or invalid key.
403FORBIDDEN_SCOPEKey lacks github:admin.
404NOT_FOUNDNo installation registered. Call POST /v1/github/installation first.
429RATE_LIMITEDRead budget or upstream GitHub rate limit — Retry-After is honored.

See also

On this page