Retrieve a scan
⚠️ Beta endpoint: behavior and schemas are subject to change.
Retrieve a historical scan's progress: element and byte counters, plus the scan's audit summary once one becomes available.
Poll it while the scan runs, watching report_status rather than scan_status: a scan reaching a terminal status does not mean the audit summary is ready. Stop polling once report_status is done — that response carries the final numbers (duration_seconds, pending_seconds, outcome_by_reason) — or unavailable, meaning no report will ever come for this scan.
Counters are reported the same way for every source, but not every source tracks every counter: data_downloaded_bytes and data_scanned_bytes are null for sources that do not measure bytes (VCS repositories among them), which is distinct from a real 0.
elements_total is provisional while listing_finished is false — it only reflects elements listed so far, not the final total.
Path parameters
The id of the scan to retrieve.
Response
Scan progress
Example response
{
"scan_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"source": {
"id": 6531,
"visibility": "private",
"display_name": "GitGuardian/gg-shield",
"type": "gh_repository",
"size": 10485760
},
"report_status": "in_progress",
"scan_status": "running",
"scan_status_reason": "DMCA takedown",
"elements_total": 512,
"elements_scanned": 128,
"elements_skipped": 3,
"data_downloaded_bytes": 10485760,
"data_scanned_bytes": 10485760,
"started_at": "2021-05-20T12:40:55.662949Z",
"ended_at": "2021-05-20T12:45:12.662949Z",
"duration_seconds": 257,
"pending_seconds": 4,
"outcome_by_reason": {
"skipped": {
"binary_file": 2,
"too_large": 1
},
"failed": {
"file_not_downloadable": 3,
"empty_content": 1
}
},
"elements_by_type": {
"commit": {
"scanned": 1487,
"skipped": 3
},
"branch": {
"scanned": 4
},
"patch": {
"skipped": 7,
"in_skipped_commits": 51
}
}
}Changes
Changed in 1 of the 25 revisions of this API.1
- ○
endpoint added
endpoint-added
This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○