curl --request POST \
--url https://app.trustivan.com/api/v1/dast/targets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://staging.example.com"
}
'import requests
url = "https://app.trustivan.com/api/v1/dast/targets"
payload = { "url": "https://staging.example.com" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://staging.example.com'})
};
fetch('https://app.trustivan.com/api/v1/dast/targets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/dast/targets"
payload := strings.NewReader("{\n \"url\": \"https://staging.example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"target": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"host": "<string>",
"verified": true,
"mode": "active",
"has_auth": true,
"has_openapi": true,
"has_graphql_schema": true,
"has_wsdl_document": true,
"requests_per_second": 25,
"max_duration_minutes": 32,
"verification": {
"dns_record_name": "_trustivan-challenge.staging.example.com",
"dns_record_type": "TXT",
"dns_record_value": "trustivan-verify=0123456789abcdef0123456789abcdef",
"file_url": "https://staging.example.com/.well-known/trustivan-verification.txt",
"file_content": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"verification_method": "dns_txt",
"verified_at": "2023-11-07T05:31:56Z",
"last_checked_at": "2023-11-07T05:31:56Z",
"last_check_error": "<string>",
"first_scan_not_queued": "<string>",
"auth_header_name": "<string>",
"openapi_bytes": 123,
"graphql_endpoint": "/graphql",
"graphql_schema_bytes": 123,
"wsdl_path": "/ws?wsdl",
"wsdl_document_bytes": 123,
"grpc_address": "api.example.com:443",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Add a web application as a scan target
Registers the application as a web_application asset and queues a
first passive check: one unauthenticated page load, read for
missing security headers, cookie flags and similar, and for an https
address two TLS handshakes. Nothing is crawled and no attack request is
sent until ownership is verified.
If that first check could not be queued (the plan’s allowance is used
up, or another dynamic scan is in flight) the target is still added and
first_scan_not_queued says why.
The URL is untrusted input. Only http and https are accepted;
embedded credentials, a query string, and a host that names a private,
loopback or link-local address are refused. What a public name
resolves to is checked again at every connection.
Counts against the plan’s asset limit. Requires assets:write.
curl --request POST \
--url https://app.trustivan.com/api/v1/dast/targets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://staging.example.com"
}
'import requests
url = "https://app.trustivan.com/api/v1/dast/targets"
payload = { "url": "https://staging.example.com" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://staging.example.com'})
};
fetch('https://app.trustivan.com/api/v1/dast/targets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/dast/targets"
payload := strings.NewReader("{\n \"url\": \"https://staging.example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"target": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"host": "<string>",
"verified": true,
"mode": "active",
"has_auth": true,
"has_openapi": true,
"has_graphql_schema": true,
"has_wsdl_document": true,
"requests_per_second": 25,
"max_duration_minutes": 32,
"verification": {
"dns_record_name": "_trustivan-challenge.staging.example.com",
"dns_record_type": "TXT",
"dns_record_value": "trustivan-verify=0123456789abcdef0123456789abcdef",
"file_url": "https://staging.example.com/.well-known/trustivan-verification.txt",
"file_content": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"verification_method": "dns_txt",
"verified_at": "2023-11-07T05:31:56Z",
"last_checked_at": "2023-11-07T05:31:56Z",
"last_check_error": "<string>",
"first_scan_not_queued": "<string>",
"auth_header_name": "<string>",
"openapi_bytes": 123,
"graphql_endpoint": "/graphql",
"graphql_schema_bytes": 123,
"wsdl_path": "/ws?wsdl",
"wsdl_document_bytes": 123,
"grpc_address": "api.example.com:443",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Response
One dynamic scan target.