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

# Start Batch AutoFix workflow

> Initiates an AI-powered AutoFix workflow to automatically generate fixes for multiple vulnerabilities and create a single Pull Request or Merge Request



## OpenAPI

````yaml post /project/{projectId}/autofix/batch
openapi: 3.0.0
info:
  title: Cybedefend API
  description: >-
    CybeDefend is an advanced API for application security analysis. Key
    features include OAuth 2.0 authentication, user/organization/project
    management, and REBAC-based permissions. It excels in static, dynamic, and
    IaC security analyses (SAST, DAST, IaC, etc.).
  version: '1.0'
  contact: {}
servers:
  - url: https://api-eu.cybedefend.com
    description: EU
  - url: https://api-us.cybedefend.com
    description: US
security: []
tags: []
paths:
  /project/{projectId}/autofix/batch:
    post:
      tags:
        - AI Agent
      summary: Start Batch AutoFix workflow
      description: >-
        Initiates an AI-powered AutoFix workflow to automatically generate fixes
        for multiple vulnerabilities and create a single Pull Request or Merge
        Request
      operationId: AgentController_startBatchAutofix
      parameters:
        - name: projectId
          required: true
          in: path
          description: Project unique identifier
          schema:
            format: uuid
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartBatchAutofixBodyDto'
      responses:
        '200':
          description: Batch AutoFix workflow completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StartBatchAutofixResponseDto'
        '400':
          description: Bad Request - Invalid input data
          content:
            application/json:
              schema:
                example:
                  message: Bad Request
                  statusCode: 400
                  timestamp: '2025-02-18T12:31:18.491Z'
                  path: /example/path
        '401':
          description: Unauthorized - Invalid or missing authentication token
          content:
            application/json:
              schema:
                example:
                  message: Unauthorized
                  statusCode: 401
                  timestamp: '2025-02-18T12:31:18.491Z'
                  path: /example/path
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                example:
                  message: Forbidden
                  statusCode: 403
                  timestamp: '2025-02-18T12:31:18.491Z'
                  path: /example/path
components:
  schemas:
    StartBatchAutofixBodyDto:
      type: object
      properties:
        projectId:
          type: string
          description: Project identifier (UUID)
          example: 11111111-2222-3333-4444-555555555555
        vulnerabilityIds:
          description: List of vulnerability identifiers (UUIDs) to fix in batch
          example:
            - aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
            - ffffffff-1111-2222-3333-444444444444
          type: array
          items:
            type: string
        branchName:
          type: string
          description: >-
            Optional custom branch name for the fix (auto-generated if not
            provided)
          example: autofix/batch-2024-01-04
        contextLines:
          type: number
          description: >-
            Number of context lines to include above/below each vulnerability
            (default: 20)
          example: 20
          minimum: 5
          maximum: 100
      required:
        - projectId
        - vulnerabilityIds
    StartBatchAutofixResponseDto:
      type: object
      properties:
        success:
          type: boolean
          description: Overall success indicator
          example: true
        status:
          type: string
          description: Overall status (ok|partial|error)
          example: ok
        prUrl:
          type: string
          description: Pull / Merge Request URL if created
          example: https://github.com/org/repo/pull/123
        reason:
          type: string
          description: Machine readable reason when status=error
          example: ''
        message:
          type: string
          description: Human readable message
          example: 'Batch AutoFix completed: 3 fixed, 1 skipped, 0 errors'
        branch:
          type: string
          description: Git branch name created for the fixes
          example: cybedefend/batch-autofix-a1b2c3d4e5f6
        commitMessage:
          type: string
          description: Commit message used
          example: 'fix(security): batch fix for 3 vulnerabilities'
        prTitle:
          type: string
          description: PR/MR title
          example: 'fix(security): batch remediation of 3 vulnerabilities'
        prBody:
          type: string
          description: PR/MR body content
        vulnerabilityResults:
          description: Individual results for each vulnerability
          type: array
          items:
            $ref: '#/components/schemas/VulnerabilityFixResultDto'
        totalVulnerabilities:
          type: number
          description: Total number of vulnerabilities processed
          example: 4
        fixedCount:
          type: number
          description: Number of vulnerabilities successfully fixed
          example: 3
        skippedCount:
          type: number
          description: Number of vulnerabilities skipped
          example: 1
        errorCount:
          type: number
          description: Number of vulnerabilities that failed to fix
          example: 0
      required:
        - success
        - status
        - message
        - vulnerabilityResults
        - totalVulnerabilities
        - fixedCount
        - skippedCount
        - errorCount
    VulnerabilityFixResultDto:
      type: object
      properties:
        vulnerabilityId:
          type: string
          description: Vulnerability identifier
          example: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
        success:
          type: boolean
          description: Whether the fix was successful
          example: true
        status:
          type: string
          description: Status of the fix (ok|skipped|error)
          example: ok
        reason:
          type: string
          description: Reason code if skipped or error
          example: ''
        message:
          type: string
          description: Human readable message
          example: Fix generated successfully
        filePath:
          type: string
          description: File path where the vulnerability was found
          example: src/utils/security.ts
        startLine:
          type: number
          description: Start line of the vulnerability
          example: 42
        endLine:
          type: number
          description: End line of the vulnerability
          example: 45
      required:
        - vulnerabilityId
        - success
        - status
        - message

````