curl --request POST \
--url https://api-eu.cybedefend.com/project/{projectId}/autofix/batch \
--header 'Content-Type: application/json' \
--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
}
'import requests
url = "https://api-eu.cybedefend.com/project/{projectId}/autofix/batch"
payload = {
"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
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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
})
};
fetch('https://api-eu.cybedefend.com/project/{projectId}/autofix/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-eu.cybedefend.com/project/{projectId}/autofix/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-eu.cybedefend.com/project/{projectId}/autofix/batch"
payload := strings.NewReader("{\n \"projectId\": \"11111111-2222-3333-4444-555555555555\",\n \"vulnerabilityIds\": [\n \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n \"ffffffff-1111-2222-3333-444444444444\"\n ],\n \"branchName\": \"autofix/batch-2024-01-04\",\n \"contextLines\": 20\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-eu.cybedefend.com/project/{projectId}/autofix/batch")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"11111111-2222-3333-4444-555555555555\",\n \"vulnerabilityIds\": [\n \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n \"ffffffff-1111-2222-3333-444444444444\"\n ],\n \"branchName\": \"autofix/batch-2024-01-04\",\n \"contextLines\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.cybedefend.com/project/{projectId}/autofix/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"11111111-2222-3333-4444-555555555555\",\n \"vulnerabilityIds\": [\n \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n \"ffffffff-1111-2222-3333-444444444444\"\n ],\n \"branchName\": \"autofix/batch-2024-01-04\",\n \"contextLines\": 20\n}"
response = http.request(request)
puts response.read_body{
"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>"
}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
curl --request POST \
--url https://api-eu.cybedefend.com/project/{projectId}/autofix/batch \
--header 'Content-Type: application/json' \
--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
}
'import requests
url = "https://api-eu.cybedefend.com/project/{projectId}/autofix/batch"
payload = {
"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
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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
})
};
fetch('https://api-eu.cybedefend.com/project/{projectId}/autofix/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-eu.cybedefend.com/project/{projectId}/autofix/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-eu.cybedefend.com/project/{projectId}/autofix/batch"
payload := strings.NewReader("{\n \"projectId\": \"11111111-2222-3333-4444-555555555555\",\n \"vulnerabilityIds\": [\n \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n \"ffffffff-1111-2222-3333-444444444444\"\n ],\n \"branchName\": \"autofix/batch-2024-01-04\",\n \"contextLines\": 20\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-eu.cybedefend.com/project/{projectId}/autofix/batch")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"11111111-2222-3333-4444-555555555555\",\n \"vulnerabilityIds\": [\n \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n \"ffffffff-1111-2222-3333-444444444444\"\n ],\n \"branchName\": \"autofix/batch-2024-01-04\",\n \"contextLines\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.cybedefend.com/project/{projectId}/autofix/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"11111111-2222-3333-4444-555555555555\",\n \"vulnerabilityIds\": [\n \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n \"ffffffff-1111-2222-3333-444444444444\"\n ],\n \"branchName\": \"autofix/batch-2024-01-04\",\n \"contextLines\": 20\n}"
response = http.request(request)
puts response.read_body{
"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>"
}Path Parameters
Project unique identifier
Body
Project identifier (UUID)
"11111111-2222-3333-4444-555555555555"
List of vulnerability identifiers (UUIDs) to fix in batch
[
"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"ffffffff-1111-2222-3333-444444444444"
]
Optional custom branch name for the fix (auto-generated if not provided)
"autofix/batch-2024-01-04"
Number of context lines to include above/below each vulnerability (default: 20)
5 <= x <= 10020
Response
Batch AutoFix workflow completed
Overall success indicator
true
Overall status (ok|partial|error)
"ok"
Human readable message
"Batch AutoFix completed: 3 fixed, 1 skipped, 0 errors"
Individual results for each vulnerability
Show child attributes
Show child attributes
Total number of vulnerabilities processed
4
Number of vulnerabilities successfully fixed
3
Number of vulnerabilities skipped
1
Number of vulnerabilities that failed to fix
0
Pull / Merge Request URL if created
"https://github.com/org/repo/pull/123"
Machine readable reason when status=error
""
Git branch name created for the fixes
"cybedefend/batch-autofix-a1b2c3d4e5f6"
Commit message used
"fix(security): batch fix for 3 vulnerabilities"
PR/MR title
"fix(security): batch remediation of 3 vulnerabilities"
PR/MR body content