> ## 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.

# Get a repo

> Get a repo by name, or unambiguously by its internal `id`.

Returns the repo's details, including its internal `id`, which is required to
tag the repo via the generic tags endpoint (PATCH /tags/{org}/repo/{id}).

If multiple repos share the same name across different VCS providers and
neither `id` nor `provider` is given, returns a 400 listing the providers to
choose from.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json get /repos/{org}/{repo_name}
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}/{repo_name}:
    get:
      tags:
        - Repos
      summary: Get a repo
      description: >-
        Get a repo by name, or unambiguously by its internal `id`.


        Returns the repo's details, including its internal `id`, which is
        required to

        tag the repo via the generic tags endpoint (PATCH
        /tags/{org}/repo/{id}).


        If multiple repos share the same name across different VCS providers and

        neither `id` nor `provider` is given, returns a 400 listing the
        providers to

        choose from.
      operationId: get_repo
      parameters:
        - name: repo_name
          in: path
          required: true
          schema:
            type: string
            title: Repo Name
        - name: org
          in: path
          required: true
          schema:
            type: string
            title: Org
        - name: provider
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - github
                  - gitlab
                  - bitbucket
                  - azure-devops
                  - circleci
              - type: 'null'
            description: >-
              VCS provider (e.g. github, gitlab, bitbucket, azure-devops,
              circleci). Required when multiple repos share the same name across
              providers.
            title: Provider
          description: >-
            VCS provider (e.g. github, gitlab, bitbucket, azure-devops,
            circleci). Required when multiple repos share the same name across
            providers.
        - name: id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              The repo's internal id (returned as `id` in the repo response). If
              given, this unambiguously identifies the repo and 'provider' is
              ignored.
            title: Id
          description: >-
            The repo's internal id (returned as `id` in the repo response). If
            given, this unambiguously identifies the repo and 'provider' is
            ignored.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepoResponse'
        '400':
          description: Ambiguous Repo Name
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__BadRequestResponse___locals___BadRequestResponseModel__5
        '404':
          description: Resource Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__40
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    RepoResponse:
      properties:
        id:
          type: string
          title: Id
        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
        tags:
          additionalProperties:
            type: string
          type: object
          title: Tags
        _links:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Links
      type: object
      required:
        - id
        - name
        - url
      title: RepoResponse
    fastapi_app__errors__BadRequestResponse___locals___BadRequestResponseModel__5:
      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: BadRequestResponseModel
      description: >-
        Multiple repos share this name across providers; specify 'provider' to
        disambiguate
      examples:
        - message: >-
            Multiple repos share this name across providers; specify 'provider'
            to disambiguate
    fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__40:
      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: Repo not found
      examples:
        - message: Repo not found
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````