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

# Get repository analysis

> Returns the latest analysis for a repository by ID.

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/{id}/analysis
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/{id}/analysis:
    get:
      tags:
        - Repositories
      summary: Get repository analysis
      description: >-
        Returns the latest analysis for a repository by ID.


        Required API key scopes: any of `repositories:read`, `repositories:all`,
        `all:read`, `all:all`.
      operationId: getRepositoryAnalysis
      parameters:
        - schema:
            minLength: 1
            type: string
          in: path
          name: id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - metadata
                  - components
                properties:
                  metadata:
                    anyOf:
                      - type: object
                        required:
                          - id
                          - created_at
                          - updated_at
                          - repository_id
                          - workspace_id
                          - analyzed_commit_sha
                          - primary_languages
                          - languages
                          - primary_frameworks
                          - frameworks
                          - primary_libraries
                          - libraries
                          - primary_databases
                          - databases
                        properties:
                          id:
                            type: string
                          created_at:
                            format: date-time
                            type: string
                          updated_at:
                            format: date-time
                            type: string
                          repository_id:
                            type: string
                          workspace_id:
                            type: string
                          analyzed_commit_sha:
                            type: string
                          primary_languages:
                            type: array
                            items:
                              type: string
                          languages:
                            type: array
                            items:
                              type: string
                          primary_frameworks:
                            type: array
                            items:
                              type: string
                          frameworks:
                            type: array
                            items:
                              type: string
                          primary_libraries:
                            type: array
                            items:
                              type: string
                          libraries:
                            type: array
                            items:
                              type: string
                          primary_databases:
                            type: array
                            items:
                              type: string
                          databases:
                            type: array
                            items:
                              type: string
                      - type: 'null'
                  components:
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - created_at
                        - updated_at
                        - repository_id
                        - workspace_id
                        - path
                        - summary
                        - primary_language
                        - languages
                        - primary_framework
                        - frameworks
                        - primary_library
                        - libraries
                        - primary_database
                        - databases
                        - primary_folders
                        - primary_files
                        - analyzed_commit_sha
                      properties:
                        id:
                          type: string
                        created_at:
                          format: date-time
                          type: string
                        updated_at:
                          format: date-time
                          type: string
                        repository_id:
                          type: string
                        workspace_id:
                          type: string
                        path:
                          type: string
                        summary:
                          type: string
                        primary_language:
                          anyOf:
                            - type: string
                            - type: 'null'
                        languages:
                          type: array
                          items:
                            type: string
                        primary_framework:
                          anyOf:
                            - type: string
                            - type: 'null'
                        frameworks:
                          type: array
                          items:
                            type: string
                        primary_library:
                          anyOf:
                            - type: string
                            - type: 'null'
                        libraries:
                          type: array
                          items:
                            type: string
                        primary_database:
                          anyOf:
                            - type: string
                            - type: 'null'
                        databases:
                          type: array
                          items:
                            type: string
                        primary_folders:
                          type: array
                          items:
                            type: string
                        primary_files:
                          type: array
                          items:
                            type: string
                        analyzed_commit_sha:
                          type: string
        '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:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````