Create penetration test
curl --request POST \
--url https://api.trycomp.ai/v1/security-penetration-tests \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"targetUrl": "https://app.example.com"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({targetUrl: 'https://app.example.com'})
};
fetch('https://api.trycomp.ai/v1/security-penetration-tests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/security-penetration-tests"
payload = { "targetUrl": "https://app.example.com" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Security Penetration Tests
Create penetration test | Comp AI API
Create an AI-powered penetration test run for an approved target and track the resulting findings and report artifacts.
POST
/
v1
/
security-penetration-tests
Create penetration test
curl --request POST \
--url https://api.trycomp.ai/v1/security-penetration-tests \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"targetUrl": "https://app.example.com"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({targetUrl: 'https://app.example.com'})
};
fetch('https://api.trycomp.ai/v1/security-penetration-tests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/security-penetration-tests"
payload = { "targetUrl": "https://app.example.com" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Authorizations
API key for authentication
Headers
Organization ID (required for session auth, optional for API key auth)
Body
application/json
Target URL for the penetration test scan
Example:
"https://app.example.com"
Repository URL containing the target application code
Example:
"https://github.com/org/repo"
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.
Maximum string length:
4000Response
Penetration test created
Was this page helpful?

