---
title: "Update user"
method: PUT
path: "/api/user"
tags: ["user"]
---

# Update user

`PUT /api/user`

This function is an API endpoint that updates a user.<br> Normal user can only update themselves, admin can update any user.<br>

## Parameters

- `request`: A JSON object containing the updated user information.

## Returns

If successful, this function returns a `Json<UsersResponse>` object containing the updated user information.

## Request body

- UpdateUserRequest
  - `uuid` string, required
  - `name` string, nullable
  - `password` string, nullable
  - `confirm-password` string, nullable
  - `email` string, nullable
  - `is_admin` boolean, nullable
  - `group_name` string, nullable
  - `note` string, nullable
  - `status` integer, nullable

## Response `200`

- UsersResponse
  - `msg` string, required
  - `total` integer, required
  - `data` string, required

## Other responses

- `401`

## Changes

- **2024-05-22** `71c0d469fb17` — 1 breaking
  - added the new required request property `uuid`
- **2024-05-20** `b66a109db88a` — 2 info
  - api tag `user` added
  - api tag `User` removed
- **2024-05-19** `fafd43b82c78` — 1 warning, 2 info
  - removed the request property `uuid`
  - api tag `User` added
  - api tag `user` removed

[Change history](https://skmtc.dev/nesaku/apis/sctgdesk-api-server/changes/api/user/put.md)

---

[API](https://skmtc.dev/nesaku/apis/sctgdesk-api-server.md) · [All operations](https://skmtc.dev/nesaku/apis/sctgdesk-api-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nesaku/sctgdesk-api-server/revisions/0388fec8a751/schema)
