Skip to main content
GET
List Code Scans

Permissions

Requires a service user or personal access token with the ViewAccountCodeScans permission at the enterprise level.

Behavior

Returns code scans across the enterprise, newest first. Use it to poll the status of a scan started with Start Code Scan: waitingpendingrunningcompleted (or failed / cancelled). awaiting_user_input applies only to interactive scans started from the web app; API-started scans do not enter it.

Filters

  • time_after / time_before: Unix timestamps in seconds (UTC) bounding the scan creation time.
  • repo_name: only scans that scanned this repository. Matches multi-repo scans that include it.
  • org_ids: only scans in these organizations.
Results are paginated with an opaque cursor (after / first). For a single organization, use List Code Scans (Organization).

Authorizations

Authorization
string
header
required

Service User credential (prefix: cog_)

Query Parameters

time_before
integer | null
time_after
integer | null
after
string | null
first
integer
default:100
Required range: 1 <= x <= 200
repo_name
string | null

Filter to scans that scanned this repository. Matches multi-repo scans even when the repository is not the scan's primary repo, so returned items may report a different repo_name.

org_ids
string[] | null

Filter to scans in these organizations.

Response

Successful Response

items
CodeScanResponse · object[]
required
end_cursor
string | null

Cursor to fetch the next page, or None if this is the last page.

has_next_page
boolean
default:false

Whether there are more items available after this page.

total
integer | null

Optional total count (can be omitted for performance).