---
title: "Update policy"
method: PUT
path: "/api/v1/deployments/{deploymentId}/policies/{policyId}"
tags: ["PoliciesService"]
---

# Update policy

`PUT /api/v1/deployments/{deploymentId}/policies/{policyId}`

## Path parameters

- `deploymentId` string, int64, required — Deployment ID (numeric). Example: `123`. Can be found at `/deployments`, or in your Settings in the web UI.
- `policyId` string, int64, required — Policy ID (numeric). Example: `456`. Can be found at `/deployments/{deploymentId}/policies`.

## Request body

- ProtosOpenapiV1UpdatePolicyRequest
  - `deploymentId` string, int64 — Deployment ID (numeric). Example: `123`. Can be found at `/deployments`, or in your Settings in the web UI.
  - `policyId` string, int64 — Policy ID (numeric). Example: `456`. Can be found at `/deployments/{deploymentId}/policies`.
  - `policyMode` 'MODE_MONITOR' | 'MODE_COMMENT' | 'MODE_BLOCK' | 'MODE_DISABLED', enum — 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 | value | description | |-------|---------------| | 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 |
  - `rulePath` string — Full path of the Rule.

## Response `200`

OK

- ProtosOpenapiV1UpdatePolicyResponse
  - `policyId` string, int64 — Policy ID (numeric). Example: `456`. Can be found at `/deployments/{deploymentId}/policies`.
  - `updatedRule` ProtosCommonV1Rule
    - `id` string, int64 — ID of the Rule.
    - `category` string — Category the Rule is associated with.
    - `confidence` 'CONFIDENCE_HIGH' | 'CONFIDENCE_MEDIUM' | 'CONFIDENCE_LOW', enum — Confidence based on the Rule's false-positive rate. | value | description | |-------|---------------| | CONFIDENCE_HIGH | | | CONFIDENCE_MEDIUM | | | CONFIDENCE_LOW | |
    - `cweCategories` string[] — The CWE associated with the Rule.
    - `hasValidators` boolean — When True, the secrets rule has validators.
    - `languages` string[] — Languages the Rule applies to.
    - `lastChangeAt` string, date-time — Timestamp of when the Rule was last changed.
    - `lastChangeBy` string — Username of who last changed the Rule.
    - `owaspCategories` string[] — Owasp categories the Rule is associated with.
    - `path` string — Full path of the Rule.
    - `policyMode` 'MODE_MONITOR' | 'MODE_COMMENT' | 'MODE_BLOCK' | 'MODE_DISABLED', enum — Mode behavior: Monitor / Comment / Block / Disabled | value | description | |-------|---------------| | 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 |
    - `registryMaintainer` string — The Registry maintainer associated with the Rule (if applicable).
    - `rulesets` string[] — Rulesets to which the Rule belongs (if applicable).
    - `secretType` string — The secret type (if applicable).
    - `severity` 'SEVERITY_HIGH' | 'SEVERITY_MEDIUM' | 'SEVERITY_LOW' | 'SEVERITY_CRITICAL', enum — Severity level ("seriousness" of the finding) | value | description | |-------|---------------| | SEVERITY_HIGH | | | SEVERITY_MEDIUM | | | SEVERITY_LOW | | | SEVERITY_CRITICAL | |
    - `source` 'SOURCE_PRO' | 'SOURCE_COMMUNITY' | 'SOURCE_CUSTOM', enum — Source of the Rule | value | description | |-------|---------------| | SOURCE_PRO | From Pro rules | | SOURCE_COMMUNITY | From Semgrep Community rules | | SOURCE_CUSTOM | From Custom rules |
    - `technologies` string[] — Technologies the Rule is associated with.
    - `url` string — The URL of the Rule.
    - `vulnerabilityClass` string[] — Vulnerability classes the Rule is associated with.

---

[API](https://skmtc.net/semgrep/apis/semgrep-web-app.md) · [All operations](https://skmtc.net/semgrep/apis/semgrep-web-app/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/semgrep/semgrep-web-app/revisions/6483eeecd582/schema)
