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

# Analyze repository

> Starts a new analysis run for a repository by ID.

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



## OpenAPI

````yaml /coding-agent-api/openapi.json post /api/v1/repositories/{id}/analyze
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}/analyze:
    post:
      tags:
        - Repositories
      summary: Analyze repository
      description: >-
        Starts a new analysis run for a repository by ID.


        Required API key scopes: any of `repositories:write`,
        `repositories:all`, `all:write`, `all:all`.
      operationId: analyzeRepository
      parameters:
        - schema:
            minLength: 1
            type: string
          in: path
          name: id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                properties:
                  success:
                    type: boolean
                  message:
                    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

````