Skip to main content
POST
/
api
/
v1
/
deployments
/
{deploymentId}
/
scans
/
search
List scans (beta)
curl --request POST \
  --url https://semgrep.dev/api/v1/deployments/{deploymentId}/scans/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "branch": "<string>",
  "cursor": "<string>",
  "deploymentId": 123,
  "is_full_scan": 123,
  "limit": 123,
  "repository_id": 123,
  "since": "2023-11-07T05:31:56Z",
  "total_time": {
    "max": 123,
    "min": 123
  }
}
'
{
  "cursor": "<string>",
  "scans": [
    {
      "branch": "main",
      "commit": "6d3de02545f820febf2af9820568fa5f697d4087",
      "completed_at": "2020-11-18T23:30:10.216Z",
      "deployment_id": "<string>",
      "enabled_products": [
        "secrets"
      ],
      "exit_code": 0,
      "findings_counts": {
        "code": 2,
        "secrets": 1,
        "supply_chain": 1,
        "total": 4
      },
      "id": "<string>",
      "is_full_scan": true,
      "repository_id": "<string>",
      "started_at": "2020-11-18T23:28:12.391Z",
      "status": "SCAN_STATUS_RUNNING",
      "total_time": 17.32
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.semgrep.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Get access to data with your API token. Example header:

Authorization: Bearer 2991e2fb4b540fe75b8f90677b0b892b6314e4961cb001fe6eb452eee248a628

The token can be provisioned from the Tokens section in your Settings, and requires explicitly enabling Web API access.

Path Parameters

deploymentId
string<uint64>
required

Deployment ID (numeric). Example: 123. Can be found at /deployments, or in your Settings in the web UI.

Example:

123

Body

application/json
branch
string

Only get scans from the specified branch

cursor
string

Cursor to paginate through the results

deploymentId
string<uint64>

Deployment ID (numeric). Example: 123. Can be found at /deployments, or in your Settings in the web UI.

Example:

123

is_full_scan
integer

Only get scans that are full scans (if false, only get diff scans)

limit
integer

Page size to paginate through the results (default is 100, max is 500)

products
enum<string>[]

Only get scans that have these enabled products

valuedescription
PRODUCT_SAST
PRODUCT_SCA
PRODUCT_SECRETS
PRODUCT_AI_SAST
Available options:
PRODUCT_UNSPECIFIED,
PRODUCT_SAST,
PRODUCT_SCA,
PRODUCT_SECRETS,
PRODUCT_AI_SAST
repository_id
integer

Only get scans for this repo

since
string<date-time>

Only get scans created after this time. Provide time in ISO 8601 format.

statuses
enum<integer>

Only get scans that have one of these statuses

valuedescription
SCAN_STATUS_RUNNINGThe scan is currently running
SCAN_STATUS_COMPLETEDThe scan has completed successfully (0 or 1 exit code)
SCAN_STATUS_ERRORThe scan has exited with a failure (exit code not 0 or 1)
SCAN_STATUS_NEVER_FINISHEDThe scan did not report an error or success after over an hour
Available options:
SCAN_STATUS_RUNNING,
SCAN_STATUS_COMPLETED,
SCAN_STATUS_ERROR,
SCAN_STATUS_NEVER_FINISHED
total_time
Float Range · object

Response

200 - application/json

OK

cursor
string

Cursor to retrieve the next page of results.

scans
object[]

List of scans.