Skip to main content
PUT
Update Policy Rule

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<int64>
required

The unique numerical identifier of your deployment. Can be found via the Deployments Service or in your Settings in the web UI.

Example:

123

policyId
string<int64>
required

The unique numerical identifier for the policy. Find your policy's ID via the List Policies endpoint.

Example:

456

rulePath
string
required

Uniquely identify the Rule using its full path. Find the Rule's path via the List Policy Rules endpoint or via the Semgrep Registry.

Example:

"python.rule.1"

Body

application/json
policyMode
enum<string>

New policy mode to set for the Rule.

  • MODE_MONITOR: Monitor mode, silently report findings
  • MODE_COMMENT: Comment mode, leaves PR comments but does not block
  • MODE_BLOCK: Block mode, leaves PR comments and blocks PR
  • MODE_DISABLED: Disabled mode, not active
valuedescription
MODE_MONITORMonitor mode, silently report findings
MODE_COMMENTComment mode, leaves PR comments but does not block
MODE_BLOCKBlock mode, leaves PR comments and blocks PR
MODE_DISABLEDDisabled mode, not active
Available options:
MODE_MONITOR,
MODE_COMMENT,
MODE_BLOCK,
MODE_DISABLED

Response

200 - application/json

OK

policyId
string<int64>

Policy ID (numeric). Find your policy's ID via the List Policies endpoint.

Example:

"456"

updatedRule
Rule · object