---
title: "更新微规则"
method: PUT
path: "/api/v1/micro-rules/{id}"
tags: ["规则管理"]
---

# 更新微规则

`PUT /api/v1/micro-rules/{id}`

更新指定微规则的信息，系统默认规则不允许修改

## Path parameters

- `id` string, required

## Request body

- DtoMicroRuleUpdateRequest — 更新微规则的请求参数
  - `condition` object — 规则条件
  - `name` string — 规则名称
  - `priority` integer — 优先级字段，数字越大优先级越高
  - `status` 'enabled' | 'disabled' — 规则状态
  - `type` 'whitelist' | 'blacklist' — 规则类型

## Response `200`

微规则更新成功

- object — 成功的API响应标准格式
  - `code` integer
  - `data` DtoMicroRuleResponse — 微规则响应参数
    - `condition` object — 规则条件
    - `id` string
    - `name` string — 规则名称
    - `priority` integer — 优先级字段，数字越大优先级越高
    - `status` 'enabled' | 'disabled' — 规则状态
    - `type` 'whitelist' | 'blacklist' — 规则类型
  - `message` string
  - `requestId` string
  - `success` boolean
  - `timestamp` string

## Other responses

- `400` — 请求参数错误
- `401` — 未授权访问
- `403` — 禁止修改系统默认规则
- `404` — 微规则不存在
- `409` — 微规则名称已存在
- `500` — 服务器内部错误

---

[API](https://skmtc.net/labring/apis/ruiqi-waf-api.md) · [All operations](https://skmtc.net/labring/apis/ruiqi-waf-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/labring/ruiqi-waf-api/revisions/aaacd7e06a88/schema)
