Reset User Password
Admin endpoint to reset another user's password.
POST /api/auth/reset-user-password
Reset another user's password. Requires user:reset-password permission and the target user must be at a lower role level than the requesting user (role hierarchy enforcement).
Auth: Required — user:reset-password permission
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
userId | UUID | Yes | ID of the user whose password will be reset |
newPassword | string | Yes | New password (minimum 8 characters) |
Example
curl -X POST https://api.reten.ai/api/auth/reset-user-password \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"userId": "550e8400-e29b-41d4-a716-446655440000",
"newPassword": "NewSecurePass456!"
}'const response = await fetch("https://api.reten.ai/api/auth/reset-user-password", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
userId: "550e8400-e29b-41d4-a716-446655440000",
newPassword: "NewSecurePass456!",
}),
});import requests
response = requests.post(
"https://api.reten.ai/api/auth/reset-user-password",
headers={
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
},
json={
"userId": "550e8400-e29b-41d4-a716-446655440000",
"newPassword": "NewSecurePass456!",
},
)Response 201 Created
{
"message": "Password updated successfully"
}Error Responses
| Status | Description |
|---|---|
400 | Validation error — userId is not a UUID, or newPassword is shorter than 8 characters |
403 | The target is the current user — Use the reset-my-password endpoint to reset your own password |
403 | The target user does not belong to the active tenant — Cannot reset password for user outside your active tenant |
403 | The target user's role is equal to or higher than the current user's — Cannot reset password for user with equal or higher role |
404 | User not found |