POST
Request a container image scan

Authorizations

Authorization
string
header
required

Authorization: Bearer twk_<prefix>_<secret>.

The prefix is public and safe to log: it is what identifies which credential leaked. The secret is never logged, never returned after creation, and stored only as a SHA-256 hash.

Headers

Idempotency-Key
string

Makes a retry safe. Also accepted as idempotency_key in the body.

Maximum string length: 200

Body

application/json

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.

image
string

A container image reference. Equivalent to kind: container_image.

Example:

"alpine:3.21"

kind
enum<string>

What is being scanned. Required when target is used. The deployment's engine must support it; vm and cloud_account exist in the contract and are not scannable by any shipped engine.

Available options:
container_image,
repository,
filesystem,
sbom
target
string

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.

Example:

"https://github.com/trustowl/trustowl"

ref
string

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.

Example:

"main"

scanners
string[]
idempotency_key
string
Maximum string length: 200

Response

The scan and the asset it targets.

The response is of type object.