Get scan details
curl --request GET \
--url https://semgrep.dev/api/v1/deployments/{deploymentId}/scan/{scanId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://semgrep.dev/api/v1/deployments/{deploymentId}/scan/{scanId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://semgrep.dev/api/v1/deployments/{deploymentId}/scan/{scanId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://semgrep.dev/api/v1/deployments/{deploymentId}/scan/{scanId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://semgrep.dev/api/v1/deployments/{deploymentId}/scan/{scanId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://semgrep.dev/api/v1/deployments/{deploymentId}/scan/{scanId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://semgrep.dev/api/v1/deployments/{deploymentId}/scan/{scanId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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
}
}Scans
Get scan details
Request the details of a scan including the associated deployment, repository, and commit information.
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>'import requests
url = "https://semgrep.dev/api/v1/deployments/{deploymentId}/scan/{scanId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://semgrep.dev/api/v1/deployments/{deploymentId}/scan/{scanId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://semgrep.dev/api/v1/deployments/{deploymentId}/scan/{scanId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://semgrep.dev/api/v1/deployments/{deploymentId}/scan/{scanId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://semgrep.dev/api/v1/deployments/{deploymentId}/scan/{scanId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://semgrep.dev/api/v1/deployments/{deploymentId}/scan/{scanId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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
}
}Authorizations
Path Parameters
Response
200 - application/json
OK
Was this page helpful?