---
title: "List Git Repositories"
method: GET
path: "/api/v1/git/repositories"
tags: ["Git Repositories"]
---

# List Git Repositories

`GET /api/v1/git/repositories`

## Request

- Base URL: `https://public-api.linearb.io`
- URL: `https://public-api.linearb.io/api/v1/git/repositories`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/linearb/apis/linearb-api/docs/api/v1/git/repositories/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves Git repositories and their monitoring status. Supports filtering by exact repository name, provider_id, integration_ids, monitoring state and visibility (each list filter takes a single value or a comma-separated list). Results are paginated using page and page_size (maximum 100 items per page). Returns an empty list if no repositories match the specified filters.

## Query parameters

- `page` integer, nullable
- `page_size` integer, nullable
- `name` string, nullable
- `provider_id` string, nullable
- `integration_ids` string, nullable
- `state` string, nullable
- `visibility` string, nullable

## Response `200`

Successful Response

- GitRepositoriesPaginatedResponseModel: Paginated list of Git repositories for an organization. Attributes: total (int): Total number of repositories matching the filters. items (List[GitRepositoryModel]): Repositories on the current page.
  - `total` integer, required
  - `items` GitRepositoryModel[], required
    - `id` integer, required: LinearB repository id
    - `provider_id` string, nullable: Repository id in the provider (GitHub/GitLab/etc.)
    - `name` string, required: Repository name
    - `http_url` string, required: Repository URL
    - `provider` 'bitbucket' | 'gitlab' | 'github' | 'bitbucket_server' | 'azure_devops', nullable: The Git provider: `github`, `gitlab`, `bitbucket`, `bitbucket_server` or `azure_devops`
    - `integration_id` integer, nullable: The Git integration the repository belongs to, as listed by GET /api/v1/integrations
    - `visibility` 'public' | 'private' | 'internal', nullable: Repository visibility on the provider: `public`, `private` or `internal`; null when the provider does not report it
    - `state` 'monitored' | 'not_monitored' | 'failing' | 'discovered', required: Monitoring state of a repository in LinearB, using the customer-facing vocabulary. The internal `repository.state` column stores `active | inactive | failing | discovered`; this enum is the public translation: `active -> monitored`, `inactive -> not_monitored`.
    - `failing_reason` string, nullable: Reason for failure; null unless state is failing
    - `created_at` string, required: When the repository was first registered in LinearB
    - `updated_at` string, required: When the repository record was last updated in LinearB
    - `provider_last_pushed_at` string, nullable: Most recent push timestamp reported by the provider
    - `has_webhook` boolean, required: Whether an active webhook is registered for this repo
    - `is_onprem` boolean, required: True for OPA/on-prem repos, false for cloud
    - `ai_tool_rules` object, nullable: Detected AI tool rule files (e.g. .cursorrules, CLAUDE.md), raw JSONB from the linta scanner

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `405`: Method Not Allowed
- `409`: Conflict
- `422`: Validation Error
- `500`: Internal Server Error
- `504`: Gateway Timeout

---

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