Skip to main content
POST
/
project
/
{projectId}
/
autofix
/
batch
Start Batch AutoFix workflow
curl --request POST \
  --url https://api-eu.cybedefend.com/project/{projectId}/autofix/batch \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "projectId": "11111111-2222-3333-4444-555555555555",
  "vulnerabilityIds": [
    "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
    "ffffffff-1111-2222-3333-444444444444"
  ],
  "branchName": "autofix/batch-2024-01-04",
  "contextLines": 20
}
'
{
  "success": true,
  "status": "ok",
  "message": "Batch AutoFix completed: 3 fixed, 1 skipped, 0 errors",
  "vulnerabilityResults": [
    {
      "vulnerabilityId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "success": true,
      "status": "ok",
      "message": "Fix generated successfully",
      "reason": "",
      "filePath": "src/utils/security.ts",
      "startLine": 42,
      "endLine": 45
    }
  ],
  "totalVulnerabilities": 4,
  "fixedCount": 3,
  "skippedCount": 1,
  "errorCount": 0,
  "prUrl": "https://github.com/org/repo/pull/123",
  "reason": "",
  "branch": "cybedefend/batch-autofix-a1b2c3d4e5f6",
  "commitMessage": "fix(security): batch fix for 3 vulnerabilities",
  "prTitle": "fix(security): batch remediation of 3 vulnerabilities",
  "prBody": "<string>"
}

Authorizations

x-api-key
string
header
required

API Key for authentication. You can generate an API key from your personal settings.

Path Parameters

projectId
string<uuid>
required

Project unique identifier

Body

application/json
projectId
string
required

Project identifier (UUID)

Example:

"11111111-2222-3333-4444-555555555555"

vulnerabilityIds
string[]
required

List of vulnerability identifiers (UUIDs) to fix in batch

Example:
[
"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"ffffffff-1111-2222-3333-444444444444"
]
branchName
string

Optional custom branch name for the fix (auto-generated if not provided)

Example:

"autofix/batch-2024-01-04"

contextLines
number

Number of context lines to include above/below each vulnerability (default: 20)

Required range: 5 <= x <= 100
Example:

20

Response

Batch AutoFix workflow completed

success
boolean
required

Overall success indicator

Example:

true

status
string
required

Overall status (ok|partial|error)

Example:

"ok"

message
string
required

Human readable message

Example:

"Batch AutoFix completed: 3 fixed, 1 skipped, 0 errors"

vulnerabilityResults
object[]
required

Individual results for each vulnerability

totalVulnerabilities
number
required

Total number of vulnerabilities processed

Example:

4

fixedCount
number
required

Number of vulnerabilities successfully fixed

Example:

3

skippedCount
number
required

Number of vulnerabilities skipped

Example:

1

errorCount
number
required

Number of vulnerabilities that failed to fix

Example:

0

prUrl
string

Pull / Merge Request URL if created

Example:

"https://github.com/org/repo/pull/123"

reason
string

Machine readable reason when status=error

Example:

""

branch
string

Git branch name created for the fixes

Example:

"cybedefend/batch-autofix-a1b2c3d4e5f6"

commitMessage
string

Commit message used

Example:

"fix(security): batch fix for 3 vulnerabilities"

prTitle
string

PR/MR title

Example:

"fix(security): batch remediation of 3 vulnerabilities"

prBody
string

PR/MR body content