Skip to main content
POST
Create a draft pentest of repositories or uploaded archives, optionally with live sites
Creates a draft with the code you want to review and any deployed sites you want to test. Creating a draft does not run a pentest or spend credits. You review the estimate before starting it.
Scope required: write. Role: member or above.

Set up and start a pentest

  1. Create the draft with this endpoint, and change it with Update pentest draft.
  2. If the draft has login_targets, run Check pentest logins until each login passes.
  3. Get the credit cost with Estimate pentest.
  4. Start it with Start pentest, or delete it with Discard pentest draft.
Save the scan_id from the response. Use the same ID throughout setup and after the pentest starts, including when calling Get scan.

What to test

  • repos (at least one): connected repositories, public repositories, or archives uploaded with Request archive upload. Set a repository’s include_paths and exclude_paths to review only part of the code.
  • target_urls: deployed sites to test without signing in.
  • login_targets: deployed sites to test signed in. Each has a site and login_instructions: the login page, username, password and any extra steps. Login instructions are stored encrypted and never returned.
A draft can have target_urls or login_targets, but not both. To test sites with and without a login, create separate pentests.
Signed-in testing is enabled per organization. If it isn’t enabled for yours, a request with login_targets returns 400.

Authorizations

X-Api-Key
string
header
required

Body

application/json
repos
object[]
required

Repositories or uploaded archives to test

Minimum array length: 1
target_urls
string[]

Target URLs (pentest only)

custom_context
string

Custom context (pentest only)

application_id
string

iva application this scan targets (group of repos)

login_targets
object[]

Deployed sites to test signed in, each with how to sign in. On update the list replaces the saved one, and [] removes them. A pentest tests live sites either all signed in or all without a login (target_urls). Check each login with POST /pentests/{id}/login-checks before starting.

Maximum array length: 10

Response

201 - application/json
scan_id
string<uuid>
required

Stable pentest id; task_id changes when it starts

status
enum<string>
required
Available options:
pending,
running,
completed,
failed,
stopped,
cancelled,
skipped,
pending_verification,
pending_triage,
draft,
estimating,
estimated
repos
object[]
required
target_urls
string[]
required
login_targets
object[]
required
custom_context
string | null
required
application_id
string<uuid> | null
required
cost_estimation_id
string<uuid> | null
required
triage_enabled
boolean | null
required
credits_used
number | null
required