> ## 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 AutoFix workflow

> Initiates an AI-powered AutoFix workflow to automatically generate a fix for a vulnerability and create a Pull Request or Merge Request



## OpenAPI

````yaml post /project/{projectId}/autofix
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:
    post:
      tags:
        - AI Agent
      summary: Start AutoFix workflow
      description: >-
        Initiates an AI-powered AutoFix workflow to automatically generate a fix
        for a vulnerability and create a Pull Request or Merge Request
      operationId: AgentController_startAutofix
      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/StartAutofixBodyDto'
      responses:
        '200':
          description: AutoFix workflow started successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StartAutofixResponseDto'
        '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:
    StartAutofixBodyDto:
      type: object
      properties:
        projectId:
          type: string
          description: Project identifier (UUID)
          example: 11111111-2222-3333-4444-555555555555
        vulnerabilityId:
          type: string
          description: Vulnerability identifier (UUID)
          example: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
      required:
        - projectId
        - vulnerabilityId
    StartAutofixResponseDto:
      type: object
      properties:
        status:
          type: string
          description: Status indicator (ok|error)
          example: ok
        prUrl:
          type: string
          description: Pull / Merge Request URL if success
          example: https://github.com/org/repo/pull/123
        reason:
          type: string
          description: Machine readable reason when status=error
          example: DIFF_UNAPPLICABLE
        message:
          type: string
          description: Human readable message
          example: AutoFix PR created successfully
      required:
        - status
        - prUrl
        - message

````