curl --request POST \
--url https://app.trustivan.com/api/v1/scans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image": "alpine:3.21",
"target": "https://github.com/trustowl/trustowl",
"ref": "main",
"scanners": [
"<string>"
],
"idempotency_key": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/scans"
payload = {
"image": "alpine:3.21",
"target": "https://github.com/trustowl/trustowl",
"ref": "main",
"scanners": ["<string>"],
"idempotency_key": "<string>"
}
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({
image: 'alpine:3.21',
target: 'https://github.com/trustowl/trustowl',
ref: 'main',
scanners: ['<string>'],
idempotency_key: '<string>'
})
};
fetch('https://app.trustivan.com/api/v1/scans', 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/scans"
payload := strings.NewReader("{\n \"image\": \"alpine:3.21\",\n \"target\": \"https://github.com/trustowl/trustowl\",\n \"ref\": \"main\",\n \"scanners\": [\n \"<string>\"\n ],\n \"idempotency_key\": \"<string>\"\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))
}{}{}{
"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"
}Request a container image scan
Returns 202 with work accepted, not work done: pulling and
unpacking an image takes seconds to minutes. 200 instead when an
existing scan was returned, so a client can tell a deduplicated retry
from a new scan.
The image reference is untrusted input and is validated at the boundary: private and link-local registries, embedded credentials, URL schemes and traversal segments are all refused, with a message naming the rule.
curl --request POST \
--url https://app.trustivan.com/api/v1/scans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image": "alpine:3.21",
"target": "https://github.com/trustowl/trustowl",
"ref": "main",
"scanners": [
"<string>"
],
"idempotency_key": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/scans"
payload = {
"image": "alpine:3.21",
"target": "https://github.com/trustowl/trustowl",
"ref": "main",
"scanners": ["<string>"],
"idempotency_key": "<string>"
}
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({
image: 'alpine:3.21',
target: 'https://github.com/trustowl/trustowl',
ref: 'main',
scanners: ['<string>'],
idempotency_key: '<string>'
})
};
fetch('https://app.trustivan.com/api/v1/scans', 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/scans"
payload := strings.NewReader("{\n \"image\": \"alpine:3.21\",\n \"target\": \"https://github.com/trustowl/trustowl\",\n \"ref\": \"main\",\n \"scanners\": [\n \"<string>\"\n ],\n \"idempotency_key\": \"<string>\"\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))
}{}{}{
"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
Headers
Body
Send either image (a container image) or target with kind (any
other target). Sending both is refused: a request that is ambiguous
about what it wants scanned, answered with a green verdict, is how a
build ships an artefact nobody looked at.
target requires kind. The shape of the string is not used to
guess: that is how a filesystem path gets fetched as a repository URL.
A repository URL, a filesystem path or an SBOM document path.
Untrusted input, validated at the boundary: private and link-local
hosts, embedded credentials, unencrypted schemes and traversal
segments are all refused with a message naming the rule. A
filesystem or SBOM path must resolve inside the calling
organization's own directory under a configured scan root
(<root>/<organization id>/…), and a deployment that configures
none refuses both kinds outright. The worker re-checks the path
with symlinks resolved before it reads anything, and fails the
scan if any prefix leads outside that directory.
"https://github.com/trustowl/trustowl"
A branch, tag or commit for a repository target; ignored otherwise.
NOT part of the asset's identity: a repository scanned on two
branches is one protected thing, so cutting a release does not
hand a team a second, empty backlog. A repository target of
the form <url>#<ref>, which is how a scan's target_reference
records one, means that ref when ref is absent; ref wins when
both are sent.
"main"
Response
The scan and the asset it targets.
The response is of type object.