curl --request GET \
--url https://semgrep.dev/api/v1/deployments/{deploymentId}/secrets \
--header 'Authorization: Bearer <token>'import requests
url = "https://semgrep.dev/api/v1/deployments/{deploymentId}/secrets"
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}/secrets', 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}/secrets",
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}/secrets"
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}/secrets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://semgrep.dev/api/v1/deployments/{deploymentId}/secrets")
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{
"cursor": "<string>",
"findings": {
"cursor": "Pm0ROjIwMjQtMDItMDYgMjA6MDQ6NDguMEDzNzk2fmk6NYTM2zUxOTI=",
"findings": [
{
"confidence": "CONFIDENCE_HIGH",
"createdAt": "2024-06-17T17:23:01.901204Z",
"findingPath": "src/ai.py:232",
"findingPathUrl": "https://github.com/foo/bar/blob/6ad16b240d4b6ae5bd6e326dd71053c21344e311/src/ai.py#L232",
"id": "691234",
"mode": "MODE_MONITOR",
"ref": "refs/pull/148/merge",
"refUrl": "https://github.com/foo/bar/pull/148",
"repository": {
"name": "foo/bar",
"scmType": "SCM_TYPE_GITHUB",
"url": "https://github.com/foo/bar",
"visibility": "REPOSITORY_VISIBILITY_PRIVATE"
},
"reviewComments": [
{
"externalDiscussionId": "af0433345acfb74c8f9",
"externalNoteId": "5678"
}
],
"ruleHashId": "lBU41LA",
"severity": "SEVERITY_HIGH",
"status": "FINDING_STATUS_FIXED",
"type": "OpenAI",
"updatedAt": "2024-06-20T17:33:00.669343Z",
"validationState": "VALIDATION_STATE_CONFIRMED_VALID"
},
{
"confidence": "CONFIDENCE_MEDIUM",
"createdAt": "2024-06-08T11:01:23.380293Z",
"findingPath": "config.yaml:801",
"findingPathUrl": "https://github.com/foo/baz/blob/e2b6d5ca75d830e10f5f617481a66a981bd093c0/config.yaml#L801",
"id": "6881234",
"mode": "MODE_COMMENT",
"ref": "develop",
"refUrl": "https://github.com/foo/baz/tree/develop",
"repository": {
"name": "foo/baz",
"scmType": "SCM_TYPE_GITHUB",
"url": "https://github.com/foo/baz",
"visibility": "REPOSITORY_VISIBILITY_PRIVATE"
},
"reviewComments": [
{
"externalDiscussionId": "af0476223423b74c8f9",
"externalNoteId": "6789"
}
],
"ruleHashId": "pKUYdA",
"severity": "SEVERITY_HIGH",
"status": "FINDING_STATUS_IGNORED",
"type": "Heroku",
"updatedAt": "2024-06-22T11:07:02.384500Z",
"validationState": "VALIDATION_STATE_CONFIRMED_INVALID"
}
]
},
"previous": "<string>"
}List secrets
curl --request GET \
--url https://semgrep.dev/api/v1/deployments/{deploymentId}/secrets \
--header 'Authorization: Bearer <token>'import requests
url = "https://semgrep.dev/api/v1/deployments/{deploymentId}/secrets"
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}/secrets', 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}/secrets",
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}/secrets"
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}/secrets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://semgrep.dev/api/v1/deployments/{deploymentId}/secrets")
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{
"cursor": "<string>",
"findings": {
"cursor": "Pm0ROjIwMjQtMDItMDYgMjA6MDQ6NDguMEDzNzk2fmk6NYTM2zUxOTI=",
"findings": [
{
"confidence": "CONFIDENCE_HIGH",
"createdAt": "2024-06-17T17:23:01.901204Z",
"findingPath": "src/ai.py:232",
"findingPathUrl": "https://github.com/foo/bar/blob/6ad16b240d4b6ae5bd6e326dd71053c21344e311/src/ai.py#L232",
"id": "691234",
"mode": "MODE_MONITOR",
"ref": "refs/pull/148/merge",
"refUrl": "https://github.com/foo/bar/pull/148",
"repository": {
"name": "foo/bar",
"scmType": "SCM_TYPE_GITHUB",
"url": "https://github.com/foo/bar",
"visibility": "REPOSITORY_VISIBILITY_PRIVATE"
},
"reviewComments": [
{
"externalDiscussionId": "af0433345acfb74c8f9",
"externalNoteId": "5678"
}
],
"ruleHashId": "lBU41LA",
"severity": "SEVERITY_HIGH",
"status": "FINDING_STATUS_FIXED",
"type": "OpenAI",
"updatedAt": "2024-06-20T17:33:00.669343Z",
"validationState": "VALIDATION_STATE_CONFIRMED_VALID"
},
{
"confidence": "CONFIDENCE_MEDIUM",
"createdAt": "2024-06-08T11:01:23.380293Z",
"findingPath": "config.yaml:801",
"findingPathUrl": "https://github.com/foo/baz/blob/e2b6d5ca75d830e10f5f617481a66a981bd093c0/config.yaml#L801",
"id": "6881234",
"mode": "MODE_COMMENT",
"ref": "develop",
"refUrl": "https://github.com/foo/baz/tree/develop",
"repository": {
"name": "foo/baz",
"scmType": "SCM_TYPE_GITHUB",
"url": "https://github.com/foo/baz",
"visibility": "REPOSITORY_VISIBILITY_PRIVATE"
},
"reviewComments": [
{
"externalDiscussionId": "af0476223423b74c8f9",
"externalNoteId": "6789"
}
],
"ruleHashId": "pKUYdA",
"severity": "SEVERITY_HIGH",
"status": "FINDING_STATUS_IGNORED",
"type": "Heroku",
"updatedAt": "2024-06-22T11:07:02.384500Z",
"validationState": "VALIDATION_STATE_CONFIRMED_INVALID"
}
]
},
"previous": "<string>"
}Authorizations
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
Deployment ID (numeric). Example: 123. Can be found at /deployments, or in your Settings in the web UI.
123
Query Parameters
Cursor to paginate through the rules. Provide a cursor value from the response to retrieve the next page.
Page size to paginate through the results.
Whether the finding was validated or not.
- VALIDATION_STATE_UNSPECIFIED: Return results for all validation states (can also omit this parameter).
- VALIDATION_STATE_CONFIRMED_VALID: Secret has been tested and is confirmed valid.
- VALIDATION_STATE_CONFIRMED_INVALID: Secret has been tested and is confirmed invalid.
- VALIDATION_STATE_VALIDATION_ERROR: Secret test was attempted and there was an error.
- VALIDATION_STATE_NO_VALIDATOR: There is no validator for this secret.
VALIDATION_STATE_UNSPECIFIED, VALIDATION_STATE_CONFIRMED_VALID, VALIDATION_STATE_CONFIRMED_INVALID, VALIDATION_STATE_VALIDATION_ERROR, VALIDATION_STATE_NO_VALIDATOR Status of the finding.
- FINDING_STATUS_UNSPECIFIED: Return results for all finding statuses (if used as a parameter).
- FINDING_STATUS_OPEN: Finding is open and needs to be triaged
- FINDING_STATUS_IGNORED: Finding has been triaged and is being ignored
- FINDING_STATUS_FIXED: Finding has been fixed
- FINDING_STATUS_REMOVED: Finding has been removed
- FINDING_STATUS_UNKNOWN: Finding status is unknown
FINDING_STATUS_UNSPECIFIED, FINDING_STATUS_OPEN, FINDING_STATUS_IGNORED, FINDING_STATUS_FIXED, FINDING_STATUS_REMOVED, FINDING_STATUS_UNKNOWN, FINDING_STATUS_PROVISIONALLY_IGNORED Severity of the finding.
- SEVERITY_UNSPECIFIED: Return results for all severities (if used as a parameter).
SEVERITY_UNSPECIFIED, SEVERITY_HIGH, SEVERITY_MEDIUM, SEVERITY_LOW, SEVERITY_CRITICAL Repositories to view results for. If not specified, returns all.
Response
OK
Cursor to paginate through the results.
List of Secrets associated with the given Deployment.
Show child attributes
Show child attributes
{
"cursor": "Pm0ROjIwMjQtMDItMDYgMjA6MDQ6NDguMEDzNzk2fmk6NYTM2zUxOTI=",
"findings": [
{
"confidence": "CONFIDENCE_HIGH",
"createdAt": "2024-06-17T17:23:01.901204Z",
"findingPath": "src/ai.py:232",
"findingPathUrl": "https://github.com/foo/bar/blob/6ad16b240d4b6ae5bd6e326dd71053c21344e311/src/ai.py#L232",
"id": "691234",
"mode": "MODE_MONITOR",
"ref": "refs/pull/148/merge",
"refUrl": "https://github.com/foo/bar/pull/148",
"repository": {
"name": "foo/bar",
"scmType": "SCM_TYPE_GITHUB",
"url": "https://github.com/foo/bar",
"visibility": "REPOSITORY_VISIBILITY_PRIVATE"
},
"reviewComments": [
{
"externalDiscussionId": "af0433345acfb74c8f9",
"externalNoteId": "5678"
}
],
"ruleHashId": "lBU41LA",
"severity": "SEVERITY_HIGH",
"status": "FINDING_STATUS_FIXED",
"type": "OpenAI",
"updatedAt": "2024-06-20T17:33:00.669343Z",
"validationState": "VALIDATION_STATE_CONFIRMED_VALID"
},
{
"confidence": "CONFIDENCE_MEDIUM",
"createdAt": "2024-06-08T11:01:23.380293Z",
"findingPath": "config.yaml:801",
"findingPathUrl": "https://github.com/foo/baz/blob/e2b6d5ca75d830e10f5f617481a66a981bd093c0/config.yaml#L801",
"id": "6881234",
"mode": "MODE_COMMENT",
"ref": "develop",
"refUrl": "https://github.com/foo/baz/tree/develop",
"repository": {
"name": "foo/baz",
"scmType": "SCM_TYPE_GITHUB",
"url": "https://github.com/foo/baz",
"visibility": "REPOSITORY_VISIBILITY_PRIVATE"
},
"reviewComments": [
{
"externalDiscussionId": "af0476223423b74c8f9",
"externalNoteId": "6789"
}
],
"ruleHashId": "pKUYdA",
"severity": "SEVERITY_HIGH",
"status": "FINDING_STATUS_IGNORED",
"type": "Heroku",
"updatedAt": "2024-06-22T11:07:02.384500Z",
"validationState": "VALIDATION_STATE_CONFIRMED_INVALID"
}
]
}
Cursor to paginate backwards through the results.
Was this page helpful?