Skip to main content
GET
/
api
/
v1
/
deployments
/
{deploymentId}
/
scan
/
{scanId}
Get scan details
curl --request GET \
  --url https://semgrep.dev/api/v1/deployments/{deploymentId}/scan/{scanId} \
  --header 'Authorization: Bearer <token>'
{
  "completed_at": "2023-11-18T23:28:12.391Z",
  "deployment_id": 120,
  "enabled_products": [
    "secrets"
  ],
  "exit_code": 123,
  "has_logs": true,
  "id": 123,
  "meta": {
    "true": "pull_request",
    "branch": "refs/heads/main",
    "commit": "94c5be1312a9da03b7c4bfcc1c50b4379c83412",
    "config": "r/python",
    "repo_url": "https://github.com/semgrep/semgrep",
    "ci_job_url": "https://github.com/semgrep/semgrep/actions/runs/12345",
    "repository": "semgrep/semgrep",
    "commit_title": {
      "fix(feature)": "Added XYZ component"
    },
    "pull_request_id": 12345,
    "pull_request_title": {
      "fix(feature)": "Added XYZ component"
    },
    "commit_author_name": "Sven Greppe",
    "commit_author_image_url": "https://github.com/link/to/avatar.png",
    "commit_author_email": "sven.greppe@semgrep.com",
    "commit_author_username": "SvenGreppe",
    "pull_request_author_username": "SvenGreppe",
    "pull_request_author_image_url": "https://github.com/link/to/avatar.png"
  },
  "repository_id": 1234567,
  "started_at": "2023-11-18T23:28:12.391Z",
  "stats": {
    "findings": 5,
    "total_time": 100
  }
}

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

scanId
string<uint64>
required

Scan ID (numeric). Example: 456. Can be found at /deployments/{deploymentId}/scans/search.

Example:

456

Response

200 - application/json

OK

completed_at
string

imestamp of when the scan started.

Example:

"2023-11-18T23:28:12.391Z"

deployment_id
integer<uint32>

The unique ID of the deployment associated with the scanned repository.

Example:

120

enabled_products
string[]

The products used when running the scan.

Example:
["secrets"]
exit_code
integer<uint32>
has_logs
boolean
id
integer<uint32>

The unique ID representing this scan.

Example:

123

meta
object
repository_id
integer<uint32>

The unique ID of the repository that was scanned.

Example:

1234567

started_at
string

when the scan was started

Example:

"2023-11-18T23:28:12.391Z"

stats
object

Miscellaneous statistics about the scan, like number of findings found and scan duration.

Example:
{ "findings": 5, "total_time": 100 }