> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kosli.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.kosli.com/feedback

```json
{
  "path": "/api-reference/repos/list-repos",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# List repos

> List repos for an organization.

Repos are paginated.
- The response includes pagination information and the list of repos.
- The list of repos is sorted by the repo name.
- Optional filters: name (exact match), provider (VCS provider), and repo_id (external repo ID).
- repo_id is the stronger identifier as names of repos can change. So if repo_id is provided, name is ignored.

Repos are captured when attestations include a reference to a repo.
This happens automatically when using Kosli CLI v2.11.35 or higher.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json get /repos/{org}
openapi: 3.1.0
info:
  title: Kosli API
  summary: The API for communicating with Kosli
  description: >

    # Authentication 


    When making requests against Kosli API, you can authenticate your requests
    using a bearer token. 

    Set the bearer token in the request Authorization header to a valid API
    key. 

    API Keys can be personal or for service accounts. Check the [service
    accounts
    documentation](https://docs.kosli.com/getting_started/service-accounts/) for
    details. 


    ## Curl example


    ```shell

    curl -H "Authorization: Bearer <<your-api-key>>"
    https://app.kosli.com/api/v2/environments/<<your-org-name>>

    ```
  version: '2.0'
servers:
  - url: https://app.kosli.com/api/v2
    description: EU
  - url: https://app.us.kosli.com/api/v2
    description: US
security:
  - HTTPBearer: []
paths:
  /repos/{org}:
    get:
      tags:
        - Repos
      summary: List repos
      description: >-
        List repos for an organization.


        Repos are paginated.

        - The response includes pagination information and the list of repos.

        - The list of repos is sorted by the repo name.

        - Optional filters: name (exact match), provider (VCS provider), and
        repo_id (external repo ID).

        - repo_id is the stronger identifier as names of repos can change. So if
        repo_id is provided, name is ignored.


        Repos are captured when attestations include a reference to a repo.

        This happens automatically when using Kosli CLI v2.11.35 or higher.
      operationId: list_repos_repos__org__get
      parameters:
        - name: org
          in: path
          required: true
          schema:
            type: string
            title: Org
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Page number
            default: 1
            title: Page
          description: Page number
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            maximum: 50
            minimum: 1
            description: Number of repos per page
            default: 15
            title: Per Page
          description: Number of repos per page
        - name: name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter by repo name (exact match). This is ignored if repo_id is
              provided. Returns empty list if no match.
            title: Name
          description: >-
            Filter by repo name (exact match). This is ignored if repo_id is
            provided. Returns empty list if no match.
        - name: provider
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - github
                  - gitlab
                  - bitbucket
                  - azure-devops
                  - circleci
              - type: 'null'
            description: >-
              Filter by VCS provider (e.g. github, gitlab, bitbucket,
              azure-devops, circleci).
            title: Provider
          description: >-
            Filter by VCS provider (e.g. github, gitlab, bitbucket,
            azure-devops, circleci).
        - name: repo_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter by external repo ID (exact match). Returns empty list if no
              match.
            title: Repo Id
          description: >-
            Filter by external repo ID (exact match). Returns empty list if no
            match.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepoListResponse'
        '404':
          description: Resource Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__36
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    RepoListResponse:
      properties:
        _links:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Links
        page:
          type: integer
          title: Page
        per_page:
          type: integer
          title: Per Page
        total_pages:
          type: integer
          title: Total Pages
        total_count:
          type: integer
          title: Total Count
        repos:
          items:
            $ref: '#/components/schemas/RepoResponse'
          type: array
          title: Repos
      additionalProperties: false
      type: object
      required:
        - page
        - per_page
        - total_pages
        - total_count
        - repos
      title: RepoListResponse
    fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__36:
      properties:
        message:
          type: string
          title: Message
          description: Error message
        errors:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Errors
          description: Validation errors by field
      type: object
      required:
        - message
      title: NotFoundResponseModel
      description: Organization not found
      examples:
        - message: Organization not found
    RepoResponse:
      properties:
        name:
          type: string
          title: Name
        url:
          type: string
          title: Url
        provider:
          anyOf:
            - type: string
              enum:
                - github
                - gitlab
                - bitbucket
                - azure-devops
                - circleci
            - type: 'null'
          title: Provider
        repo_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Repo Id
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        _links:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Links
      type: object
      required:
        - name
        - url
      title: RepoResponse
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````