---
title: "Change the password on a user that already exists."
method: PUT
path: "/users/{user_id}/password"
tags: ["user"]
---

# Change the password on a user that already exists.

`PUT /users/{user_id}/password`

This endpoint is for user to update password. Users with the admin role can change any user's password. Regular users can change only their own password.

## Path parameters

- `user_id` integer, required

## Headers

- `X-Request-Id` string

## Request body

- PasswordReq
  - `old_password` string — The user's existing password.
  - `new_password` string — New password for marking as to be updated.

## Response `200`

Success

## Other responses

- `400` — Invalid user ID; Password does not meet requirement
- `401` — Unauthorized
- `403` — The caller does not have permission to update the password of the user with given ID, or the old password in request body is not correct.
- `500` — Internal server error

---

[API](https://skmtc.dev/cerit/apis/harbor-api.md) · [All operations](https://skmtc.dev/cerit/apis/harbor-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cerit/harbor-api/revisions/62d78801f8df/schema)
