---
title: "List repositories (paginated)"
method: POST
path: "/api/v2/repositories/list"
tags: ["Repositories"]
---

# List repositories (paginated)

`POST /api/v2/repositories/list`

## Request

- Base URL: `https://zeropath.com`
- URL: `https://zeropath.com/api/v2/repositories/list`
- Auth: API key in header `X-ZeroPath-API-Token-Id` and API key in header `X-ZeroPath-API-Token-Secret`

Get a paginated list of repositories for an organization with cursor-based pagination. This is a more efficient endpoint for organizations with many repositories.

## Request body

- object
  - `organizationId` string: Unique identifier of the organization
  - `appId` string: Filter by GitHub App ID
  - `externalGithubAppInstallationId` string: Filter by GitHub App installation ID
  - `getCounts` boolean: Include issue counts in the response (may impact performance)
  - `sortBy` 'name' | 'issues': Field to sort by
  - `sortDirection` 'asc' | 'desc': Sort direction
  - `cursor` string: Cursor for pagination (obtained from nextCursor in previous response)
  - `limit` integer: Maximum number of repositories to return per page
  - `search` string: Search term to filter repositories by name or URL (case-insensitive)

## Response `200`

Paginated list of repositories

- object
  - `items` V2RepositoryListItem[], required: Array of repositories in this page
    - `id` string, required: Unique identifier for the repository
    - `projectId` string, required: Project ID this repository belongs to
    - `name` string, required: Name of the repository
    - `monorepoName` string, nullable: Name of the monorepo partition, if this is a monorepo partition
    - `defaultScanTargetBranch` string, nullable: Default branch for scanning
    - `directoryPartitions` string[], required: Directory partition prefixes for monorepo repositories. Empty array indicates a fallback partition that matches all paths not covered by other partitions.
    - `monorepoPartitionRole` 'none' | 'scoped' | 'fallback', required: Role of this repository in a monorepo partition. 'none' for non-partitioned repos, 'scoped' for repos with explicit directory partitions, 'fallback' for the catch-all partition.
    - `isPrScanningEnabled` boolean, nullable: Whether PR scanning is enabled for this repository
    - `isPrScanIssueSummaryEnabled` boolean, nullable: Whether PR scan issue summaries are enabled for this repository
    - `isPrScanCleanSummaryEnabled` boolean, nullable: Whether PR scan clean summaries are enabled for this repository
    - `issueCounts` object: Issue counts by status (included when getCounts=true)
      - `newOpen` integer, required
      - `open` integer, required
      - `patched` integer, required
      - `archived` integer, required
      - `falsePositive` integer, required
      - `patchable` integer, required
      - `closed` integer, required
      - `silenced` integer, required
    - `vcs` union, required: Version control system configuration
      - GithubVcs: GitHub VCS configuration
        - `vcsType` 'github', required
        - `url` string, required: Full URL to the repository
        - `externalGithubRepositoryId` string, required: GitHub repository ID
        - `githubAppInstallationId` string, nullable, required: ZeroPath internal GitHub app installation ID
        - `externalGithubAppInstallationId` string, nullable: GitHub app installation ID
        - `linkActive` boolean, required: Whether the GitHub connection is active
        - `patLink` boolean, required: Whether the repository is linked via personal access token
      - GitlabVcs: GitLab VCS configuration
        - `vcsType` 'gitlab', required
        - `url` string, required: Full URL to the repository
        - `gitlabRepositoryId` string, required: ZeroPath internal GitLab repository ID
        - `gitlabInstallationId` string, nullable: ZeroPath internal GitLab installation ID
        - `externalGitlabProjectId` string, required: GitLab project ID
        - `linkActive` boolean, required: Whether the GitLab connection is active
        - `healthStatus` 'OK' | 'UNAUTHORIZED' | 'NOT_FOUND' | 'ERROR' | 'UNKNOWN', required: Health status of the GitLab connection
        - `lastHealthCheckAt` string, date-time, nullable: Last health check timestamp
        - `installation` object, nullable: GitLab installation details
          - `id` string
          - `url` string
          - `groupName` string, nullable
          - `projectName` string, nullable
        - `installationLabel` string, nullable: Human-readable installation label
      - BitbucketVcs: Bitbucket VCS configuration
        - `vcsType` 'bitbucket', required
        - `url` string, required: Full URL to the repository
        - `externalBitbucketRepositoryId` string, required: Bitbucket repository ID
        - `linkActive` boolean, required: Whether the Bitbucket connection is active
      - AzureDevOpsVcs: Azure DevOps VCS configuration
        - `vcsType` 'azureDevOps', required
        - `url` string, required: Full URL to the repository
        - `externalAzureRepositoryId` string, required: Azure DevOps repository ID
        - `azureDevOpsInstallationId` string, nullable: ZeroPath internal Azure DevOps installation ID
        - `linkActive` boolean, required: Whether the Azure DevOps connection is active
      - GerritVcs: Gerrit VCS configuration. There is no `linkActive` flag because a Gerrit repository always belongs to a live Gerrit connection; project availability is reported through `state` instead.
        - `vcsType` 'gerrit', required
        - `url` string, required: Credential-free HTTPS clone URL, `{baseUrl}/a/{projectName}`
        - `webUrl` string, required: Browsable project page, `{baseUrl}/admin/repos/{projectName}`
        - `gerritRepositoryId` string, required: ZeroPath internal Gerrit repository ID
        - `gerritInstallationId` string, required: ZeroPath internal Gerrit installation ID
        - `projectName` string, required: Gerrit project key, e.g. `platform/apps/checkout`
        - `state` 'ACTIVE' | 'READ_ONLY' | 'HIDDEN', required: Project state on the Gerrit server. READ_ONLY projects are still scannable but reject pushes, so patches cannot be proposed against them.
      - GenericGitVcs: Generic Git VCS configuration
        - `vcsType` 'genericGit', required
        - `url` string, required: Full URL to the repository
        - `externalRepoId` string, required: External repository identifier
      - CvsVcs: CVS configuration. A CVS module is located by its server plus the directory pair (cvsRoot, modulePath) that addresses it; `url` encodes that triple and is not a browsable web address.
        - `vcsType` 'cvs', required
        - `url` string, required: Canonical location, e.g. `cvs+pserver://user@host/srv/cvsroot/payments/api`
        - `cvsRepositoryId` string, required: ZeroPath internal CVS module ID
        - `cvsServerId` string, required: ZeroPath internal CVS server ID
        - `cvsRoot` string, required: Absolute path of the CVS repository root ($CVSROOT)
        - `modulePath` string, required: Module path underneath the CVS root
        - `transport` 'CVS_CHECKOUT' | 'SCP_DIRECTORY', required: How the module is pulled off the server
        - `branchTag` string, nullable, required: CVS branch or tag to check out; null selects trunk
      - UploadedVcs: Configuration for uploaded repositories without VCS connection
        - `vcsType` 'uploaded', required
    - `tags` RepositoryTag[], required: Tags associated with the repository
      - `id` string, required
      - `name` string, required
      - `priority` integer, required
  - `nextCursor` string, nullable, required: Cursor to use for fetching the next page. Null if no more pages exist.
  - `hasMore` boolean, required: Whether there are more repositories available beyond this page
  - `totalCount` integer: Total number of repositories matching the query

---

[API](https://skmtc.dev/zeropath/apis/zeropath-api.md) - [All operations](https://skmtc.dev/zeropath/apis/zeropath-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zeropath/apis/zeropath-api/revisions/126e9c80ba0d?raw)
