Trigger a pentest
Starts a pentest of the repositories attached to a completed or partial cost estimation. Pentests run asynchronously: the endpoint returns straight away with a scan id to poll.
Prerequisites
- Create a cost estimation with
POST /cost-estimations. - Wait until the estimation reaches
completedorpartialstatus and has a positivetotal_creditsvalue. - Submit the same repositories, branches, and path scope that the estimation included, and keep each repository’s
include_pathsandexclude_pathsthe same. Hacktron rejects a pentest whose repository, archive, branch, or path scope doesn’t match the estimate. - Make sure your organisation has enough Whitebox credits. The dashboard shows them, as Credits and billing describes. Insufficient credits return
402 Payment Required.
Warning
Only one started pentest can claim a cost estimation. To change repositories, archives, branches, or path scope, create a new estimate first.
Request
POST /scans
Send an API key with the write scope in the X-Api-Key header.
Body
A required application/json body.
| Field | Description |
|---|---|
cost_estimation_idstring, required | Completed cost estimation UUID. |
reposarray of object, required | Repositories to scan. |
repos[].string, required | Repository URL. |
repos[].string, required | Branch name. |
repos[].string | Repository source. One of connected, public, or upload. Default connected. |
target_urlsarray of string | Target URLs for pentest. |
auth_instructionsstring | Target websites and browser login instructions, including URLs and credentials. At most 2000 characters. |
custom_contextstring | Custom context for the pentest. At most 2000 characters. |
context_document_idsarray of string | Context document UUIDs to include. |
Responses
201 Created
| Field | Description |
|---|---|
idstring, required | |
task_idstring, required | |
statusstring, required | |
messagestring, required |
402 Payment Required
Insufficient credits.
Next steps
Poll GET /scans/{id}/status until the status is completed. Then fetch the findings with GET /scans/{id}/findings or export them with GET /scans/{id}/findings/export.