---
search:
  tags:
    - Users
    - POST
seo:
  description: >-
    Admin only. Sets a new password for one user without knowing the… Reference
    for the POST /api/v1/users/{userId}/reset-password endpoint in the
    PharmaFlow API.
sidebar:
  label: Reset a user's password
  badge: POST
title: Reset a user's password
type: openapi-operation
---
Admin only. Sets a new password for one user without knowing the old one. The confirmation has to match, and the update is written to the audit trail as a reset.

`POST /api/v1/users/{userId}/reset-password`

**Request body** (`application/json`, required)

- `new_password` (string, required)
- `confirm_password` (string, required)

Request body example:

```json
{
  "new_password": "string",
  "confirm_password": "string"
}
```

**Responses**

- `200` — Password reset
- `400` — Password must contain at least 8 characters, or the confirmation does not match
- `401` — Not authenticated
- `403` — Caller is not an admin
- `404` — User not found

Response example, 200:

```json
{
  "id": "string",
  "branch_id": "string",
  "email": "string",
  "full_name": "string",
  "phone": "string",
  "role": "string",
  "is_active": true,
  "last_login_at": "string",
  "created_at": "string",
  "updated_at": "string",
  "branch_name": "string"
}
```
