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

# List repositories

> Returns a collection of repositories.

Required API key scopes: any of `repositories:read`, `repositories:all`, `all:read`, `all:all`.



## OpenAPI

````yaml /coding-agent-api/openapi.json get /api/v1/repositories
openapi: 3.1.0
info:
  title: Agen Coding Agent API
  version: 1.0.0
servers:
  - url: https://api.agenhq.com
security: []
paths:
  /api/v1/repositories:
    get:
      tags:
        - Repositories
      summary: List repositories
      description: >-
        Returns a collection of repositories.


        Required API key scopes: any of `repositories:read`, `repositories:all`,
        `all:read`, `all:all`.
      operationId: listRepositories
      responses:
        '200':
          description: A paginated list of repositories connected to a workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepositoriesList'
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - statusCode
                  - code
                  - error
                  - message
                properties:
                  statusCode:
                    type: number
                  code:
                    type: string
                  error:
                    type: string
                  message:
                    type: string
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
      security:
        - apiKey: []
components:
  schemas:
    RepositoriesList:
      type: object
      required:
        - items
        - next_cursor
      properties:
        items:
          type: array
          items:
            type: object
            required:
              - id
              - workspace_id
              - code_provider_id
              - name
              - full_name
              - clone_url
              - default_branch
              - platform
              - external_id
              - enabled
              - webhooks_registered
              - webhook_secret
              - analysis_status
              - analysis_error
              - last_analyzed_at
              - created_at
              - updated_at
            properties:
              id:
                readOnly: true
                description: The unique identifier of the repository inside Agen.
                type: string
              workspace_id:
                readOnly: true
                description: The workspace that owns this repository.
                type: string
              code_provider_id:
                description: >-
                  The connected code provider account used to access this
                  repository.
                type: string
              name:
                description: The repository name without the owner or namespace.
                type: string
              full_name:
                description: >-
                  The full repository name including the owner or namespace, for
                  example `agenhq/agen`.
                type: string
              clone_url:
                description: >-
                  The git clone URL used by Agen to access the repository
                  contents.
                type: string
              default_branch:
                description: >-
                  The default branch of the repository, such as `main` or
                  `master`.
                type: string
              platform:
                description: The code hosting platform where the repository is hosted.
                anyOf:
                  - const: gitlab
                    type: string
                  - const: github
                    type: string
              external_id:
                description: >-
                  The repository identifier used by the external code hosting
                  platform.
                type: string
              enabled:
                default: true
                description: >-
                  Whether Agen can use this repository for sessions and
                  automation.
                type: boolean
              webhooks_registered:
                readOnly: true
                description: >-
                  Whether Agen has successfully registered webhooks for this
                  repository.
                type: boolean
              webhook_secret:
                readOnly: true
                description: >-
                  The webhook signing secret created by Agen for this
                  repository, if available.
                anyOf:
                  - type: string
                  - type: 'null'
              analysis_status:
                readOnly: true
                description: The current status of the repository analysis job.
                anyOf:
                  - const: pending
                    type: string
                  - const: analyzing
                    type: string
                  - const: completed
                    type: string
                  - const: failed
                    type: string
              analysis_error:
                readOnly: true
                description: >-
                  The latest repository analysis error message, if analysis
                  failed.
                anyOf:
                  - type: string
                  - type: 'null'
              last_analyzed_at:
                readOnly: true
                description: >-
                  When the repository was last analyzed by Agen, if analysis has
                  completed at least once.
                anyOf:
                  - format: date-time
                    type: string
                  - type: 'null'
              created_at:
                format: date-time
                readOnly: true
                description: When the repository record was created in Agen.
                type: string
              updated_at:
                format: date-time
                readOnly: true
                description: When the repository record was last updated in Agen.
                type: string
            description: A repository connected to a workspace.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
      description: A paginated list of repositories connected to a workspace.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````