Allow admin to change password for given user. An admin can't change other admins password. The new password requires a confirmation to ensure that the admin didn't make a mistake by typing the new password.
POST
/actions/persons/{person_id}/change-password
curl
curl -X POST "http://api.example.com/actions/persons/a24a6ea4-ce75-4665-a070-57453082c25/change-password" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"password": "newSecurePassword123",
"password_2": "newSecurePassword123"
}'
import requests
url = "http://api.example.com/actions/persons/a24a6ea4-ce75-4665-a070-57453082c25/change-password"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
}
params = {}
payload = {
"password": "newSecurePassword123",
"password_2": "newSecurePassword123"
}
response = requests.post(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
curl \
--request POST 'http://api.example.com/actions/persons/a24a6ea4-ce75-4665-a070-57453082c25/change-password' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"password":"newSecurePassword123","password_2":"newSecurePassword123"}'
Request examples
{
"password": "newSecurePassword123",
"password_2": "newSecurePassword123"
}
Response examples (200)
{
"success": true
}
Response examples (400)
{
"error": true,
"message": "Password is too short."
}