## List Scans `client.VulnerabilityScanner.Scans.List(ctx, params) (*V4PagePaginationArray[ScanListResponse], error)` **get** `/accounts/{account_id}/vuln_scanner/scans` Returns all scans for the account. ### Parameters - `params ScanListParams` - `AccountID param.Field[string]` Path param: Identifier. - `Page param.Field[int64]` Query param: Page number of paginated results. - `PerPage param.Field[int64]` Query param: Number of results per page. ### Returns - `type ScanListResponse struct{…}` - `ID string` Scan identifier. - `ScanType ScanListResponseScanType` The type of vulnerability scan. - `const ScanListResponseScanTypeBOLA ScanListResponseScanType = "bola"` - `Status ScanListResponseStatus` Current lifecycle status of the scan. - `const ScanListResponseStatusCreated ScanListResponseStatus = "created"` - `const ScanListResponseStatusScheduled ScanListResponseStatus = "scheduled"` - `const ScanListResponseStatusPlanning ScanListResponseStatus = "planning"` - `const ScanListResponseStatusRunning ScanListResponseStatus = "running"` - `const ScanListResponseStatusFinished ScanListResponseStatus = "finished"` - `const ScanListResponseStatusFailed ScanListResponseStatus = "failed"` - `TargetEnvironmentID string` The target environment this scan runs against. - `Report ScanListResponseReport` Vulnerability report produced after the scan completes. The shape depends on the scan type. Present only for finished scans. - `Report ScanListResponseReportReport` Version 1 of the BOLA vulnerability scan report. - `Summary ScanListResponseReportReportSummary` Summary of all steps and findings. - `Verdict ScanListResponseReportReportSummaryVerdict` Overall verdict of the vulnerability scan. - `const ScanListResponseReportReportSummaryVerdictOk ScanListResponseReportReportSummaryVerdict = "ok"` - `const ScanListResponseReportReportSummaryVerdictWarning ScanListResponseReportReportSummaryVerdict = "warning"` - `const ScanListResponseReportReportSummaryVerdictInconclusive ScanListResponseReportReportSummaryVerdict = "inconclusive"` - `Tests []ScanListResponseReportReportTest` List of tests that were run. - `Steps []ScanListResponseReportReportTestsStep` Steps that were executed. - `Assertions []ScanListResponseReportReportTestsStepsAssertion` Assertions that were made against the received response. - `Description string` Human-readable description of the assertion, explaining what was checked. - `Kind ScanListResponseReportReportTestsStepsAssertionsKind` Kind of assertion. - `Parameters ScanListResponseReportReportTestsStepsAssertionsKindParameters` Range of HTTP status codes. - `Max int64` Maximum (inclusive) status code of the range. - `Min int64` Minimum (inclusive) status code of the range. - `Type ScanListResponseReportReportTestsStepsAssertionsKindType` - `const ScanListResponseReportReportTestsStepsAssertionsKindTypeHTTPStatusWithinRange ScanListResponseReportReportTestsStepsAssertionsKindType = "http_status_within_range"` - `Observed int64` Observed value on which the assertion was made. - `Outcome ScanListResponseReportReportTestsStepsAssertionsOutcome` Outcome of the assertion. - `const ScanListResponseReportReportTestsStepsAssertionsOutcomeOk ScanListResponseReportReportTestsStepsAssertionsOutcome = "ok"` - `const ScanListResponseReportReportTestsStepsAssertionsOutcomeFail ScanListResponseReportReportTestsStepsAssertionsOutcome = "fail"` - `const ScanListResponseReportReportTestsStepsAssertionsOutcomeInconclusive ScanListResponseReportReportTestsStepsAssertionsOutcome = "inconclusive"` - `Errors []ScanListResponseReportReportTestsStepsError` Errors the step encountered that may explain absent or incomplete fields. - `Description string` Human-readable error description. - `ErrorCode int64` Numeric error code identifying the class of error, if available. - `Request ScanListResponseReportReportTestsStepsRequest` HTTP request that was made, if any. - `CredentialSet ScanListResponseReportReportTestsStepsRequestCredentialSet` Credential set that was used. - `ID string` ID of the credential set. - `Role ScanListResponseReportReportTestsStepsRequestCredentialSetRole` Role of the credential set. - `const ScanListResponseReportReportTestsStepsRequestCredentialSetRoleOwner ScanListResponseReportReportTestsStepsRequestCredentialSetRole = "owner"` - `const ScanListResponseReportReportTestsStepsRequestCredentialSetRoleAttacker ScanListResponseReportReportTestsStepsRequestCredentialSetRole = "attacker"` - `HeaderNames []string` Names of headers that were sent. - `Method ScanListResponseReportReportTestsStepsRequestMethod` HTTP method. - `const ScanListResponseReportReportTestsStepsRequestMethodGet ScanListResponseReportReportTestsStepsRequestMethod = "GET"` - `const ScanListResponseReportReportTestsStepsRequestMethodDelete ScanListResponseReportReportTestsStepsRequestMethod = "DELETE"` - `const ScanListResponseReportReportTestsStepsRequestMethodPatch ScanListResponseReportReportTestsStepsRequestMethod = "PATCH"` - `const ScanListResponseReportReportTestsStepsRequestMethodPost ScanListResponseReportReportTestsStepsRequestMethod = "POST"` - `const ScanListResponseReportReportTestsStepsRequestMethodPut ScanListResponseReportReportTestsStepsRequestMethod = "PUT"` - `URL string` Exact and full URL (including host, query parameters) that was requested. - `VariableCaptures []ScanListResponseReportReportTestsStepsRequestVariableCapture` Variable captures requested for this step. - `JsonPath string` JSONPath expression used for capture, e.g. `"$.id"`. - `Name string` Variable name, e.g. `"resource_id"`. - `Body unknown` Request body, if any. - `Response ScanListResponseReportReportTestsStepsResponse` HTTP response that was received, if any. - `Body ScanListResponseReportReportTestsStepsResponseBody` HTTP response body. - `type ScanListResponseReportReportTestsStepsResponseBodyKind struct{…}` No body was received. - `Kind ScanListResponseReportReportTestsStepsResponseBodyKindKind` - `const ScanListResponseReportReportTestsStepsResponseBodyKindKindNotFound ScanListResponseReportReportTestsStepsResponseBodyKindKind = "not_found"` - `type ScanListResponseReportReportTestsStepsResponseBodyObject struct{…}` Body received but unable to read as UTF-8. Raw bytes, base64-encoded. - `Contents string` - `Kind ScanListResponseReportReportTestsStepsResponseBodyObjectKind` - `const ScanListResponseReportReportTestsStepsResponseBodyObjectKindBytes ScanListResponseReportReportTestsStepsResponseBodyObjectKind = "bytes"` - `Truncated bool` - `type ScanListResponseReportReportTestsStepsResponseBodyObject struct{…}` Body received as valid UTF-8 text but not valid JSON. - `Contents string` - `Kind ScanListResponseReportReportTestsStepsResponseBodyObjectKind` - `const ScanListResponseReportReportTestsStepsResponseBodyObjectKindText ScanListResponseReportReportTestsStepsResponseBodyObjectKind = "text"` - `Truncated bool` - `type ScanListResponseReportReportTestsStepsResponseBodyObject struct{…}` Body received as valid JSON. - `Contents string` - `Kind ScanListResponseReportReportTestsStepsResponseBodyObjectKind` - `const ScanListResponseReportReportTestsStepsResponseBodyObjectKindJson ScanListResponseReportReportTestsStepsResponseBodyObjectKind = "json"` - `Truncated bool` - `HeaderNames []string` Names of headers that were received. - `Status int64` HTTP status code. - `StatusText string` HTTP status text, if available for the status code. - `Verdict ScanListResponseReportReportTestsVerdict` Verdict of this single test. - `const ScanListResponseReportReportTestsVerdictOk ScanListResponseReportReportTestsVerdict = "ok"` - `const ScanListResponseReportReportTestsVerdictWarning ScanListResponseReportReportTestsVerdict = "warning"` - `const ScanListResponseReportReportTestsVerdictInconclusive ScanListResponseReportReportTestsVerdict = "inconclusive"` - `PreflightErrors []ScanListResponseReportReportTestsPreflightError` Errors that prevented step execution. - `Description string` Human-readable error description. - `ErrorCode int64` Numeric error code identifying the class of error, if available. - `ReportSchemaVersion ScanListResponseReportReportSchemaVersion` Version of the report schema. - `const ScanListResponseReportReportSchemaVersionV1 ScanListResponseReportReportSchemaVersion = "v1"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/vulnerability_scanner" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.VulnerabilityScanner.Scans.List(context.TODO(), vulnerability_scanner.ScanListParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "scan_type": "bola", "status": "created", "target_environment_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "report": { "report": { "summary": { "verdict": "ok" }, "tests": [ { "steps": [ { "assertions": [ { "description": "description", "kind": { "parameters": { "max": 0, "min": 0 }, "type": "http_status_within_range" }, "observed": 0, "outcome": "ok" } ], "errors": [ { "description": "description", "error_code": 0 } ], "request": { "credential_set": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "role": "owner" }, "header_names": [ "string" ], "method": "GET", "url": "https://example.com", "variable_captures": [ { "json_path": "json_path", "name": "name" } ], "body": {} }, "response": { "body": { "kind": "not_found" }, "header_names": [ "string" ], "status": 0, "status_text": "status_text" } } ], "verdict": "ok", "preflight_errors": [ { "description": "description", "error_code": 0 } ] } ] }, "report_schema_version": "v1" } } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ```