Skip to main content

scans

Creates, updates, deletes, gets or lists a scans resource.

Overview

Namescans
TypeResource
Iddigitalocean.security.scans

Fields

The following fields are returned by SELECT queries:

The response will be a JSON object with a key called scan.

NameDatatypeDescription
idstringThe unique identifier for the scan. (title: id, example: 760e09ef-dc84-11e8-981e-3cfdfeaae000)
created_atstring (date-time)When scan was created. (title: created_at, example: 2025-12-04T00:00:00Z)
findingsarray (title: findings)
statusstringThe status of the scan. (IN_PROGRESS, COMPLETED, FAILED, CSPM_NOT_ENABLED, SCAN_NOT_RUN) (title: status, example: COMPLETED)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
security_get_scanselectscan_idseverity, per_page, page, typeTo get a CSPM scan by ID, send a GET request to /v2/security/scans/{scan_id}.
security_list_scansselectper_page, pageTo list all CSPM scans, send a GET request to /v2/security/scans.
security_get_latest_scanselectper_page, page, severity, typeTo get the latest CSPM scan, send a GET request to /v2/security/scans/latest.
security_create_scaninsertTo create a CSPM scan, send a POST request to /v2/security/scans.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
scan_idstring (uuid)The scan UUID. (example: 497dcba3-ecbf-4587-a2dd-5eb0665e6880)
pageintegerWhich 'page' of paginated results to return. (example: 1)
per_pageintegerNumber of items returned per page (example: 2)
severitystringThe finding severity level to include. (example: CRITICAL)
typestringThe finding type to include. (example: CSPM)

SELECT examples

To get a CSPM scan by ID, send a GET request to /v2/security/scans/{scan_id}.

SELECT
id,
created_at,
findings,
status
FROM digitalocean.security.scans
WHERE scan_id = '{{ scan_id }}' -- required
AND severity = '{{ severity }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
AND type = '{{ type }}'
;

INSERT examples

To create a CSPM scan, send a POST request to /v2/security/scans.

INSERT INTO digitalocean.security.scans (

)
SELECT

RETURNING
scan
;