Run a scanner job
curl --request POST \
--url http://localhost:3000/api/scanners/{id}/scan \
--header 'Content-Type: application/json' \
--header 'x-openlit-environment: <x-openlit-environment>' \
--header 'x-openlit-project-id: <x-openlit-project-id>' \
--data '
{
"target": "https://github.com/acme/checkout-agent",
"ref": "main",
"detectors": "claude_sdk,mcp",
"strict": true,
"secretScan": true,
"vulnScan": true,
"licenseScan": true,
"requireSigned": true,
"rulesRepo": "<string>",
"rulesRef": "<string>",
"noRulesUpdate": true,
"verbose": true
}
'import requests
url = "http://localhost:3000/api/scanners/{id}/scan"
payload = {
"target": "https://github.com/acme/checkout-agent",
"ref": "main",
"detectors": "claude_sdk,mcp",
"strict": True,
"secretScan": True,
"vulnScan": True,
"licenseScan": True,
"requireSigned": True,
"rulesRepo": "<string>",
"rulesRef": "<string>",
"noRulesUpdate": True,
"verbose": True
}
headers = {
"x-openlit-project-id": "<x-openlit-project-id>",
"x-openlit-environment": "<x-openlit-environment>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-openlit-project-id': '<x-openlit-project-id>',
'x-openlit-environment': '<x-openlit-environment>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
target: 'https://github.com/acme/checkout-agent',
ref: 'main',
detectors: 'claude_sdk,mcp',
strict: true,
secretScan: true,
vulnScan: true,
licenseScan: true,
requireSigned: true,
rulesRepo: '<string>',
rulesRef: '<string>',
noRulesUpdate: true,
verbose: true
})
};
fetch('http://localhost:3000/api/scanners/{id}/scan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/scanners/{id}/scan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target' => 'https://github.com/acme/checkout-agent',
'ref' => 'main',
'detectors' => 'claude_sdk,mcp',
'strict' => true,
'secretScan' => true,
'vulnScan' => true,
'licenseScan' => true,
'requireSigned' => true,
'rulesRepo' => '<string>',
'rulesRef' => '<string>',
'noRulesUpdate' => true,
'verbose' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-openlit-environment: <x-openlit-environment>",
"x-openlit-project-id: <x-openlit-project-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/api/scanners/{id}/scan"
payload := strings.NewReader("{\n \"target\": \"https://github.com/acme/checkout-agent\",\n \"ref\": \"main\",\n \"detectors\": \"claude_sdk,mcp\",\n \"strict\": true,\n \"secretScan\": true,\n \"vulnScan\": true,\n \"licenseScan\": true,\n \"requireSigned\": true,\n \"rulesRepo\": \"<string>\",\n \"rulesRef\": \"<string>\",\n \"noRulesUpdate\": true,\n \"verbose\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-openlit-project-id", "<x-openlit-project-id>")
req.Header.Add("x-openlit-environment", "<x-openlit-environment>")
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))
}HttpResponse<String> response = Unirest.post("http://localhost:3000/api/scanners/{id}/scan")
.header("x-openlit-project-id", "<x-openlit-project-id>")
.header("x-openlit-environment", "<x-openlit-environment>")
.header("Content-Type", "application/json")
.body("{\n \"target\": \"https://github.com/acme/checkout-agent\",\n \"ref\": \"main\",\n \"detectors\": \"claude_sdk,mcp\",\n \"strict\": true,\n \"secretScan\": true,\n \"vulnScan\": true,\n \"licenseScan\": true,\n \"requireSigned\": true,\n \"rulesRepo\": \"<string>\",\n \"rulesRef\": \"<string>\",\n \"noRulesUpdate\": true,\n \"verbose\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/scanners/{id}/scan")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-openlit-project-id"] = '<x-openlit-project-id>'
request["x-openlit-environment"] = '<x-openlit-environment>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target\": \"https://github.com/acme/checkout-agent\",\n \"ref\": \"main\",\n \"detectors\": \"claude_sdk,mcp\",\n \"strict\": true,\n \"secretScan\": true,\n \"vulnScan\": true,\n \"licenseScan\": true,\n \"requireSigned\": true,\n \"rulesRepo\": \"<string>\",\n \"rulesRef\": \"<string>\",\n \"noRulesUpdate\": true,\n \"verbose\": true\n}"
response = http.request(request)
puts response.read_body{
"connector": {
"id": "<string>",
"name": "<string>",
"type": "<string>"
},
"job": {
"id": "<string>",
"status": "queued",
"target": "<string>",
"ref": "<string>",
"cliVersion": "v0.1.8",
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z",
"findingCount": 123,
"mediumPlusCount": 123,
"findings": [
{
"id": "<string>",
"ruleId": "<string>",
"severity": "<string>",
"path": "<string>",
"title": "<string>"
}
],
"error": "<string>"
}
}Start a Trustabl scan for the connector. Missing body fields fall back to connector defaults. Returns the finished job and findings.
POST
/
api
/
scanners
/
{id}
/
scan
Run a scanner job
curl --request POST \
--url http://localhost:3000/api/scanners/{id}/scan \
--header 'Content-Type: application/json' \
--header 'x-openlit-environment: <x-openlit-environment>' \
--header 'x-openlit-project-id: <x-openlit-project-id>' \
--data '
{
"target": "https://github.com/acme/checkout-agent",
"ref": "main",
"detectors": "claude_sdk,mcp",
"strict": true,
"secretScan": true,
"vulnScan": true,
"licenseScan": true,
"requireSigned": true,
"rulesRepo": "<string>",
"rulesRef": "<string>",
"noRulesUpdate": true,
"verbose": true
}
'import requests
url = "http://localhost:3000/api/scanners/{id}/scan"
payload = {
"target": "https://github.com/acme/checkout-agent",
"ref": "main",
"detectors": "claude_sdk,mcp",
"strict": True,
"secretScan": True,
"vulnScan": True,
"licenseScan": True,
"requireSigned": True,
"rulesRepo": "<string>",
"rulesRef": "<string>",
"noRulesUpdate": True,
"verbose": True
}
headers = {
"x-openlit-project-id": "<x-openlit-project-id>",
"x-openlit-environment": "<x-openlit-environment>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-openlit-project-id': '<x-openlit-project-id>',
'x-openlit-environment': '<x-openlit-environment>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
target: 'https://github.com/acme/checkout-agent',
ref: 'main',
detectors: 'claude_sdk,mcp',
strict: true,
secretScan: true,
vulnScan: true,
licenseScan: true,
requireSigned: true,
rulesRepo: '<string>',
rulesRef: '<string>',
noRulesUpdate: true,
verbose: true
})
};
fetch('http://localhost:3000/api/scanners/{id}/scan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/scanners/{id}/scan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target' => 'https://github.com/acme/checkout-agent',
'ref' => 'main',
'detectors' => 'claude_sdk,mcp',
'strict' => true,
'secretScan' => true,
'vulnScan' => true,
'licenseScan' => true,
'requireSigned' => true,
'rulesRepo' => '<string>',
'rulesRef' => '<string>',
'noRulesUpdate' => true,
'verbose' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-openlit-environment: <x-openlit-environment>",
"x-openlit-project-id: <x-openlit-project-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/api/scanners/{id}/scan"
payload := strings.NewReader("{\n \"target\": \"https://github.com/acme/checkout-agent\",\n \"ref\": \"main\",\n \"detectors\": \"claude_sdk,mcp\",\n \"strict\": true,\n \"secretScan\": true,\n \"vulnScan\": true,\n \"licenseScan\": true,\n \"requireSigned\": true,\n \"rulesRepo\": \"<string>\",\n \"rulesRef\": \"<string>\",\n \"noRulesUpdate\": true,\n \"verbose\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-openlit-project-id", "<x-openlit-project-id>")
req.Header.Add("x-openlit-environment", "<x-openlit-environment>")
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))
}HttpResponse<String> response = Unirest.post("http://localhost:3000/api/scanners/{id}/scan")
.header("x-openlit-project-id", "<x-openlit-project-id>")
.header("x-openlit-environment", "<x-openlit-environment>")
.header("Content-Type", "application/json")
.body("{\n \"target\": \"https://github.com/acme/checkout-agent\",\n \"ref\": \"main\",\n \"detectors\": \"claude_sdk,mcp\",\n \"strict\": true,\n \"secretScan\": true,\n \"vulnScan\": true,\n \"licenseScan\": true,\n \"requireSigned\": true,\n \"rulesRepo\": \"<string>\",\n \"rulesRef\": \"<string>\",\n \"noRulesUpdate\": true,\n \"verbose\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/scanners/{id}/scan")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-openlit-project-id"] = '<x-openlit-project-id>'
request["x-openlit-environment"] = '<x-openlit-environment>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target\": \"https://github.com/acme/checkout-agent\",\n \"ref\": \"main\",\n \"detectors\": \"claude_sdk,mcp\",\n \"strict\": true,\n \"secretScan\": true,\n \"vulnScan\": true,\n \"licenseScan\": true,\n \"requireSigned\": true,\n \"rulesRepo\": \"<string>\",\n \"rulesRef\": \"<string>\",\n \"noRulesUpdate\": true,\n \"verbose\": true\n}"
response = http.request(request)
puts response.read_body{
"connector": {
"id": "<string>",
"name": "<string>",
"type": "<string>"
},
"job": {
"id": "<string>",
"status": "queued",
"target": "<string>",
"ref": "<string>",
"cliVersion": "v0.1.8",
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z",
"findingCount": 123,
"mediumPlusCount": 123,
"findings": [
{
"id": "<string>",
"ruleId": "<string>",
"severity": "<string>",
"path": "<string>",
"title": "<string>"
}
],
"error": "<string>"
}
}Start a Trustabl scan on a scanner connector. Missing body fields use the connector defaults. The response includes the finished job and its findings.
Do not send a GitHub token in the body — the token stays on the connector. The request can take several minutes (up to 300 seconds).
See Scanner connectors for setup.
Headers
Example:
"production"
Path Parameters
Scanner connector ID (scanner:<uuid>).
Body
application/json
Example:
"https://github.com/acme/checkout-agent"
Example:
"main"
Example:
"claude_sdk,mcp"
Available options:
environment, production, staging, git Was this page helpful?

