---
title: "更新用户信息"
method: PUT
path: "/users/{id}"
tags: ["用户管理"]
---

# 更新用户信息

`PUT /users/{id}`

管理员更新指定用户的信息

## Path parameters

- `id` string, required

## Request body

- DtoUserUpdateRequest
  - `needReset` boolean
  - `password` string
  - `role` 'admin' | 'auditor' | 'configurator' | 'user'
  - `username` string

## Response `200`

用户更新成功

- ModelAPIResponse — API响应的标准格式
  - `code` integer — HTTP状态码
  - `data` unknown
  - `error` string — 错误信息(当success=false时)
  - `message` string — 响应消息
  - `requestId` string — 请求ID，用于跟踪
  - `success` boolean — 是否成功
  - `timestamp` string — 响应时间戳

## Other responses

- `400` — 请求参数错误
- `401` — 未授权访问
- `403` — 禁止访问
- `404` — 用户不存在
- `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/versions/aaacd7e06a88/schema)
