Trigger a pentest scan
curl --request POST \
--url https://api.hacktron.ai/v1/scans \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"cost_estimation_id": "<string>",
"repos": [
{
"url": "<string>",
"branch": "<string>",
"source": "connected"
}
],
"target_urls": [
"<string>"
],
"auth_instructions": "<string>",
"custom_context": "<string>",
"context_document_ids": [
"<string>"
]
}
'import requests
url = "https://api.hacktron.ai/v1/scans"
payload = {
"cost_estimation_id": "<string>",
"repos": [
{
"url": "<string>",
"branch": "<string>",
"source": "connected"
}
],
"target_urls": ["<string>"],
"auth_instructions": "<string>",
"custom_context": "<string>",
"context_document_ids": ["<string>"]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cost_estimation_id: '<string>',
repos: [{url: '<string>', branch: '<string>', source: 'connected'}],
target_urls: ['<string>'],
auth_instructions: '<string>',
custom_context: '<string>',
context_document_ids: ['<string>']
})
};
fetch('https://api.hacktron.ai/v1/scans', 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.hacktron.ai/v1/scans",
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([
'cost_estimation_id' => '<string>',
'repos' => [
[
'url' => '<string>',
'branch' => '<string>',
'source' => 'connected'
]
],
'target_urls' => [
'<string>'
],
'auth_instructions' => '<string>',
'custom_context' => '<string>',
'context_document_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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.hacktron.ai/v1/scans"
payload := strings.NewReader("{\n \"cost_estimation_id\": \"<string>\",\n \"repos\": [\n {\n \"url\": \"<string>\",\n \"branch\": \"<string>\",\n \"source\": \"connected\"\n }\n ],\n \"target_urls\": [\n \"<string>\"\n ],\n \"auth_instructions\": \"<string>\",\n \"custom_context\": \"<string>\",\n \"context_document_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.hacktron.ai/v1/scans")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cost_estimation_id\": \"<string>\",\n \"repos\": [\n {\n \"url\": \"<string>\",\n \"branch\": \"<string>\",\n \"source\": \"connected\"\n }\n ],\n \"target_urls\": [\n \"<string>\"\n ],\n \"auth_instructions\": \"<string>\",\n \"custom_context\": \"<string>\",\n \"context_document_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hacktron.ai/v1/scans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cost_estimation_id\": \"<string>\",\n \"repos\": [\n {\n \"url\": \"<string>\",\n \"branch\": \"<string>\",\n \"source\": \"connected\"\n }\n ],\n \"target_urls\": [\n \"<string>\"\n ],\n \"auth_instructions\": \"<string>\",\n \"custom_context\": \"<string>\",\n \"context_document_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"task_id": "<string>",
"status": "<string>",
"message": "<string>"
}Scans
Trigger a Whitebox Scan
Start a Whitebox Scan against one or more repositories.
POST
/
scans
Trigger a pentest scan
curl --request POST \
--url https://api.hacktron.ai/v1/scans \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"cost_estimation_id": "<string>",
"repos": [
{
"url": "<string>",
"branch": "<string>",
"source": "connected"
}
],
"target_urls": [
"<string>"
],
"auth_instructions": "<string>",
"custom_context": "<string>",
"context_document_ids": [
"<string>"
]
}
'import requests
url = "https://api.hacktron.ai/v1/scans"
payload = {
"cost_estimation_id": "<string>",
"repos": [
{
"url": "<string>",
"branch": "<string>",
"source": "connected"
}
],
"target_urls": ["<string>"],
"auth_instructions": "<string>",
"custom_context": "<string>",
"context_document_ids": ["<string>"]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cost_estimation_id: '<string>',
repos: [{url: '<string>', branch: '<string>', source: 'connected'}],
target_urls: ['<string>'],
auth_instructions: '<string>',
custom_context: '<string>',
context_document_ids: ['<string>']
})
};
fetch('https://api.hacktron.ai/v1/scans', 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.hacktron.ai/v1/scans",
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([
'cost_estimation_id' => '<string>',
'repos' => [
[
'url' => '<string>',
'branch' => '<string>',
'source' => 'connected'
]
],
'target_urls' => [
'<string>'
],
'auth_instructions' => '<string>',
'custom_context' => '<string>',
'context_document_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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.hacktron.ai/v1/scans"
payload := strings.NewReader("{\n \"cost_estimation_id\": \"<string>\",\n \"repos\": [\n {\n \"url\": \"<string>\",\n \"branch\": \"<string>\",\n \"source\": \"connected\"\n }\n ],\n \"target_urls\": [\n \"<string>\"\n ],\n \"auth_instructions\": \"<string>\",\n \"custom_context\": \"<string>\",\n \"context_document_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.hacktron.ai/v1/scans")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cost_estimation_id\": \"<string>\",\n \"repos\": [\n {\n \"url\": \"<string>\",\n \"branch\": \"<string>\",\n \"source\": \"connected\"\n }\n ],\n \"target_urls\": [\n \"<string>\"\n ],\n \"auth_instructions\": \"<string>\",\n \"custom_context\": \"<string>\",\n \"context_document_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hacktron.ai/v1/scans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cost_estimation_id\": \"<string>\",\n \"repos\": [\n {\n \"url\": \"<string>\",\n \"branch\": \"<string>\",\n \"source\": \"connected\"\n }\n ],\n \"target_urls\": [\n \"<string>\"\n ],\n \"auth_instructions\": \"<string>\",\n \"custom_context\": \"<string>\",\n \"context_document_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"task_id": "<string>",
"status": "<string>",
"message": "<string>"
}Starts a Whitebox Scan against the repositories attached to a completed or
partial cost estimation. Scans run asynchronously; the endpoint returns
immediately with a scan
id for polling.
Scope required:
writePrerequisites
- Create a cost estimation with
POST /cost-estimations. - Wait until the estimation reaches
completedorpartialstatus and has a positivetotal_creditsvalue. - Submit the same repositories and branches that were included in the estimation. Hacktron rejects scans whose repo, archive, or branch does not match the estimate.
- Ensure your organization has enough Whitebox Scan credits. Credits are
visible in Credits and billing in the
dashboard. Insufficient credits return
402 Payment Required.
A cost estimation can only be claimed by one started scan. If you need to
change repositories, archives, or branches, create a new estimate first.
Next steps
- Poll
GET /scans/{id}/statusuntil status iscompleted. - Fetch findings with
GET /scans/{id}/findingsor export them withGET /scans/{id}/findings/export.
Authorizations
Body
application/json
Completed cost estimation UUID
Repositories to scan
Show child attributes
Show child attributes
Target URLs for pentest
Authentication instructions for the target
Maximum string length:
2000Custom context for the pentest
Maximum string length:
2000Context document UUIDs to include
⌘I