Price a draft pentest; read it at GET /cost-estimations/{cost_estimation_id}
curl --request POST \
--url https://api.hacktron.ai/v1/pentests/{id}/estimate \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.hacktron.ai/v1/pentests/{id}/estimate"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.hacktron.ai/v1/pentests/{id}/estimate', 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/pentests/{id}/estimate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.hacktron.ai/v1/pentests/{id}/estimate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
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/pentests/{id}/estimate")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hacktron.ai/v1/pentests/{id}/estimate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"scan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"repos": [
{
"include_paths": [
"services/gateway/**"
],
"exclude_paths": [
"**/tests/**",
"vendor/",
"*.md"
],
"source": "connected",
"provider": "github",
"url": "https://github.com/owner/repo",
"branch": "<string>",
"ref_type": "branch",
"archive_id": "<string>",
"github_installation_id": 123
}
],
"target_urls": [
"<string>"
],
"login_targets": [
{
"site": "<string>",
"login_check": "unverified",
"failure_reason": "<string>"
}
],
"custom_context": "<string>",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_estimation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"triage_enabled": true,
"credits_used": 123
}Pentests
Estimate pentest
Price a draft pentest before starting it.
Listen to this pageabout 1 min
POST
/
pentests
/
{id}
/
estimate
Price a draft pentest; read it at GET /cost-estimations/{cost_estimation_id}
curl --request POST \
--url https://api.hacktron.ai/v1/pentests/{id}/estimate \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.hacktron.ai/v1/pentests/{id}/estimate"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.hacktron.ai/v1/pentests/{id}/estimate', 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/pentests/{id}/estimate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.hacktron.ai/v1/pentests/{id}/estimate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
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/pentests/{id}/estimate")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hacktron.ai/v1/pentests/{id}/estimate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"scan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"repos": [
{
"include_paths": [
"services/gateway/**"
],
"exclude_paths": [
"**/tests/**",
"vendor/",
"*.md"
],
"source": "connected",
"provider": "github",
"url": "https://github.com/owner/repo",
"branch": "<string>",
"ref_type": "branch",
"archive_id": "<string>",
"github_installation_id": 123
}
],
"target_urls": [
"<string>"
],
"login_targets": [
{
"site": "<string>",
"login_check": "unverified",
"failure_reason": "<string>"
}
],
"custom_context": "<string>",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost_estimation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"triage_enabled": true,
"credits_used": 123
}Starts a cost estimation for the draft and returns its
When you start the pentest, confirm the estimate’s
cost_estimation_id. Poll Get cost estimation until its status is completed or partial.
Scope required:
write. Role: member or above.total_credits. Add triage_fee_credits if triage_required is true or you opt in to triage.
Estimate again whenever you change the draft.Authorizations
Path Parameters
Response
200 - application/json
Stable pentest id; task_id changes when it starts
Available options:
pending, running, completed, failed, stopped, cancelled, skipped, pending_verification, pending_triage, draft, estimating, estimated Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I