UpdateUser - 更新用户信息

通过 OpenAPI 更新用户信息。

适用版本

企业专属版

服务接入点

获取服务接入点,替换 API 请求语法中的 {domain}

授权信息

产品

资源

所需权限

组织管理

用户

读写

请求语法

PUT https://{domain}/oapi/v1/platform/users/{idOrUsername}

请求说明

通过 id 更新用户

curl -X 'PUT' \
  'https://test-domain-***.rdc.aliyuncs.com/oapi/v1/platform/users/029844f4-46cb-47b0-9db4-06c68eaf****' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "name": "文档测试用户11",
        "password": "password***",
        "email": "doc-test11@example.com",
        "nickName": "昵称11",
        "staffId": "10011",
        "sysDeptIds": ["ebeb5a64-c98c-478a-9d9d-513841da****"]
    }'

通过 Username 更新用户

curl -X 'PUT' \
  'https://test-domain-***.rdc.aliyuncs.com/oapi/v1/platform/users/doc-test11' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "name": "文档测试用户11",
        "password": "password***",
        "email": "doc-test11@example.com",
        "nickName": "昵称11",
        "staffId": "10011",
        "sysDeptIds": ["ebeb5a64-c98c-478a-9d9d-513841da****"]
    }'

请求头(Headers)

x-yunxiao-token string (必选)

个人访问令牌。您可参考个人访问令牌获取。

示例:pt-0fh3****0fbG_35af****0484。

请求参数

idOrUsername string 必选

用户 ID 或登录账号名。

只需传入一种即可。

name string (可选)

显示用户名。

password string (可选)

密码。

email string (可选)

邮箱。

nickName string (可选)

昵称。

staffId string (可选)

工号。

sysDeptIds array[string] (可选)

所属部门。

返回参数

返回示例

{
    "id": "029844f4-46cb-47b0-9db4-06c68eaf****",
    "username": "doc-test11",
    "name": "文档测试用户11",
    "nickName": "昵称11",
    "email": "doc-test11@example.com",
    "staffId": "10011",
    "createdAt": "2025-06-13T05:41:36Z"
}

id string

部门 ID。

username string

登录账号名。

name string

显示名称。

nickName string

昵称。

email string

邮箱。

staffId string

工号。

createdAt string

创建时间。

错误码

访问错误码中心查看 API 相关错误码。