---
title: "Create penetration test"
method: POST
path: "/v1/security-penetration-tests"
tags: ["Security Penetration Tests"]
---

# Create penetration test

`POST /v1/security-penetration-tests`

Create an AI-powered penetration test run for an approved target and track the resulting findings and report artifacts.

## Headers

- `X-Organization-Id` string

## Request body

- CreatePenetrationTestDto
  - `targetUrl` string, required — Target URL for the penetration test scan
  - `repoUrl` string — Repository URL containing the target application code
  - `additionalContext` string — Free-text context shared with the testing agent, e.g. remediation notes or accepted-by-design explanations from a previous run. Saved per-finding context notes for the same target are appended automatically. Max 4000 characters.

## Response `201`

Penetration test created

## Other responses

- `400` — Invalid request payload

## Changes

> 56 revisions in range; 4 could not be searched.

- **2026-06-11** `a87e7c0c5c25` — 1 info
  - added the new optional request property `additionalContext`
- **2026-06-04** `d7d0199d846f` — 1 info
  - the endpoint scheme security `oauth2` was removed from the API
- **2026-05-29** `5382c53ab431` — 1 info
  - the endpoint scheme security `oauth2` was added to the API
- **2026-05-10** `912fecc0177c` — 6 warning
  - removed the request property `checks`
  - removed the request property `evidenceLevel`
  - removed the request property `pipelineTesting`
  - removed the request property `scanDepth`
  - …2 more
- **2026-05-01** `565998310724` — 3 info
  - added the new optional request property `checks`
  - added the new optional request property `evidenceLevel`
  - added the new optional request property `scanDepth`

[Full history](https://skmtc.dev/trycompai/apis/comp-ai-api/changes/v1/security-penetration-tests/post.md)

---

[API](https://skmtc.dev/trycompai/apis/comp-ai-api.md) · [All operations](https://skmtc.dev/trycompai/apis/comp-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/trycompai/comp-ai-api/revisions/726b9523fb22/schema)
