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

# Endpoint to list the GitHub repositories the Cantina App has access to for a given account.

> # Access control rules

- A GitHub user of the company, that is, a user that has permission
  to interact with companies GitHub via Cantina.
- Admins can list all companies. Requires `read_all_companies` permissions.



## OpenAPI

````yaml GET /api/v0/companies/{company_id}/github/{account_name}/repositories
openapi: 3.1.0
info:
  title: Cantina Client API
  description: >-
    Endpoints available to client organizations. For an overview and
    authentication, see
    https://docs.cantina.xyz/for-organizations/getting-started/api-access.
  license:
    name: Cantina
    identifier: Cantina
  version: 0.1.0
servers: []
security: []
paths:
  /api/v0/companies/{company_id}/github/{account_name}/repositories:
    get:
      tags:
        - companies
      summary: >-
        Endpoint to list the GitHub repositories the Cantina App has access to
        for a given account.
      description: >-
        # Access control rules


        - A GitHub user of the company, that is, a user that has permission
          to interact with companies GitHub via Cantina.
        - Admins can list all companies. Requires `read_all_companies`
        permissions.
      operationId: github_repositories
      parameters:
        - name: company_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: account_name
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: GitHub repositories
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GithubRepo'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '401':
          description: Access not authorised
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '403':
          description: Access forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '404':
          description: Not found. This can also be due to requester not having permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '500':
          description: Error returning GitHub repositories
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
components:
  schemas:
    GithubRepo:
      type: object
      required:
        - org
        - repo
        - private
        - defaultBranch
      properties:
        org:
          type: string
        repo:
          type: string
        private:
          type: boolean
        defaultBranch:
          type: string
    CantinaError:
      type: object
      description: Error returned by the Cantina API.
      required:
        - type
        - msg
      properties:
        type:
          $ref: '#/components/schemas/ErrorType'
        msg:
          type: string
          description: Error message for the user.
    ErrorType:
      type: string
      description: Type of error.
      enum:
        - email_not_verified
        - auth_invalid
        - auth_expired
        - auth_token_missing
        - auth_id_missing
        - invalid_password
        - disabled_user
        - tc_not_accepted
        - evicted
        - unauthorized
        - bad_request
        - not_found
        - forbidden
        - gone
        - payload_too_large
        - service_unavailable
        - internal_error

````