> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/security-testing-agent-apis/security-testing-orchestration/repositories.md).

# Repositories

Read APIs for the Repositories page.

## List code repositories

> List repositories for a project.

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"Repositories","description":"Read APIs for the Repositories page."}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"jwt_header_Authorization":["sto_testtarget_view"]}],"components":{"securitySchemes":{"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"RepositoriesListRepositoriesResponseBody":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"results":{"type":"array","items":{"$ref":"#/components/schemas/Repository"}}},"required":["results","pagination"]},"Pagination":{"type":"object","properties":{"link":{"type":"string","description":"Link-based paging"},"page":{"type":"integer","description":"Page number (starting from 0)","format":"int64"},"pageSize":{"type":"integer","description":"Requested page size","format":"int64"},"totalItems":{"type":"integer","description":"Total results available","format":"int64"},"totalPages":{"type":"integer","description":"Total pages available","format":"int64"}},"required":["page","pageSize","totalPages","totalItems"]},"Repository":{"type":"object","properties":{"executionId":{"type":"string","description":"CI execution identifier. With pipelineId and the request org/project, FE can construct a Harness execution URL when executionUrl is empty.","maxLength":128},"executionSource":{"type":"string","description":"CI/CD platform of the last execution (harness, jenkins, github_actions, gitlab_ci, ...). Distinct from artifact/repo registry source. Omitted when unknown.","maxLength":256},"executionUrl":{"type":"string","description":"Deep link from scan metadata (non-Harness). For Harness, often empty; FE constructs from pipelineId, executionId, and the request org/project.","maxLength":1024},"id":{"type":"string","description":"Target id"},"isBaseline":{"type":"boolean","description":"Whether this variant is the baseline"},"isCommit":{"type":"boolean","description":"True when the displayed branch name is a git commit, not a branch","default":false},"issueSeverityCounts":{"$ref":"#/components/schemas/RepositorySeverityCounts"},"lastScanAt":{"type":"integer","description":"Last scan time in milliseconds since Unix epoch","format":"int64"},"name":{"type":"string","description":"Repository name"},"occurrenceSeverityCounts":{"$ref":"#/components/schemas/RepositorySeverityCounts"},"pipelineId":{"type":"string","description":"Harness pipeline identifier (not the pretty pipelineName). Used with executionId to construct a Harness execution URL when executionUrl is empty.","maxLength":128},"scanType":{"type":"object","description":"Scan types mapped to scanner ids and display names","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/ScanTypeScanner"}}},"source":{"type":"string","description":"Repository source","maxLength":256},"targetName":{"type":"string","description":"Variant name"},"targetVariantId":{"type":"string","description":"Target variant id"},"url":{"type":"string","description":"Repository URL","maxLength":1024}},"description":"A repository.","required":["id","name","scanType","occurrenceSeverityCounts","issueSeverityCounts"]},"RepositorySeverityCounts":{"type":"object","properties":{"critical":{"type":"integer","description":"Critical count","format":"int64","minimum":0},"high":{"type":"integer","description":"High count","format":"int64","minimum":0},"info":{"type":"integer","description":"Info count","format":"int64","minimum":0},"low":{"type":"integer","description":"Low count","format":"int64","minimum":0},"medium":{"type":"integer","description":"Medium count","format":"int64","minimum":0},"unassigned":{"type":"integer","description":"Unassigned count","format":"int64","minimum":0}},"description":"Counts by severity.","required":["critical","high","medium","low","info","unassigned"]},"ScanTypeScanner":{"type":"object","properties":{"id":{"type":"string","description":"Scanner product name used as the filter id"},"prettyName":{"type":"string","description":"Scanner display name (product.prettyName, falling back to product name)"}},"required":["id","prettyName"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/repositories":{"get":{"description":"List repositories for a project.","operationId":"Repositories#ListRepositories","parameters":[{"allowEmptyValue":true,"description":"Harness Account ID","in":"query","name":"accountId","required":true,"schema":{"description":"Harness Account ID","pattern":"^[a-zA-Z0-9_-]{22}$","type":"string"}},{"allowEmptyValue":true,"description":"Harness Organization ID","in":"query","name":"orgId","required":true,"schema":{"description":"Harness Organization ID","maxLength":128,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$","type":"string"}},{"allowEmptyValue":true,"description":"Harness Project ID","in":"query","name":"projectId","required":true,"schema":{"description":"Harness Project ID","maxLength":128,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$","type":"string"}},{"allowEmptyValue":true,"description":"Page number to fetch (starting from 0)","in":"query","name":"page","schema":{"default":0,"description":"Page number to fetch (starting from 0)","format":"int64","minimum":0,"type":"integer"}},{"allowEmptyValue":true,"description":"Number of results per page","in":"query","name":"pageSize","schema":{"default":30,"description":"Number of results per page","format":"int64","maximum":100,"minimum":1,"type":"integer"}},{"allowEmptyValue":true,"description":"Sort field","in":"query","name":"sort","schema":{"default":"lastScanAt","description":"Sort field","enum":["severity","lastScanAt"],"type":"string"}},{"allowEmptyValue":true,"description":"Sort direction","in":"query","name":"order","schema":{"default":"DESC","description":"Sort direction","enum":["ASC","DESC"],"type":"string"}},{"allowEmptyValue":true,"description":"Case-insensitive name substring","in":"query","name":"search","schema":{"description":"Case-insensitive name substring","maxLength":256,"type":"string"}},{"allowEmptyValue":true,"description":"Comma-separated target types. Empty means repository.","in":"query","name":"types","schema":{"description":"Comma-separated target types. Empty means repository.","maxLength":64,"pattern":"^(repository(,(repository))*)?$","type":"string"}},{"allowEmptyValue":true,"description":"Comma-separated sources. Use Unknown for null/empty source.","in":"query","name":"source","schema":{"description":"Comma-separated sources. Use Unknown for null/empty source.","maxLength":1024,"pattern":"^([^,]+(,[^,]+)*)?$","type":"string"}},{"allowEmptyValue":true,"description":"Comma-separated scan types","in":"query","name":"scanTypes","schema":{"description":"Comma-separated scan types","maxLength":256,"pattern":"^([^,]+(,[^,]+)*)?$","type":"string"}},{"allowEmptyValue":true,"description":"Comma-separated scanner names","in":"query","name":"scanners","schema":{"description":"Comma-separated scanner names","maxLength":512,"pattern":"^([^,]+(,[^,]+)*)?$","type":"string"}},{"allowEmptyValue":true,"description":"Comma-separated severities with a non-zero occurrence count","in":"query","name":"severity","schema":{"description":"Comma-separated severities with a non-zero occurrence count","pattern":"^((critical|high|medium|low|info|unassigned)(,(critical|high|medium|low|info|unassigned))*)?$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepositoriesListRepositoriesResponseBody"}}},"description":"OK response."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"BadRequest: Bad Request response."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"Unauthorized: Unauthorized response."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"Forbidden: Forbidden response."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"NotFound: Not Found response."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"TooManyRequests: Too Many Requests response."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"InternalServerError: Internal Server Error response."}},"summary":"List code repositories","tags":["Repositories"]}}}}
```

## List a repository's scanned variants

> List scanned variants for a repository, newest first. Optional search matches variant name or exact variant id.

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"Repositories","description":"Read APIs for the Repositories page."}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"jwt_header_Authorization":["sto_testtarget_view"]}],"components":{"securitySchemes":{"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"ArtifactsListArtifactVariantsResponseBody":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"results":{"type":"array","items":{"$ref":"#/components/schemas/TargetVariant"}}},"required":["results","pagination"]},"Pagination":{"type":"object","properties":{"link":{"type":"string","description":"Link-based paging"},"page":{"type":"integer","description":"Page number (starting from 0)","format":"int64"},"pageSize":{"type":"integer","description":"Requested page size","format":"int64"},"totalItems":{"type":"integer","description":"Total results available","format":"int64"},"totalPages":{"type":"integer","description":"Total pages available","format":"int64"}},"required":["page","pageSize","totalPages","totalItems"]},"TargetVariant":{"type":"object","properties":{"created":{"type":"integer","description":"Unix timestamp at which the resource was created","format":"int64"},"hash":{"type":"string","description":"Git Commit or Container Image hash","maxLength":64},"id":{"type":"string","description":"Resource identifier","pattern":"^[a-zA-Z0-9_-]{22}$"},"isVirtualBaseline":{"type":"boolean","description":"True for the virtual baseline lane entry (one per target, collects every baseline scan across tags). For the lane, parameters.variant holds the current physical tag. Absent/false for real tags and branches."},"lastModified":{"type":"integer","description":"Unix timestamp at which the resource was most recently modified","format":"int64"},"parameters":{"type":"object","description":"Parameters for this Variant, as a JSON-encoded string","additionalProperties":{"type":"string"}},"targetId":{"type":"string","description":"Associated Target ID","pattern":"^[a-zA-Z0-9_-]{22}$"}},"description":"Information about a Scan Target Variant","required":["targetId","parameters","id","created","lastModified"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/repositories/{targetId}/variants":{"get":{"description":"List scanned variants for a repository, newest first. Optional search matches variant name or exact variant id.","operationId":"Repositories#ListRepositoryVariants","parameters":[{"allowEmptyValue":true,"description":"Harness Account ID","in":"query","name":"accountId","required":true,"schema":{"description":"Harness Account ID","pattern":"^[a-zA-Z0-9_-]{22}$","type":"string"}},{"allowEmptyValue":true,"description":"Harness Organization ID","in":"query","name":"orgId","required":true,"schema":{"description":"Harness Organization ID","maxLength":128,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$","type":"string"}},{"allowEmptyValue":true,"description":"Harness Project ID","in":"query","name":"projectId","required":true,"schema":{"description":"Harness Project ID","maxLength":128,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$","type":"string"}},{"description":"Associated Target ID","in":"path","name":"targetId","required":true,"schema":{"description":"Associated Target ID","pattern":"^[a-zA-Z0-9_-]{22}$","type":"string"}},{"allowEmptyValue":true,"description":"Case-insensitive variant name substring, or exact variant id","in":"query","name":"search","schema":{"description":"Case-insensitive variant name substring, or exact variant id","maxLength":256,"type":"string"}},{"allowEmptyValue":true,"description":"Page number to fetch (starting from 0)","in":"query","name":"page","schema":{"default":0,"description":"Page number to fetch (starting from 0)","format":"int64","minimum":0,"type":"integer"}},{"allowEmptyValue":true,"description":"Results per page","in":"query","name":"pageSize","schema":{"default":10,"description":"Results per page","format":"int64","maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactsListArtifactVariantsResponseBody"}}},"description":"OK response."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"BadRequest: Bad Request response."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"Unauthorized: Unauthorized response."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"Forbidden: Forbidden response."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"NotFound: Not Found response."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"TooManyRequests: Too Many Requests response."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"InternalServerError: Internal Server Error response."}},"summary":"List a repository's scanned variants","tags":["Repositories"]}}}}
```

## Get repositories overview

> Aggregate widgets for the Repositories page.

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"Repositories","description":"Read APIs for the Repositories page."}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"jwt_header_Authorization":["sto_testtarget_view"]}],"components":{"securitySchemes":{"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"RepositoriesRepositoriesOverviewResponseBody":{"$ref":"#/components/schemas/RepositoriesOverviewResult"},"RepositoriesOverviewResult":{"type":"object","properties":{"baselineSet":{"type":"integer","description":"Repositories with a baseline set","format":"int64","minimum":0},"issueRemediations":{"type":"integer","description":"Change in remediated issues since UTC midnight","format":"int64"},"issueSeverityDeltas":{"$ref":"#/components/schemas/RepositorySeverityDeltas"},"issueSeverityTotals":{"$ref":"#/components/schemas/RepositorySeverityCounts"},"occurrenceRemediations":{"type":"integer","description":"Change in remediated occurrences since UTC midnight","format":"int64"},"occurrenceSeverityDeltas":{"$ref":"#/components/schemas/RepositorySeverityDeltas"},"occurrenceSeverityTotals":{"$ref":"#/components/schemas/RepositorySeverityCounts"},"sourceBreakdown":{"type":"array","items":{"$ref":"#/components/schemas/ArtifactSourceBreakdownItem"},"description":"Repository counts grouped by source. Null/empty source is grouped as Unknown."},"totalRepositories":{"type":"integer","description":"Total repositories","format":"int64","minimum":0}},"description":"Aggregate widgets for the Repositories page.","required":["totalRepositories","sourceBreakdown","baselineSet","occurrenceSeverityTotals","issueSeverityTotals"]},"RepositorySeverityDeltas":{"type":"object","properties":{"critical":{"type":"integer","description":"Change in critical count","format":"int64"},"high":{"type":"integer","description":"Change in high count","format":"int64"},"info":{"type":"integer","description":"Change in info count","format":"int64"},"low":{"type":"integer","description":"Change in low count","format":"int64"},"medium":{"type":"integer","description":"Change in medium count","format":"int64"},"unassigned":{"type":"integer","description":"Change in unassigned count","format":"int64"}},"description":"Change in counts by severity since UTC midnight. May be negative. Null when no snapshot exists for today.","required":["critical","high","medium","low","info","unassigned"]},"RepositorySeverityCounts":{"type":"object","properties":{"critical":{"type":"integer","description":"Critical count","format":"int64","minimum":0},"high":{"type":"integer","description":"High count","format":"int64","minimum":0},"info":{"type":"integer","description":"Info count","format":"int64","minimum":0},"low":{"type":"integer","description":"Low count","format":"int64","minimum":0},"medium":{"type":"integer","description":"Medium count","format":"int64","minimum":0},"unassigned":{"type":"integer","description":"Unassigned count","format":"int64","minimum":0}},"description":"Counts by severity.","required":["critical","high","medium","low","info","unassigned"]},"ArtifactSourceBreakdownItem":{"type":"object","properties":{"count":{"type":"integer","description":"Count","format":"int64","minimum":0},"source":{"type":"string","description":"Artifact source. Unknown when artifact_source is null or empty."}},"description":"Count of artifacts for one artifact source.","required":["source","count"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/repositories/overview":{"get":{"description":"Aggregate widgets for the Repositories page.","operationId":"Repositories#RepositoriesOverview","parameters":[{"allowEmptyValue":true,"description":"Harness Account ID","in":"query","name":"accountId","required":true,"schema":{"description":"Harness Account ID","pattern":"^[a-zA-Z0-9_-]{22}$","type":"string"}},{"allowEmptyValue":true,"description":"Harness Organization ID","in":"query","name":"orgId","required":true,"schema":{"description":"Harness Organization ID","maxLength":128,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$","type":"string"}},{"allowEmptyValue":true,"description":"Harness Project ID","in":"query","name":"projectId","required":true,"schema":{"description":"Harness Project ID","maxLength":128,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepositoriesRepositoriesOverviewResponseBody"}}},"description":"OK response."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"BadRequest: Bad Request response."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"Unauthorized: Unauthorized response."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"Forbidden: Forbidden response."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"NotFound: Not Found response."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"TooManyRequests: Too Many Requests response."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"InternalServerError: Internal Server Error response."}},"summary":"Get repositories overview","tags":["Repositories"]}}}}
```
