---
title: "Update policy rule"
method: PATCH
path: "/policy/rule/{id}"
tags: ["Policy"]
---

# Update policy rule

`PATCH /policy/rule/{id}`

## Request

- Base URL: `/v1` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/v1/policy/rule/{id}`
- Auth: none declared. Required headers: `X-Auth-Token`
- TypeScript: <https://skmtc.dev/neuvector/apis/neuvector-api/docs/policy/rule/:id/patch.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `id` integer, required

## Headers

- `X-Auth-Token` string, required

## Request body

- RESTPolicyRuleConfigData
  - `config` RESTPolicyRuleConfig, required
    - `id` integer, required
    - `comment` string
    - `from` string
    - `to` string
    - `ports` string
    - `action` string
    - `applications` string[]
    - `disable` boolean
    - `cfg_type` string, required: CfgTypeLearned / CfgTypeUserCreated / CfgTypeGround / CfgTypeFederal
    - `priority` integer
  - `replicate` boolean

## Response `200`

Success

---

[API](https://skmtc.dev/neuvector/apis/neuvector-api.md) - [All operations](https://skmtc.dev/neuvector/apis/neuvector-api/llms.txt) - [OpenAPI document](https://skmtc.dev/neuvector/apis/neuvector-api/revisions/b8d8d28840b3?raw)
