Hanzo
OpenapiSecurity

Runs the detection engine over a batch of files and answers 201 with the scan…

Runs the detection engine over a batch of files and answers 201 with the scan summary: how many files were read, how many findings fired, and the tally by…

POST /v1/security/scans

Addresshttps://api.hanzo.ai/v1/security/scans
MethodPOST
Operationpost_security_scans
AuthAuthorization: Bearer $HANZO_API_KEY

Runs the detection engine over a batch of files and answers 201 with the scan summary: how many files were read, how many findings fired, and the tally by severity.

THE SUBMITTED CONTENT IS NEVER STORED. It is scanned in memory; what persists is the finding — its rule, its path and line, a MASKED preview (first and last characters kept, the middle starred) and the SHA-256 fingerprint of the raw secret. The fingerprint is what makes the same secret recognisable across scans and after rotation without the secret ever being written down.

It requires a validated org, which scopes the stored scan and every finding on it; a caller with no org is refused. Bounded at 500 files and 8 MiB of total content per submission — split a larger tree across scans. One scan is one metered unit, and the scan is recorded in the audit log with its tally, never with its findings.

Request

4 fields, body application/json (required).

FieldInTypeRequiredDescription
filesbodyscan[]yesFiles is the batch to scan, at most 500 files and 8 MiB of content in total.
files[].contentbodystringContent is the source to scan.
files[].pathbodystringPath is where the file lives, recorded on any finding so a result can be located in the tree it came from.
projectbodystringProject names the sub-scope the scan is filed under.

Response

StatusBodyMeaning
201scanViewcreated

201 body — 9 fields.

FieldInTypeAlwaysDescription
createdAtbodyintegerCreatedAt is when the scan ran, in Unix milliseconds.
criticalbodyintegerCritical is how many findings carry the highest severity.
filesbodyintegerFiles is how many files the scan read.
findingsbodyintegerFindings is how many secrets fired across them.
highbodyintegerHigh is how many findings rank high.
idbodystringID addresses this scan and every finding on it.
lowbodyintegerLow is how many findings rank low.
mediumbodyintegerMedium is how many findings rank medium.
projectbodystringProject is the sub-scope the scan was filed under.

Failure carries the platform error shape — see Errors.

Examples

hanzo security scans create --files '[{"content":"<content>","path":"<path>"}]'

Security API · All Hanzo APIs · Interactive reference

How is this guide?

On this page