Start a scan
curl --request POST \
--url https://api-eu.cybedefend.com/project/{projectId}/scan/start \
--header 'Content-Type: application/json' \
--data '
{
"branch": "main",
"sourceType": "manual"
}
'import requests
url = "https://api-eu.cybedefend.com/project/{projectId}/scan/start"
payload = {
"branch": "main",
"sourceType": "manual"
}
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({branch: 'main', sourceType: 'manual'})
};
fetch('https://api-eu.cybedefend.com/project/{projectId}/scan/start', 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}/scan/start",
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([
'branch' => 'main',
'sourceType' => 'manual'
]),
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}/scan/start"
payload := strings.NewReader("{\n \"branch\": \"main\",\n \"sourceType\": \"manual\"\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}/scan/start")
.header("Content-Type", "application/json")
.body("{\n \"branch\": \"main\",\n \"sourceType\": \"manual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.cybedefend.com/project/{projectId}/scan/start")
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 \"branch\": \"main\",\n \"sourceType\": \"manual\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"scanId": "<string>",
"detectedLanguages": [
"<string>"
]
}{
"timestamp": "2025-02-18T12:31:18.491Z",
"service": "AiService",
"method": "startConversation",
"message": "Invalid parameters provided",
"code": 400
}Scanning
Start a scan
Initiates a security scan for a project. Returns a signed URL to upload the source code. The scan will analyze the code for SAST, IaC, and SCA vulnerabilities based on project configuration.
POST
/
project
/
{projectId}
/
scan
/
start
Start a scan
curl --request POST \
--url https://api-eu.cybedefend.com/project/{projectId}/scan/start \
--header 'Content-Type: application/json' \
--data '
{
"branch": "main",
"sourceType": "manual"
}
'import requests
url = "https://api-eu.cybedefend.com/project/{projectId}/scan/start"
payload = {
"branch": "main",
"sourceType": "manual"
}
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({branch: 'main', sourceType: 'manual'})
};
fetch('https://api-eu.cybedefend.com/project/{projectId}/scan/start', 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}/scan/start",
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([
'branch' => 'main',
'sourceType' => 'manual'
]),
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}/scan/start"
payload := strings.NewReader("{\n \"branch\": \"main\",\n \"sourceType\": \"manual\"\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}/scan/start")
.header("Content-Type", "application/json")
.body("{\n \"branch\": \"main\",\n \"sourceType\": \"manual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.cybedefend.com/project/{projectId}/scan/start")
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 \"branch\": \"main\",\n \"sourceType\": \"manual\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"scanId": "<string>",
"detectedLanguages": [
"<string>"
]
}{
"timestamp": "2025-02-18T12:31:18.491Z",
"service": "AiService",
"method": "startConversation",
"message": "Invalid parameters provided",
"code": 400
}Path Parameters
The unique identifier of the project to scan
Example:
"550e8400-e29b-41d4-a716-446655440000"
Body
application/json
Branch name being scanned (for GitHub/GitLab integrations). If not provided, scan is not associated with a specific branch.
Example:
"main"
Source type of the scan (manual, cli, github, gitlab, jetbrains, vscode). Defaults to manual if not provided.
Available options:
manual, cli, github, gitlab, jetbrains, vscode Example:
"manual"
Response
Scan initiated successfully - returns signed URL for upload