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
| Address | https://api.hanzo.ai/v1/security/scans |
| Method | POST |
| Operation | post_security_scans |
| Auth | Authorization: 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).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
files | body | scan[] | yes | Files is the batch to scan, at most 500 files and 8 MiB of content in total. |
files[].content | body | string | — | Content is the source to scan. |
files[].path | body | string | — | Path is where the file lives, recorded on any finding so a result can be located in the tree it came from. |
project | body | string | — | Project names the sub-scope the scan is filed under. |
Response
| Status | Body | Meaning |
|---|---|---|
201 | scanView | created |
201 body — 9 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
createdAt | body | integer | — | CreatedAt is when the scan ran, in Unix milliseconds. |
critical | body | integer | — | Critical is how many findings carry the highest severity. |
files | body | integer | — | Files is how many files the scan read. |
findings | body | integer | — | Findings is how many secrets fired across them. |
high | body | integer | — | High is how many findings rank high. |
id | body | string | — | ID addresses this scan and every finding on it. |
low | body | integer | — | Low is how many findings rank low. |
medium | body | integer | — | Medium is how many findings rank medium. |
project | body | string | — | Project 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>"}]'import { Configuration, SecurityApi } from 'hanzoai';
const api = new SecurityApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postSecurityScans({ files: [{"content":"<content>","path":"<path>"}] });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import SecurityApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = SecurityApi(client).post_security_scans(files=[{"content":"<content>","path":"<path>"}])cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.SecurityAPI.PostSecurityScans(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, security_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = security_api::post_security_scans(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.SecurityApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new SecurityApi(client).postSecurityScans();curl -X POST https://api.hanzo.ai/v1/security/scans \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"files": [
{
"content": "<content>",
"path": "<path>"
}
]
}'The door reaches security through the security tool, which names its 7 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_security_findings"
}
}
}'How is this guide?