neosourceDocs
Search docs

List the repositories a team can reach

GET/api/teams/{team_id}/repos

listTeamRepos

The team half of ADR 0077 §5: every repository this team holds a grant on, with the role that grant carries. Visible to any workspace member; non-members get 404. Rows the CALLER cannot read are omitted, so the list is never an oracle for repositories they may not see.

Requires authentication using a bearer token or a session cookie — see tokens and scopes.

curl

curl -X GET 'https://neosource.dev/api/teams/TEAM_ID/repos' \
  -H 'Authorization: Bearer $NEOSOURCE_TOKEN'

fetch

fetch("https://neosource.dev/api/teams/TEAM_ID/repos", {
  method: "GET",
  headers: {
    Authorization: "Bearer $NEOSOURCE_TOKEN",
  },
});

Path parameters

team_idrequired

string

Responses

200Repositories the team reaches

application/json

TeamRepoListResponse

object

Repositories a team reaches, filtered to those the CALLER may read. Rows the caller cannot read are dropped silently, so the length is the number of visible rows and never an oracle for hidden ones.

reposrequired

array

items

TeamRepoResponse

object

One repository a team can reach through a `repo_grants` row, as the team page's Repositories rail renders it (ADR 0077 §5 — the mirror of the repo → Access page). `visibility` and `role` are the real core enums rather than strings, so the `OpenAPI` document carries actual enum schemas and the generated client types stay closed sets.

namerequired

string

ownerrequired

string

Workspace slug owning the repository — `owner` in `owner/name`.

rolerequired
RepoRole
visibilityrequired
RepoVisibilityInput

403Forbidden — one of: forbidden, needs_scope

application/json

one of
  • ErrorForbidden
  • NeedsScopeError

    object

    `403` body returned when listing private repos but the linked identity lacks the required provider scope. The SPA turns this into an incremental-authorization prompt (Tier 2) that calls the `/elevate` OAuth endpoint with this `scope`.

    errorrequired

    string

    Always `needs_scope` — this body exists to carry the extra fields that kind needs.

    "needs_scope"

    scoperequired

    string

    The provider scope to request via elevation (e.g. `"repo"`).

Standard errors

Bodies documented once for the whole API — see standard errors.

  • 400Bad Request — one of: invalid_input
  • 401Authentication required
  • 404Not Found — one of: not_found
  • 429Rate limited — retry after the `Retry-After` header
  • 500Internal server error
  • 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.

RepoRole

string

Repo-level role (read/write/maintain/admin). Ordered low → high so `if role >= RepoRole::Write` reads naturally.

"read""write""maintain""admin"

RepoVisibilityInput

string

"public""internal""private"