curl --request POST \
--url https://semgrep.dev/api/v1/deployments/{deploymentSlug}/tickets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"issue_type": "sca",
"autotriage_verdict": "true_positive",
"categories": [
"security",
"performance"
],
"component_tags": [
"user authentication",
"user data"
],
"confidence": "high",
"dependencies": [
"lodash",
"express"
],
"deploymentSlug": "<string>",
"epss_probability": [
"high",
"medium"
],
"exposures": [
"reachable",
"always_reachable"
],
"group_issues": true,
"include_historical": true,
"issue_ids": [
123,
456
],
"jira_project_id": 12345,
"limit": 20,
"policies": [
"rule-board-block",
"rule-board-pr-comments",
"rule-board-audit"
],
"policy_mode": [
"monitor",
"block"
],
"pro_only": true,
"project_tags": [
"my_project_tag_1",
"my_project_tag_2"
],
"ref": "refs/pull/1234/merge",
"repos": [
"myorg/repo1",
"myorg/repo2"
],
"repository_visibility": [
"public",
"private"
],
"rules": [
"typescript.react.security.audit.react-no-refs.react-no-refs",
"ajinabraham.njsscan.hardcoded_secrets.node_username"
],
"ruleset": [
"owasp-top-ten",
"default"
],
"secret_types": [
"Github",
"Heroku",
"AWS"
],
"severities": [
"low",
"high"
],
"since": 1717334400,
"status": "open",
"transitivities": [
"transitive",
"direct"
],
"triage_reasons": [
"acceptable_risk",
"false_positive"
],
"validation_state": [
"valid",
"invalid"
]
}
'import requests
url = "https://semgrep.dev/api/v1/deployments/{deploymentSlug}/tickets"
payload = {
"issue_type": "sca",
"autotriage_verdict": "true_positive",
"categories": ["security", "performance"],
"component_tags": ["user authentication", "user data"],
"confidence": "high",
"dependencies": ["lodash", "express"],
"deploymentSlug": "<string>",
"epss_probability": ["high", "medium"],
"exposures": ["reachable", "always_reachable"],
"group_issues": True,
"include_historical": True,
"issue_ids": [123, 456],
"jira_project_id": 12345,
"limit": 20,
"policies": ["rule-board-block", "rule-board-pr-comments", "rule-board-audit"],
"policy_mode": ["monitor", "block"],
"pro_only": True,
"project_tags": ["my_project_tag_1", "my_project_tag_2"],
"ref": "refs/pull/1234/merge",
"repos": ["myorg/repo1", "myorg/repo2"],
"repository_visibility": ["public", "private"],
"rules": ["typescript.react.security.audit.react-no-refs.react-no-refs", "ajinabraham.njsscan.hardcoded_secrets.node_username"],
"ruleset": ["owasp-top-ten", "default"],
"secret_types": ["Github", "Heroku", "AWS"],
"severities": ["low", "high"],
"since": 1717334400,
"status": "open",
"transitivities": ["transitive", "direct"],
"triage_reasons": ["acceptable_risk", "false_positive"],
"validation_state": ["valid", "invalid"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
issue_type: 'sca',
autotriage_verdict: 'true_positive',
categories: ['security', 'performance'],
component_tags: ['user authentication', 'user data'],
confidence: 'high',
dependencies: ['lodash', 'express'],
deploymentSlug: '<string>',
epss_probability: ['high', 'medium'],
exposures: ['reachable', 'always_reachable'],
group_issues: true,
include_historical: true,
issue_ids: [123, 456],
jira_project_id: 12345,
limit: 20,
policies: ['rule-board-block', 'rule-board-pr-comments', 'rule-board-audit'],
policy_mode: ['monitor', 'block'],
pro_only: true,
project_tags: ['my_project_tag_1', 'my_project_tag_2'],
ref: 'refs/pull/1234/merge',
repos: ['myorg/repo1', 'myorg/repo2'],
repository_visibility: ['public', 'private'],
rules: [
'typescript.react.security.audit.react-no-refs.react-no-refs',
'ajinabraham.njsscan.hardcoded_secrets.node_username'
],
ruleset: ['owasp-top-ten', 'default'],
secret_types: ['Github', 'Heroku', 'AWS'],
severities: ['low', 'high'],
since: 1717334400,
status: 'open',
transitivities: ['transitive', 'direct'],
triage_reasons: ['acceptable_risk', 'false_positive'],
validation_state: ['valid', 'invalid']
})
};
fetch('https://semgrep.dev/api/v1/deployments/{deploymentSlug}/tickets', 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/{deploymentSlug}/tickets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'issue_type' => 'sca',
'autotriage_verdict' => 'true_positive',
'categories' => [
'security',
'performance'
],
'component_tags' => [
'user authentication',
'user data'
],
'confidence' => 'high',
'dependencies' => [
'lodash',
'express'
],
'deploymentSlug' => '<string>',
'epss_probability' => [
'high',
'medium'
],
'exposures' => [
'reachable',
'always_reachable'
],
'group_issues' => true,
'include_historical' => true,
'issue_ids' => [
123,
456
],
'jira_project_id' => 12345,
'limit' => 20,
'policies' => [
'rule-board-block',
'rule-board-pr-comments',
'rule-board-audit'
],
'policy_mode' => [
'monitor',
'block'
],
'pro_only' => true,
'project_tags' => [
'my_project_tag_1',
'my_project_tag_2'
],
'ref' => 'refs/pull/1234/merge',
'repos' => [
'myorg/repo1',
'myorg/repo2'
],
'repository_visibility' => [
'public',
'private'
],
'rules' => [
'typescript.react.security.audit.react-no-refs.react-no-refs',
'ajinabraham.njsscan.hardcoded_secrets.node_username'
],
'ruleset' => [
'owasp-top-ten',
'default'
],
'secret_types' => [
'Github',
'Heroku',
'AWS'
],
'severities' => [
'low',
'high'
],
'since' => 1717334400,
'status' => 'open',
'transitivities' => [
'transitive',
'direct'
],
'triage_reasons' => [
'acceptable_risk',
'false_positive'
],
'validation_state' => [
'valid',
'invalid'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://semgrep.dev/api/v1/deployments/{deploymentSlug}/tickets"
payload := strings.NewReader("{\n \"issue_type\": \"sca\",\n \"autotriage_verdict\": \"true_positive\",\n \"categories\": [\n \"security\",\n \"performance\"\n ],\n \"component_tags\": [\n \"user authentication\",\n \"user data\"\n ],\n \"confidence\": \"high\",\n \"dependencies\": [\n \"lodash\",\n \"express\"\n ],\n \"deploymentSlug\": \"<string>\",\n \"epss_probability\": [\n \"high\",\n \"medium\"\n ],\n \"exposures\": [\n \"reachable\",\n \"always_reachable\"\n ],\n \"group_issues\": true,\n \"include_historical\": true,\n \"issue_ids\": [\n 123,\n 456\n ],\n \"jira_project_id\": 12345,\n \"limit\": 20,\n \"policies\": [\n \"rule-board-block\",\n \"rule-board-pr-comments\",\n \"rule-board-audit\"\n ],\n \"policy_mode\": [\n \"monitor\",\n \"block\"\n ],\n \"pro_only\": true,\n \"project_tags\": [\n \"my_project_tag_1\",\n \"my_project_tag_2\"\n ],\n \"ref\": \"refs/pull/1234/merge\",\n \"repos\": [\n \"myorg/repo1\",\n \"myorg/repo2\"\n ],\n \"repository_visibility\": [\n \"public\",\n \"private\"\n ],\n \"rules\": [\n \"typescript.react.security.audit.react-no-refs.react-no-refs\",\n \"ajinabraham.njsscan.hardcoded_secrets.node_username\"\n ],\n \"ruleset\": [\n \"owasp-top-ten\",\n \"default\"\n ],\n \"secret_types\": [\n \"Github\",\n \"Heroku\",\n \"AWS\"\n ],\n \"severities\": [\n \"low\",\n \"high\"\n ],\n \"since\": 1717334400,\n \"status\": \"open\",\n \"transitivities\": [\n \"transitive\",\n \"direct\"\n ],\n \"triage_reasons\": [\n \"acceptable_risk\",\n \"false_positive\"\n ],\n \"validation_state\": [\n \"valid\",\n \"invalid\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://semgrep.dev/api/v1/deployments/{deploymentSlug}/tickets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"issue_type\": \"sca\",\n \"autotriage_verdict\": \"true_positive\",\n \"categories\": [\n \"security\",\n \"performance\"\n ],\n \"component_tags\": [\n \"user authentication\",\n \"user data\"\n ],\n \"confidence\": \"high\",\n \"dependencies\": [\n \"lodash\",\n \"express\"\n ],\n \"deploymentSlug\": \"<string>\",\n \"epss_probability\": [\n \"high\",\n \"medium\"\n ],\n \"exposures\": [\n \"reachable\",\n \"always_reachable\"\n ],\n \"group_issues\": true,\n \"include_historical\": true,\n \"issue_ids\": [\n 123,\n 456\n ],\n \"jira_project_id\": 12345,\n \"limit\": 20,\n \"policies\": [\n \"rule-board-block\",\n \"rule-board-pr-comments\",\n \"rule-board-audit\"\n ],\n \"policy_mode\": [\n \"monitor\",\n \"block\"\n ],\n \"pro_only\": true,\n \"project_tags\": [\n \"my_project_tag_1\",\n \"my_project_tag_2\"\n ],\n \"ref\": \"refs/pull/1234/merge\",\n \"repos\": [\n \"myorg/repo1\",\n \"myorg/repo2\"\n ],\n \"repository_visibility\": [\n \"public\",\n \"private\"\n ],\n \"rules\": [\n \"typescript.react.security.audit.react-no-refs.react-no-refs\",\n \"ajinabraham.njsscan.hardcoded_secrets.node_username\"\n ],\n \"ruleset\": [\n \"owasp-top-ten\",\n \"default\"\n ],\n \"secret_types\": [\n \"Github\",\n \"Heroku\",\n \"AWS\"\n ],\n \"severities\": [\n \"low\",\n \"high\"\n ],\n \"since\": 1717334400,\n \"status\": \"open\",\n \"transitivities\": [\n \"transitive\",\n \"direct\"\n ],\n \"triage_reasons\": [\n \"acceptable_risk\",\n \"false_positive\"\n ],\n \"validation_state\": [\n \"valid\",\n \"invalid\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://semgrep.dev/api/v1/deployments/{deploymentSlug}/tickets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"issue_type\": \"sca\",\n \"autotriage_verdict\": \"true_positive\",\n \"categories\": [\n \"security\",\n \"performance\"\n ],\n \"component_tags\": [\n \"user authentication\",\n \"user data\"\n ],\n \"confidence\": \"high\",\n \"dependencies\": [\n \"lodash\",\n \"express\"\n ],\n \"deploymentSlug\": \"<string>\",\n \"epss_probability\": [\n \"high\",\n \"medium\"\n ],\n \"exposures\": [\n \"reachable\",\n \"always_reachable\"\n ],\n \"group_issues\": true,\n \"include_historical\": true,\n \"issue_ids\": [\n 123,\n 456\n ],\n \"jira_project_id\": 12345,\n \"limit\": 20,\n \"policies\": [\n \"rule-board-block\",\n \"rule-board-pr-comments\",\n \"rule-board-audit\"\n ],\n \"policy_mode\": [\n \"monitor\",\n \"block\"\n ],\n \"pro_only\": true,\n \"project_tags\": [\n \"my_project_tag_1\",\n \"my_project_tag_2\"\n ],\n \"ref\": \"refs/pull/1234/merge\",\n \"repos\": [\n \"myorg/repo1\",\n \"myorg/repo2\"\n ],\n \"repository_visibility\": [\n \"public\",\n \"private\"\n ],\n \"rules\": [\n \"typescript.react.security.audit.react-no-refs.react-no-refs\",\n \"ajinabraham.njsscan.hardcoded_secrets.node_username\"\n ],\n \"ruleset\": [\n \"owasp-top-ten\",\n \"default\"\n ],\n \"secret_types\": [\n \"Github\",\n \"Heroku\",\n \"AWS\"\n ],\n \"severities\": [\n \"low\",\n \"high\"\n ],\n \"since\": 1717334400,\n \"status\": \"open\",\n \"transitivities\": [\n \"transitive\",\n \"direct\"\n ],\n \"triage_reasons\": [\n \"acceptable_risk\",\n \"false_positive\"\n ],\n \"validation_state\": [\n \"valid\",\n \"invalid\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"failed": [
{
"error": "<string>",
"issue_ids": [
123
]
}
],
"skipped": [
{
"issue_ids": [
123
],
"reason": "<string>"
}
],
"succeeded": [
{
"external_slug": "<string>",
"issue_ids": [
123
],
"ticket_id": 123,
"ticket_url": "<string>"
}
]
}Create Jira tickets
Create Jira tickets for your findings. You can create tickets by passing in a list of issue_ids or by passing in filter query parameters to dynamically select findings. If passing in filters, Semgrep will skip already ticketed findings. This endpoint is synchronous, so it may take some time for your request to resolve. Unlike creating tickets in-app, if ticket creation fails we won’t automatically retry. This endpoint accepts a limit parameter (defaulting to 20) to limit the number of tickets created per request. If you specify a list of issue_ids greater than this limit, or your selected filters match on a number of issues greater than this limit, issues that were not ticketed are included in the Failed part of the response object. You can send another request to create tickets for these skipped issues. By default, findings belonging to the same repository and the same rule will be grouped together into a single Jira ticket. You can override this using the group_issues query parameter. Up to 50 issues can be grouped into a single ticket. You can optionally override the Jira project you create tickets in by passing in a Jira project ID as jira_project_id (the numeric ID rather than the project key). You can fetch this ID using the Jira API.
curl --request POST \
--url https://semgrep.dev/api/v1/deployments/{deploymentSlug}/tickets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"issue_type": "sca",
"autotriage_verdict": "true_positive",
"categories": [
"security",
"performance"
],
"component_tags": [
"user authentication",
"user data"
],
"confidence": "high",
"dependencies": [
"lodash",
"express"
],
"deploymentSlug": "<string>",
"epss_probability": [
"high",
"medium"
],
"exposures": [
"reachable",
"always_reachable"
],
"group_issues": true,
"include_historical": true,
"issue_ids": [
123,
456
],
"jira_project_id": 12345,
"limit": 20,
"policies": [
"rule-board-block",
"rule-board-pr-comments",
"rule-board-audit"
],
"policy_mode": [
"monitor",
"block"
],
"pro_only": true,
"project_tags": [
"my_project_tag_1",
"my_project_tag_2"
],
"ref": "refs/pull/1234/merge",
"repos": [
"myorg/repo1",
"myorg/repo2"
],
"repository_visibility": [
"public",
"private"
],
"rules": [
"typescript.react.security.audit.react-no-refs.react-no-refs",
"ajinabraham.njsscan.hardcoded_secrets.node_username"
],
"ruleset": [
"owasp-top-ten",
"default"
],
"secret_types": [
"Github",
"Heroku",
"AWS"
],
"severities": [
"low",
"high"
],
"since": 1717334400,
"status": "open",
"transitivities": [
"transitive",
"direct"
],
"triage_reasons": [
"acceptable_risk",
"false_positive"
],
"validation_state": [
"valid",
"invalid"
]
}
'import requests
url = "https://semgrep.dev/api/v1/deployments/{deploymentSlug}/tickets"
payload = {
"issue_type": "sca",
"autotriage_verdict": "true_positive",
"categories": ["security", "performance"],
"component_tags": ["user authentication", "user data"],
"confidence": "high",
"dependencies": ["lodash", "express"],
"deploymentSlug": "<string>",
"epss_probability": ["high", "medium"],
"exposures": ["reachable", "always_reachable"],
"group_issues": True,
"include_historical": True,
"issue_ids": [123, 456],
"jira_project_id": 12345,
"limit": 20,
"policies": ["rule-board-block", "rule-board-pr-comments", "rule-board-audit"],
"policy_mode": ["monitor", "block"],
"pro_only": True,
"project_tags": ["my_project_tag_1", "my_project_tag_2"],
"ref": "refs/pull/1234/merge",
"repos": ["myorg/repo1", "myorg/repo2"],
"repository_visibility": ["public", "private"],
"rules": ["typescript.react.security.audit.react-no-refs.react-no-refs", "ajinabraham.njsscan.hardcoded_secrets.node_username"],
"ruleset": ["owasp-top-ten", "default"],
"secret_types": ["Github", "Heroku", "AWS"],
"severities": ["low", "high"],
"since": 1717334400,
"status": "open",
"transitivities": ["transitive", "direct"],
"triage_reasons": ["acceptable_risk", "false_positive"],
"validation_state": ["valid", "invalid"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
issue_type: 'sca',
autotriage_verdict: 'true_positive',
categories: ['security', 'performance'],
component_tags: ['user authentication', 'user data'],
confidence: 'high',
dependencies: ['lodash', 'express'],
deploymentSlug: '<string>',
epss_probability: ['high', 'medium'],
exposures: ['reachable', 'always_reachable'],
group_issues: true,
include_historical: true,
issue_ids: [123, 456],
jira_project_id: 12345,
limit: 20,
policies: ['rule-board-block', 'rule-board-pr-comments', 'rule-board-audit'],
policy_mode: ['monitor', 'block'],
pro_only: true,
project_tags: ['my_project_tag_1', 'my_project_tag_2'],
ref: 'refs/pull/1234/merge',
repos: ['myorg/repo1', 'myorg/repo2'],
repository_visibility: ['public', 'private'],
rules: [
'typescript.react.security.audit.react-no-refs.react-no-refs',
'ajinabraham.njsscan.hardcoded_secrets.node_username'
],
ruleset: ['owasp-top-ten', 'default'],
secret_types: ['Github', 'Heroku', 'AWS'],
severities: ['low', 'high'],
since: 1717334400,
status: 'open',
transitivities: ['transitive', 'direct'],
triage_reasons: ['acceptable_risk', 'false_positive'],
validation_state: ['valid', 'invalid']
})
};
fetch('https://semgrep.dev/api/v1/deployments/{deploymentSlug}/tickets', 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/{deploymentSlug}/tickets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'issue_type' => 'sca',
'autotriage_verdict' => 'true_positive',
'categories' => [
'security',
'performance'
],
'component_tags' => [
'user authentication',
'user data'
],
'confidence' => 'high',
'dependencies' => [
'lodash',
'express'
],
'deploymentSlug' => '<string>',
'epss_probability' => [
'high',
'medium'
],
'exposures' => [
'reachable',
'always_reachable'
],
'group_issues' => true,
'include_historical' => true,
'issue_ids' => [
123,
456
],
'jira_project_id' => 12345,
'limit' => 20,
'policies' => [
'rule-board-block',
'rule-board-pr-comments',
'rule-board-audit'
],
'policy_mode' => [
'monitor',
'block'
],
'pro_only' => true,
'project_tags' => [
'my_project_tag_1',
'my_project_tag_2'
],
'ref' => 'refs/pull/1234/merge',
'repos' => [
'myorg/repo1',
'myorg/repo2'
],
'repository_visibility' => [
'public',
'private'
],
'rules' => [
'typescript.react.security.audit.react-no-refs.react-no-refs',
'ajinabraham.njsscan.hardcoded_secrets.node_username'
],
'ruleset' => [
'owasp-top-ten',
'default'
],
'secret_types' => [
'Github',
'Heroku',
'AWS'
],
'severities' => [
'low',
'high'
],
'since' => 1717334400,
'status' => 'open',
'transitivities' => [
'transitive',
'direct'
],
'triage_reasons' => [
'acceptable_risk',
'false_positive'
],
'validation_state' => [
'valid',
'invalid'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://semgrep.dev/api/v1/deployments/{deploymentSlug}/tickets"
payload := strings.NewReader("{\n \"issue_type\": \"sca\",\n \"autotriage_verdict\": \"true_positive\",\n \"categories\": [\n \"security\",\n \"performance\"\n ],\n \"component_tags\": [\n \"user authentication\",\n \"user data\"\n ],\n \"confidence\": \"high\",\n \"dependencies\": [\n \"lodash\",\n \"express\"\n ],\n \"deploymentSlug\": \"<string>\",\n \"epss_probability\": [\n \"high\",\n \"medium\"\n ],\n \"exposures\": [\n \"reachable\",\n \"always_reachable\"\n ],\n \"group_issues\": true,\n \"include_historical\": true,\n \"issue_ids\": [\n 123,\n 456\n ],\n \"jira_project_id\": 12345,\n \"limit\": 20,\n \"policies\": [\n \"rule-board-block\",\n \"rule-board-pr-comments\",\n \"rule-board-audit\"\n ],\n \"policy_mode\": [\n \"monitor\",\n \"block\"\n ],\n \"pro_only\": true,\n \"project_tags\": [\n \"my_project_tag_1\",\n \"my_project_tag_2\"\n ],\n \"ref\": \"refs/pull/1234/merge\",\n \"repos\": [\n \"myorg/repo1\",\n \"myorg/repo2\"\n ],\n \"repository_visibility\": [\n \"public\",\n \"private\"\n ],\n \"rules\": [\n \"typescript.react.security.audit.react-no-refs.react-no-refs\",\n \"ajinabraham.njsscan.hardcoded_secrets.node_username\"\n ],\n \"ruleset\": [\n \"owasp-top-ten\",\n \"default\"\n ],\n \"secret_types\": [\n \"Github\",\n \"Heroku\",\n \"AWS\"\n ],\n \"severities\": [\n \"low\",\n \"high\"\n ],\n \"since\": 1717334400,\n \"status\": \"open\",\n \"transitivities\": [\n \"transitive\",\n \"direct\"\n ],\n \"triage_reasons\": [\n \"acceptable_risk\",\n \"false_positive\"\n ],\n \"validation_state\": [\n \"valid\",\n \"invalid\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://semgrep.dev/api/v1/deployments/{deploymentSlug}/tickets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"issue_type\": \"sca\",\n \"autotriage_verdict\": \"true_positive\",\n \"categories\": [\n \"security\",\n \"performance\"\n ],\n \"component_tags\": [\n \"user authentication\",\n \"user data\"\n ],\n \"confidence\": \"high\",\n \"dependencies\": [\n \"lodash\",\n \"express\"\n ],\n \"deploymentSlug\": \"<string>\",\n \"epss_probability\": [\n \"high\",\n \"medium\"\n ],\n \"exposures\": [\n \"reachable\",\n \"always_reachable\"\n ],\n \"group_issues\": true,\n \"include_historical\": true,\n \"issue_ids\": [\n 123,\n 456\n ],\n \"jira_project_id\": 12345,\n \"limit\": 20,\n \"policies\": [\n \"rule-board-block\",\n \"rule-board-pr-comments\",\n \"rule-board-audit\"\n ],\n \"policy_mode\": [\n \"monitor\",\n \"block\"\n ],\n \"pro_only\": true,\n \"project_tags\": [\n \"my_project_tag_1\",\n \"my_project_tag_2\"\n ],\n \"ref\": \"refs/pull/1234/merge\",\n \"repos\": [\n \"myorg/repo1\",\n \"myorg/repo2\"\n ],\n \"repository_visibility\": [\n \"public\",\n \"private\"\n ],\n \"rules\": [\n \"typescript.react.security.audit.react-no-refs.react-no-refs\",\n \"ajinabraham.njsscan.hardcoded_secrets.node_username\"\n ],\n \"ruleset\": [\n \"owasp-top-ten\",\n \"default\"\n ],\n \"secret_types\": [\n \"Github\",\n \"Heroku\",\n \"AWS\"\n ],\n \"severities\": [\n \"low\",\n \"high\"\n ],\n \"since\": 1717334400,\n \"status\": \"open\",\n \"transitivities\": [\n \"transitive\",\n \"direct\"\n ],\n \"triage_reasons\": [\n \"acceptable_risk\",\n \"false_positive\"\n ],\n \"validation_state\": [\n \"valid\",\n \"invalid\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://semgrep.dev/api/v1/deployments/{deploymentSlug}/tickets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"issue_type\": \"sca\",\n \"autotriage_verdict\": \"true_positive\",\n \"categories\": [\n \"security\",\n \"performance\"\n ],\n \"component_tags\": [\n \"user authentication\",\n \"user data\"\n ],\n \"confidence\": \"high\",\n \"dependencies\": [\n \"lodash\",\n \"express\"\n ],\n \"deploymentSlug\": \"<string>\",\n \"epss_probability\": [\n \"high\",\n \"medium\"\n ],\n \"exposures\": [\n \"reachable\",\n \"always_reachable\"\n ],\n \"group_issues\": true,\n \"include_historical\": true,\n \"issue_ids\": [\n 123,\n 456\n ],\n \"jira_project_id\": 12345,\n \"limit\": 20,\n \"policies\": [\n \"rule-board-block\",\n \"rule-board-pr-comments\",\n \"rule-board-audit\"\n ],\n \"policy_mode\": [\n \"monitor\",\n \"block\"\n ],\n \"pro_only\": true,\n \"project_tags\": [\n \"my_project_tag_1\",\n \"my_project_tag_2\"\n ],\n \"ref\": \"refs/pull/1234/merge\",\n \"repos\": [\n \"myorg/repo1\",\n \"myorg/repo2\"\n ],\n \"repository_visibility\": [\n \"public\",\n \"private\"\n ],\n \"rules\": [\n \"typescript.react.security.audit.react-no-refs.react-no-refs\",\n \"ajinabraham.njsscan.hardcoded_secrets.node_username\"\n ],\n \"ruleset\": [\n \"owasp-top-ten\",\n \"default\"\n ],\n \"secret_types\": [\n \"Github\",\n \"Heroku\",\n \"AWS\"\n ],\n \"severities\": [\n \"low\",\n \"high\"\n ],\n \"since\": 1717334400,\n \"status\": \"open\",\n \"transitivities\": [\n \"transitive\",\n \"direct\"\n ],\n \"triage_reasons\": [\n \"acceptable_risk\",\n \"false_positive\"\n ],\n \"validation_state\": [\n \"valid\",\n \"invalid\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"failed": [
{
"error": "<string>",
"issue_ids": [
123
]
}
],
"skipped": [
{
"issue_ids": [
123
],
"reason": "<string>"
}
],
"succeeded": [
{
"external_slug": "<string>",
"issue_ids": [
123
],
"ticket_id": 123,
"ticket_url": "<string>"
}
]
}Authorizations
Path Parameters
Body
Create ticket request
Filter by exposure (reachability type). Only applies for sca findings. Reachability is the ability of an attacker to access a vulnerability in a system.
reachable, always_reachable, conditionally_reachable, unpinned_dependency, unreachable, unknown ["reachable", "always_reachable"]
Response
OK
Was this page helpful?