Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

Reset a user's password

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
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT from POST /api/v1/auth/login sent as Authorization Bearer.

Path parameters
userIdstringrequired

The user whose password is being reset.

Request body
requiredapplication/json
new_passwordstringrequired
confirm_passwordstringrequired
Responses
200

Password reset

idstringrequired
branch_idstringrequired
emailstringrequired
full_namestringrequired
phonestringrequired
rolestringrequired
is_activebooleanrequired
last_login_atstring | nullrequired
created_atstringrequired
updated_atstringrequired
branch_namestring | nullrequired
400

Password must contain at least 8 characters, or the confirmation does not match

detailstringrequired
401

Not authenticated

detailstringrequired
403

Caller is not an admin

detailstringrequired
404

User not found

detailstringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'http://localhost:8000/api/v1/users/string/reset-password' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "new_password": "string",
  "confirm_password": "string"
}'
Response
{
  "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"
}